# imabd645/ez-language architecture

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

- Interactive diagram: https://gitdiagram.com/imabd645/ez-language
- Repository: https://github.com/imabd645/ez-language

## Overview

EZ is a dynamically typed, bytecode-compiled language with an optional static checker. A user runs a script or enters the REPL; the interpreter processes source into executable bytecode and runs it in a stack VM, with built-ins providing runtime capabilities. The graph also preserves documented async, GUI, FFI, package-management, and garbage-collection subsystems. Several connections are documented or referenced by the source index but their call sites were not excerpted, so those edges are dashed rather than asserted as verified calls.

Main entry points: [`src/cli/CLI.cpp`](https://github.com/imabd645/ez-language/blob/main/src/cli/CLI.cpp) (CLI and REPL), [`src/vm/BytecodeVMExecute.cpp`](https://github.com/imabd645/ez-language/blob/main/src/vm/BytecodeVMExecute.cpp) (Stack VM), [`src/builtins/Builtins.cpp`](https://github.com/imabd645/ez-language/blob/main/src/builtins/Builtins.cpp) (Core and data built-ins), [`src/builtins/core/Concurrency.cpp`](https://github.com/imabd645/ez-language/blob/main/src/builtins/core/Concurrency.cpp) (Async and concurrency)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_front["Language Front End"]
  node_lexer["Lexer<br/>[Lexer.cpp]"]
  node_parser["Parser<br/>[ParserExpr.cpp]"]
  node_ast["AST arena<br/>[ASTArena.h]"]
  node_typechecker["Optional type checker"]
  node_compiler["Bytecode compiler"]
end

subgraph group_execution["Runtime Execution"]
  node_bytecode["Bytecode format<br/>[Bytecode.cpp]"]
  node_serializer["Bytecode serializer"]
  node_vm["Stack VM"]
  node_values["Values and objects<br/>[Value.h]"]
  node_collector["Cycle collector<br/>[CycleCollector.cpp]"]
  node_eventloop["Event loop<br/>[EventLoop.cpp]"]
end

subgraph group_capabilities["Runtime Capabilities"]
  node_builtins["Core and data built-ins<br/>[Builtins.cpp]"]
  node_io["File and console I/O<br/>[File.cpp]"]
  node_network["Networking<br/>[Net.cpp]"]
  node_concurrency["Async and concurrency<br/>[Concurrency.cpp]"]
  node_ffi["Native FFI<br/>[FFI.cpp]"]
  node_gui["GUI framework<br/>[GUI_Core.cpp]"]
end

subgraph group_tools["Interpreter Interface"]
  node_cli["CLI and REPL<br/>[CLI.cpp]"]
  node_packages["Package management<br/>[PackageManager.h]"]
end

node_user(("Script author"))
node_registry(("Package registry"))

node_user -.->|"runs script"| node_cli
node_cli -.->|"starts processing"| node_lexer
node_lexer -.->|"provides tokens"| node_parser
node_parser -.->|"allocates syntax tree"| node_ast
node_cli -.->|"optionally checks"| node_typechecker
node_cli -.->|"compiles source"| node_compiler
node_compiler -.->|"emits instructions"| node_bytecode
node_cli -.->|"executes program"| node_vm
node_vm -.->|"executes instructions"| node_bytecode
node_cli -.->|"uses serialization"| node_serializer
node_vm -.->|"operates on values"| node_values
node_vm -.->|"uses collection"| node_collector
node_vm -.->|"integrates event loop"| node_eventloop
node_vm -.->|"registers built-ins"| node_builtins
node_builtins -.->|"includes I/O"| node_io
node_builtins -.->|"includes networking"| node_network
node_builtins -.->|"includes concurrency"| node_concurrency
node_builtins -.->|"includes native FFI"| node_ffi
node_builtins -.->|"exposes GUI"| node_gui
node_concurrency -.->|"uses event loop"| node_eventloop
node_concurrency -.->|"coordinates collection"| node_collector
node_packages -->|"requests packages"| node_registry
node_cli -.->|"offers package commands"| node_packages

click node_cli "https://github.com/imabd645/ez-language/blob/main/src/cli/CLI.cpp"
click node_lexer "https://github.com/imabd645/ez-language/blob/main/src/lexer/Lexer.cpp"
click node_parser "https://github.com/imabd645/ez-language/blob/main/src/parser/ParserExpr.cpp"
click node_ast "https://github.com/imabd645/ez-language/blob/main/src/ast/ASTArena.h"
click node_typechecker "https://github.com/imabd645/ez-language/blob/main/src/typechecker/TypeCheckerExpr.cpp"
click node_compiler "https://github.com/imabd645/ez-language/blob/main/src/compiler/BytecodeCompilerExpr.cpp"
click node_bytecode "https://github.com/imabd645/ez-language/blob/main/src/bytecode/Bytecode.cpp"
click node_serializer "https://github.com/imabd645/ez-language/blob/main/src/bytecode/serializer/BytecodeSerializer.cpp"
click node_vm "https://github.com/imabd645/ez-language/blob/main/src/vm/BytecodeVMExecute.cpp"
click node_values "https://github.com/imabd645/ez-language/blob/main/src/runtime/Value.h"
click node_collector "https://github.com/imabd645/ez-language/blob/main/src/gc/CycleCollector.cpp"
click node_eventloop "https://github.com/imabd645/ez-language/blob/main/src/eventloop/EventLoop.cpp"
click node_builtins "https://github.com/imabd645/ez-language/blob/main/src/builtins/Builtins.cpp"
click node_io "https://github.com/imabd645/ez-language/blob/main/src/builtins/io/File.cpp"
click node_network "https://github.com/imabd645/ez-language/blob/main/src/builtins/net/Net.cpp"
click node_concurrency "https://github.com/imabd645/ez-language/blob/main/src/builtins/core/Concurrency.cpp"
click node_ffi "https://github.com/imabd645/ez-language/blob/main/src/builtins/FFI/FFI.cpp"
click node_gui "https://github.com/imabd645/ez-language/blob/main/src/gui/GUI_Core.cpp"
click node_packages "https://github.com/imabd645/ez-language/blob/main/src/cli/PackageManager.h"

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_ast,node_typechecker,node_compiler toneBlue
class node_bytecode,node_serializer,node_vm,node_values,node_collector,node_eventloop toneAmber
class node_builtins,node_io,node_network,node_concurrency,node_ffi,node_gui toneMint
class node_cli,node_packages toneRose
class node_user,node_registry toneIndigo
```

## Components

### Language Front End

- [Lexer](https://github.com/imabd645/ez-language/blob/main/src/lexer/Lexer.cpp): `src/lexer/Lexer.cpp`
- [Parser](https://github.com/imabd645/ez-language/blob/main/src/parser/ParserExpr.cpp): `src/parser/ParserExpr.cpp`
- [AST arena](https://github.com/imabd645/ez-language/blob/main/src/ast/ASTArena.h): `src/ast/ASTArena.h`
- [Optional type checker](https://github.com/imabd645/ez-language/blob/main/src/typechecker/TypeCheckerExpr.cpp): `src/typechecker/TypeCheckerExpr.cpp`
- [Bytecode compiler](https://github.com/imabd645/ez-language/blob/main/src/compiler/BytecodeCompilerExpr.cpp): `src/compiler/BytecodeCompilerExpr.cpp`

### Runtime Execution

- [Bytecode format](https://github.com/imabd645/ez-language/blob/main/src/bytecode/Bytecode.cpp): `src/bytecode/Bytecode.cpp`
- [Bytecode serializer](https://github.com/imabd645/ez-language/blob/main/src/bytecode/serializer/BytecodeSerializer.cpp): `src/bytecode/serializer/BytecodeSerializer.cpp`
- [Stack VM](https://github.com/imabd645/ez-language/blob/main/src/vm/BytecodeVMExecute.cpp): `src/vm/BytecodeVMExecute.cpp`
- [Values and objects](https://github.com/imabd645/ez-language/blob/main/src/runtime/Value.h): `src/runtime/Value.h`
- [Cycle collector](https://github.com/imabd645/ez-language/blob/main/src/gc/CycleCollector.cpp): `src/gc/CycleCollector.cpp`
- [Event loop](https://github.com/imabd645/ez-language/blob/main/src/eventloop/EventLoop.cpp): `src/eventloop/EventLoop.cpp`

### Runtime Capabilities

- [Core and data built-ins](https://github.com/imabd645/ez-language/blob/main/src/builtins/Builtins.cpp): `src/builtins/Builtins.cpp`
- [File and console I/O](https://github.com/imabd645/ez-language/blob/main/src/builtins/io/File.cpp): `src/builtins/io/File.cpp`
- [Networking](https://github.com/imabd645/ez-language/blob/main/src/builtins/net/Net.cpp): `src/builtins/net/Net.cpp`
- [Async and concurrency](https://github.com/imabd645/ez-language/blob/main/src/builtins/core/Concurrency.cpp): `src/builtins/core/Concurrency.cpp`
- [Native FFI](https://github.com/imabd645/ez-language/blob/main/src/builtins/FFI/FFI.cpp): `src/builtins/FFI/FFI.cpp`
- [GUI framework](https://github.com/imabd645/ez-language/blob/main/src/gui/GUI_Core.cpp): `src/gui/GUI_Core.cpp`

### Interpreter Interface

- [CLI and REPL](https://github.com/imabd645/ez-language/blob/main/src/cli/CLI.cpp): `src/cli/CLI.cpp`
- [Package management](https://github.com/imabd645/ez-language/blob/main/src/cli/PackageManager.h): `src/cli/PackageManager.h`

### Other components

- **Script author**
- **Package registry**

## Connections

- Script author → CLI and REPL: runs script
- CLI and REPL → Lexer: starts processing (evidence: `src/cli/CLI.cpp`)
- Lexer → Parser: provides tokens
- Parser → AST arena: allocates syntax tree
- CLI and REPL → Optional type checker: optionally checks (evidence: `src/cli/CLI.cpp`)
- CLI and REPL → Bytecode compiler: compiles source (evidence: `src/cli/CLI.cpp`)
- Bytecode compiler → Bytecode format: emits instructions
- CLI and REPL → Stack VM: executes program (evidence: `src/cli/CLI.cpp`)
- Stack VM → Bytecode format: executes instructions
- CLI and REPL → Bytecode serializer: uses serialization (evidence: `src/cli/CLI.cpp`)
- Stack VM → Values and objects: operates on values (evidence: `src/vm/BytecodeVMExecute.cpp`)
- Stack VM → Cycle collector: uses collection
- Stack VM → Event loop: integrates event loop
- Stack VM → Core and data built-ins: registers built-ins
- Core and data built-ins → File and console I/O: includes I/O
- Core and data built-ins → Networking: includes networking
- Core and data built-ins → Async and concurrency: includes concurrency (evidence: `src/builtins/core/Concurrency.cpp`)
- Core and data built-ins → Native FFI: includes native FFI
- Core and data built-ins → GUI framework: exposes GUI
- Async and concurrency → Event loop: uses event loop (evidence: `src/builtins/core/Concurrency.cpp`)
- Async and concurrency → Cycle collector: coordinates collection (evidence: `src/builtins/core/Concurrency.cpp`)
- Package management → Package registry: requests packages (evidence: `src/cli/PackageManager.h`)
- CLI and REPL → Package management: offers package commands (evidence: `src/cli/CLI.cpp`)
