# yashtajne/pure architecture

> Architecture diagram of the GitHub repository yashtajne/pure, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yashtajne/pure
- Repository: https://github.com/yashtajne/pure

## Overview

Pure is a low-level C runtime and standard library, not a standalone application. A program enters through the platform-specific startup code, which initializes process context and calls `main`; the library then provides core text and memory primitives, streams and console access, and operating-system facilities such as files, directories, environment variables, and processes. The graph preserves these distinct capabilities, including unsampled modules. Relationship evidence is limited to the supplied excerpts and SOURCE INDEX; unsupported connections are omitted.

Main entry points: [`Implementation/Std/Start.c`](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Start.c) (Process startup), [`Implementation/Std/String.c`](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/String.c) (Managed strings), [`Implementation/Std/IO/Stream.c`](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Stream.c) (Streams), [`Implementation/Core/Charseq.c`](https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Charseq.c) (Character sequences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and platform"]
  node_startup["Process startup<br/>[Start.c]"]
  node_platformabi["Platform ABI<br/>[Kernel.h]"]
  node_winabi["Windows API bindings<br/>[Kernel32.h]"]
  node_self["Process context<br/>[Self.c]"]
end

subgraph group_core["Core primitives"]
  node_pure["Runtime types<br/>[Pure.h]"]
  node_ascii["ASCII conversion<br/>[ASCII.c]"]
  node_charseq["Character sequences<br/>[Charseq.c]"]
  node_corearray["Core arrays<br/>[Array.c]"]
  node_corememory["Core memory<br/>[Memory.c]"]
  node_corestring["Core strings<br/>[String.c]"]
end

subgraph group_data["Standard data"]
  node_stdarray["Standard arrays<br/>[Array.c]"]
  node_stdcharseq["Managed sequences<br/>[Charseq.c]"]
  node_stdstring["Managed strings<br/>[String.c]"]
  node_stdmemory["Standard memory<br/>[Memory.c]"]
end

subgraph group_io["Input and output"]
  node_stream["Streams<br/>[Stream.c]"]
  node_console["Console I/O<br/>[Console.c]"]
  node_read["Formatted input<br/>[Read.c]"]
  node_write["Output writing<br/>[Write.c]"]
  node_format["Formatting<br/>[Format.c]"]
end

subgraph group_os["Operating system"]
  node_file["File operations<br/>[File.c]"]
  node_directory["Directory operations<br/>[Directory.c]"]
  node_walker["Directory traversal<br/>[DirectoryWalker.c]"]
  node_path["Path operations<br/>[Path.c]"]
  node_environment["Environment access<br/>[Env.c]"]
  node_process["Process control<br/>[Process.c]"]
  node_arguments["Argument parsing<br/>[ArgParse.c]"]
end

node_program(("C program"))

node_startup -->|"calls main"| node_program
node_startup -->|"sets context"| node_self
node_startup -->|"gets current directory"| node_directory
node_startup -->|"sets console streams"| node_stream
node_startup -->|"builds arguments"| node_stdstring
node_startup -->|"parses environment"| node_stdcharseq
node_charseq -->|"copies text"| node_corememory
node_stdstring -->|"allocates and copies"| node_stdmemory
node_file -->|"stores stream state"| node_stream

click node_startup "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Start.c"
click node_platformabi "https://github.com/yashtajne/pure/blob/dev/Platform/Linux/Kernel.h"
click node_winabi "https://github.com/yashtajne/pure/blob/dev/Platform/Windows/Kernel32.h"
click node_pure "https://github.com/yashtajne/pure/blob/dev/Pure.h"
click node_ascii "https://github.com/yashtajne/pure/blob/dev/Implementation/Core/ASCII.c"
click node_charseq "https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Charseq.c"
click node_corearray "https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Array.c"
click node_corememory "https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Memory.c"
click node_corestring "https://github.com/yashtajne/pure/blob/dev/Implementation/Core/String.c"
click node_stdarray "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Array.c"
click node_stdcharseq "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Charseq.c"
click node_stdstring "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/String.c"
click node_stdmemory "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Memory.c"
click node_self "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Self.c"
click node_stream "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Stream.c"
click node_console "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Console.c"
click node_read "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Read.c"
click node_write "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Write.c"
click node_format "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Format.c"
click node_file "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/File.c"
click node_directory "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Directory.c"
click node_walker "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/DirectoryWalker.c"
click node_path "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Path.c"
click node_environment "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Env.c"
click node_process "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Process.c"
click node_arguments "https://github.com/yashtajne/pure/blob/dev/Implementation/Std/CLI/ArgParse.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_startup,node_platformabi,node_winabi,node_self toneBlue
class node_pure,node_ascii,node_charseq,node_corearray,node_corememory,node_corestring toneAmber
class node_stdarray,node_stdcharseq,node_stdstring,node_stdmemory toneMint
class node_stream,node_console,node_read,node_write,node_format toneRose
class node_file,node_directory,node_walker,node_path,node_environment,node_process,node_arguments,node_program toneIndigo
```

## Components

### Runtime and platform

- [Process startup](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Start.c): `Implementation/Std/Start.c`
- [Platform ABI](https://github.com/yashtajne/pure/blob/dev/Platform/Linux/Kernel.h): `Platform/Linux/Kernel.h`
- [Windows API bindings](https://github.com/yashtajne/pure/blob/dev/Platform/Windows/Kernel32.h): `Platform/Windows/Kernel32.h`
- [Process context](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Self.c): `Implementation/Std/Self.c`

### Core primitives

- [Runtime types](https://github.com/yashtajne/pure/blob/dev/Pure.h): `Pure.h`
- [ASCII conversion](https://github.com/yashtajne/pure/blob/dev/Implementation/Core/ASCII.c): `Implementation/Core/ASCII.c`
- [Character sequences](https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Charseq.c): `Implementation/Core/Charseq.c`
- [Core arrays](https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Array.c): `Implementation/Core/Array.c`
- [Core memory](https://github.com/yashtajne/pure/blob/dev/Implementation/Core/Memory.c): `Implementation/Core/Memory.c`
- [Core strings](https://github.com/yashtajne/pure/blob/dev/Implementation/Core/String.c): `Implementation/Core/String.c`

### Standard data

- [Standard arrays](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Array.c): `Implementation/Std/Array.c`
- [Managed sequences](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Charseq.c): `Implementation/Std/Charseq.c`
- [Managed strings](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/String.c): `Implementation/Std/String.c`
- [Standard memory](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/Memory.c): `Implementation/Std/Memory.c`

### Input and output

- [Streams](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Stream.c): `Implementation/Std/IO/Stream.c`
- [Console I/O](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Console.c): `Implementation/Std/IO/Console.c`
- [Formatted input](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Read.c): `Implementation/Std/IO/Read.c`
- [Output writing](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Write.c): `Implementation/Std/IO/Write.c`
- [Formatting](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/IO/Format.c): `Implementation/Std/IO/Format.c`

### Operating system

- [File operations](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/File.c): `Implementation/Std/OS/File.c`
- [Directory operations](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Directory.c): `Implementation/Std/OS/Directory.c`
- [Directory traversal](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/DirectoryWalker.c): `Implementation/Std/OS/DirectoryWalker.c`
- [Path operations](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Path.c): `Implementation/Std/OS/Path.c`
- [Environment access](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Env.c): `Implementation/Std/OS/Env.c`
- [Process control](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/OS/Process.c): `Implementation/Std/OS/Process.c`
- [Argument parsing](https://github.com/yashtajne/pure/blob/dev/Implementation/Std/CLI/ArgParse.c): `Implementation/Std/CLI/ArgParse.c`

### Other components

- **C program**

## Connections

- Process startup → C program: calls main (evidence: `Implementation/Std/Start.c`)
- Process startup → Process context: sets context (evidence: `Implementation/Std/Start.c`)
- Process startup → Directory operations: gets current directory (evidence: `Implementation/Std/Start.c`)
- Process startup → Streams: sets console streams (evidence: `Implementation/Std/Start.c`)
- Process startup → Managed strings: builds arguments (evidence: `Implementation/Std/Start.c`)
- Process startup → Managed sequences: parses environment (evidence: `Implementation/Std/Start.c`)
- Character sequences → Core memory: copies text (evidence: `Implementation/Core/Charseq.c`)
- Managed strings → Standard memory: allocates and copies (evidence: `Implementation/Std/String.c`)
- File operations → Streams: stores stream state (evidence: `Implementation/Std/OS/File.c`)
