# d3tu/zero architecture

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

- Interactive diagram: https://gitdiagram.com/d3tu/zero
- Repository: https://github.com/d3tu/zero

## Overview

Zero Lang is an unfinished language implementation: the README marks lexing and parsing complete, while generation and runtime are in progress. Its documented workflow is source text through those language stages; syntax includes declarations, expressions, control flow, functions, and returns. The tree also names utility, embedding, and extension modules, but their behavior and wiring are not shown. The only sampled entry point, main.cc, is a stub, so CLI behavior and concrete module calls cannot be established.

Main entry points: [`lexer.hh`](https://github.com/d3tu/zero/blob/main/lexer.hh) (Lexer), [`parser.hh`](https://github.com/d3tu/zero/blob/main/parser.hh) (Parser), [`gen.hh`](https://github.com/d3tu/zero/blob/main/gen.hh) (Generator), [`vm.hh`](https://github.com/d3tu/zero/blob/main/vm.hh) (Runtime VM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_language["Language Front End"]
  node_lexer["Lexer<br/>[lexer.hh]"]
  node_parser["Parser<br/>[parser.hh]"]
  node_util["Utilities<br/>[util.hh]"]
end

subgraph group_execution["Code Execution"]
  node_generator["Generator<br/>[gen.hh]"]
  node_vm["Runtime VM<br/>[vm.hh]"]
end

subgraph group_interfaces["Interfaces"]
  node_cli["CLI Entry<br/>[main.cc]"]
  node_embedder["Embedder<br/>[embed.hh]"]
  node_extensions["Extensions<br/>[ext.hh]"]
end

node_author(("Language Author"))
node_source["Zero Source"]

node_author -->|"writes"| node_source
node_source -->|"lexes"| node_lexer
node_lexer -->|"parses tokens"| node_parser
node_parser -->|"generates code"| node_generator
node_generator -->|"executes on"| node_vm

click node_lexer "https://github.com/d3tu/zero/blob/main/lexer.hh"
click node_parser "https://github.com/d3tu/zero/blob/main/parser.hh"
click node_generator "https://github.com/d3tu/zero/blob/main/gen.hh"
click node_vm "https://github.com/d3tu/zero/blob/main/vm.hh"
click node_util "https://github.com/d3tu/zero/blob/main/util.hh"
click node_cli "https://github.com/d3tu/zero/blob/main/main.cc"
click node_embedder "https://github.com/d3tu/zero/blob/main/embed.hh"
click node_extensions "https://github.com/d3tu/zero/blob/main/ext.hh"

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_lexer,node_parser,node_util toneBlue
class node_generator,node_vm toneAmber
class node_cli,node_embedder,node_extensions toneMint
class node_author,node_source toneIndigo
```

## Components

### Language Front End

- [Lexer](https://github.com/d3tu/zero/blob/main/lexer.hh): `lexer.hh`
- [Parser](https://github.com/d3tu/zero/blob/main/parser.hh): `parser.hh`
- [Utilities](https://github.com/d3tu/zero/blob/main/util.hh): `util.hh`

### Code Execution

- [Generator](https://github.com/d3tu/zero/blob/main/gen.hh): `gen.hh`
- [Runtime VM](https://github.com/d3tu/zero/blob/main/vm.hh): `vm.hh`

### Interfaces

- [CLI Entry](https://github.com/d3tu/zero/blob/main/main.cc): `main.cc`
- [Embedder](https://github.com/d3tu/zero/blob/main/embed.hh): `embed.hh`
- [Extensions](https://github.com/d3tu/zero/blob/main/ext.hh): `ext.hh`

### Other components

- **Language Author**
- **Zero Source**

## Connections

- Language Author → Zero Source: writes
- Zero Source → Lexer: lexes
- Lexer → Parser: parses tokens
- Parser → Generator: generates code
- Generator → Runtime VM: executes on
