# pyrotek45/nova-lang architecture

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

- Interactive diagram: https://gitdiagram.com/pyrotek45/nova-lang
- Repository: https://github.com/pyrotek45/nova-lang

## Overview

Nova is a statically typed language toolchain and runtime: users run or check source through one CLI, which delegates language processing to NovaCore and executes compiled bytecode on a stack VM. The documented workflow also includes REPL, debugging, disassembly, and GitHub-based dependency operations. The graph preserves those product branches and the built-in native/game capabilities. Pipeline links are based on the documented behavior and sampled imports; unsampled module internals limit certainty about finer-grained dispatch.

Main entry points: [`novacli/src/main.rs`](https://github.com/pyrotek45/nova-lang/blob/main/novacli/src/main.rs) (CLI commands), [`novacore/src/lib.rs`](https://github.com/pyrotek45/nova-lang/blob/main/novacore/src/lib.rs) (NovaCore), [`parser/src/lib.rs`](https://github.com/pyrotek45/nova-lang/blob/main/parser/src/lib.rs) (Parser), [`vm/src/lib.rs`](https://github.com/pyrotek45/nova-lang/blob/main/vm/src/lib.rs) (Stack VM)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Language Front End"]
  node_lexer["Lexer<br/>[lib.rs]"]
  node_parser["Parser<br/>[lib.rs]"]
  node_typechecker["Type checker<br/>[lib.rs]"]
  node_common["Language data<br/>[lib.rs]"]
end

subgraph group_codegen["Compilation"]
  node_compiler["Bytecode compiler<br/>[lib.rs]"]
  node_optimizer["Optimizer<br/>[lib.rs]"]
  node_assembler["Assembler<br/>[lib.rs]"]
end

subgraph group_runtime["Execution"]
  node_core["NovaCore<br/>[lib.rs]"]
  node_vm["Stack VM<br/>[lib.rs]"]
  node_memory["VM memory<br/>[memory_manager.rs]"]
end

subgraph group_tools["User Tools"]
  node_cli["CLI commands<br/>[main.rs]"]
  node_disassembler["Disassembler<br/>[lib.rs]"]
  node_debugger["Debugger<br/>[lib.rs]"]
end

subgraph group_integrations["Native Capabilities"]
  node_native["Native functions<br/>[lib.rs]"]
  node_raylib["Raylib bindings<br/>[raylib.rs]"]
end

node_user(("Nova user"))
node_github(("GitHub"))

node_user -->|"runs commands"| node_cli
node_cli -->|"invokes processing"| node_core
node_core -->|"tokenizes source"| node_lexer
node_lexer -->|"provides tokens"| node_parser
node_parser -->|"checks program"| node_typechecker
node_typechecker -->|"provides checked program"| node_compiler
node_compiler -->|"provides bytecode"| node_optimizer
node_optimizer -->|"provides instructions"| node_assembler
node_assembler -->|"returns bytecode"| node_core
node_core -->|"runs bytecode"| node_vm
node_vm -->|"manages values"| node_memory
node_core -->|"registers built-ins"| node_native
node_native -->|"exposes game APIs"| node_raylib
node_cli -.->|"fetches imports"| node_github
node_parser -.->|"fetches imported source"| node_github
node_cli -->|"disassembles output"| node_disassembler
node_cli -->|"starts debug run"| node_debugger
node_debugger -->|"inspects execution"| node_vm

click node_cli "https://github.com/pyrotek45/nova-lang/blob/main/novacli/src/main.rs"
click node_core "https://github.com/pyrotek45/nova-lang/blob/main/novacore/src/lib.rs"
click node_lexer "https://github.com/pyrotek45/nova-lang/blob/main/lexer/src/lib.rs"
click node_parser "https://github.com/pyrotek45/nova-lang/blob/main/parser/src/lib.rs"
click node_typechecker "https://github.com/pyrotek45/nova-lang/blob/main/typechecker/src/lib.rs"
click node_common "https://github.com/pyrotek45/nova-lang/blob/main/common/src/lib.rs"
click node_compiler "https://github.com/pyrotek45/nova-lang/blob/main/compiler/src/lib.rs"
click node_optimizer "https://github.com/pyrotek45/nova-lang/blob/main/optimizer/src/lib.rs"
click node_assembler "https://github.com/pyrotek45/nova-lang/blob/main/assembler/src/lib.rs"
click node_vm "https://github.com/pyrotek45/nova-lang/blob/main/vm/src/lib.rs"
click node_memory "https://github.com/pyrotek45/nova-lang/blob/main/vm/src/memory_manager.rs"
click node_native "https://github.com/pyrotek45/nova-lang/blob/main/native/src/lib.rs"
click node_raylib "https://github.com/pyrotek45/nova-lang/blob/main/native/src/raylib.rs"
click node_disassembler "https://github.com/pyrotek45/nova-lang/blob/main/disassembler/src/lib.rs"
click node_debugger "https://github.com/pyrotek45/nova-lang/blob/main/debugger/src/lib.rs"

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_typechecker,node_common,node_user toneBlue
class node_compiler,node_optimizer,node_assembler toneAmber
class node_core,node_vm,node_memory toneMint
class node_cli,node_disassembler,node_debugger toneRose
class node_native,node_raylib,node_github toneIndigo
```

## Components

### Language Front End

- [Lexer](https://github.com/pyrotek45/nova-lang/blob/main/lexer/src/lib.rs): `lexer/src/lib.rs`
- [Parser](https://github.com/pyrotek45/nova-lang/blob/main/parser/src/lib.rs): `parser/src/lib.rs`
- [Type checker](https://github.com/pyrotek45/nova-lang/blob/main/typechecker/src/lib.rs): `typechecker/src/lib.rs`
- [Language data](https://github.com/pyrotek45/nova-lang/blob/main/common/src/lib.rs): `common/src/lib.rs`

### Compilation

- [Bytecode compiler](https://github.com/pyrotek45/nova-lang/blob/main/compiler/src/lib.rs): `compiler/src/lib.rs`
- [Optimizer](https://github.com/pyrotek45/nova-lang/blob/main/optimizer/src/lib.rs): `optimizer/src/lib.rs`
- [Assembler](https://github.com/pyrotek45/nova-lang/blob/main/assembler/src/lib.rs): `assembler/src/lib.rs`

### Execution

- [NovaCore](https://github.com/pyrotek45/nova-lang/blob/main/novacore/src/lib.rs): `novacore/src/lib.rs`
- [Stack VM](https://github.com/pyrotek45/nova-lang/blob/main/vm/src/lib.rs): `vm/src/lib.rs`
- [VM memory](https://github.com/pyrotek45/nova-lang/blob/main/vm/src/memory_manager.rs): `vm/src/memory_manager.rs`

### User Tools

- [CLI commands](https://github.com/pyrotek45/nova-lang/blob/main/novacli/src/main.rs): `novacli/src/main.rs`
- [Disassembler](https://github.com/pyrotek45/nova-lang/blob/main/disassembler/src/lib.rs): `disassembler/src/lib.rs`
- [Debugger](https://github.com/pyrotek45/nova-lang/blob/main/debugger/src/lib.rs): `debugger/src/lib.rs`

### Native Capabilities

- [Native functions](https://github.com/pyrotek45/nova-lang/blob/main/native/src/lib.rs): `native/src/lib.rs`
- [Raylib bindings](https://github.com/pyrotek45/nova-lang/blob/main/native/src/raylib.rs): `native/src/raylib.rs`

### Other components

- **Nova user**
- **GitHub**

## Connections

- Nova user → CLI commands: runs commands
- CLI commands → NovaCore: invokes processing
- NovaCore → Lexer: tokenizes source
- Lexer → Parser: provides tokens
- Parser → Type checker: checks program
- Type checker → Bytecode compiler: provides checked program
- Bytecode compiler → Optimizer: provides bytecode
- Optimizer → Assembler: provides instructions
- Assembler → NovaCore: returns bytecode
- NovaCore → Stack VM: runs bytecode
- Stack VM → VM memory: manages values
- NovaCore → Native functions: registers built-ins
- Native functions → Raylib bindings: exposes game APIs
- CLI commands → GitHub: fetches imports
- Parser → GitHub: fetches imported source
- CLI commands → Disassembler: disassembles output
- CLI commands → Debugger: starts debug run
- Debugger → Stack VM: inspects execution
