# delfinibnkadafi/el-language architecture

> Architecture diagram of the GitHub repository delfinibnkadafi/el-language, 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/delfinibnkadafi/el-language
- Repository: https://github.com/delfinibnkadafi/el-language

## Overview

Ellang is a C implementation of a high-level language with its own stack-based virtual machine. A user supplies an .ell source file to the CLI; the entry point loads it, initializes tokenization, compiles it to bytecode, and runs that bytecode. The parser handles syntax, type and scope checks, and emits instructions; the VM provides execution, variables, arrays, recursion, built-ins, and interactive I/O. The README documents these capabilities; sampled excerpts show representative lexer, parser, and VM behavior, but not every implementation detail.

Main entry points: [`src/elvm.c`](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c) (Virtual machine), [`src/main.c`](https://github.com/delfinibnkadafi/el-language/blob/main/src/main.c) (CLI runner), [`src/parser.c`](https://github.com/delfinibnkadafi/el-language/blob/main/src/parser.c) (Parser and compiler), [`src/lexer.c`](https://github.com/delfinibnkadafi/el-language/blob/main/src/lexer.c) (Lexer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["CLI runner<br/>[main.c]"]
end

subgraph group_compile["Compilation"]
  node_lexer["Lexer<br/>[lexer.c]"]
  node_parser["Parser and compiler<br/>[parser.c]"]
  node_bytecode["Bytecode<br/>[elvm.h]"]
end

subgraph group_execute["VM execution"]
  node_vm["Virtual machine<br/>[elvm.c]"]
  node_variables["Variables and arrays<br/>[elvm.c]"]
  node_callframes["Calls and recursion<br/>[elvm.c]"]
  node_control["Control flow<br/>[elvm.c]"]
end

subgraph group_services["Runtime services"]
  node_builtins["Built-in functions<br/>[elvm.c]"]
  node_stringops["Strings and formatting<br/>[elvm.c]"]
  node_console["Console I/O<br/>[elvm.c]"]
end

node_author(("Program author"))
node_source["Ellang source"]
node_stdin(("Standard input"))
node_stdout(("Program output"))
node_result["Execution result"]

node_author -->|"writes"| node_source
node_source -->|"provides file"| node_cli
node_cli -->|"initializes"| node_lexer
node_lexer -->|"supplies tokens"| node_parser
node_parser -->|"requests tokens"| node_lexer
node_parser -->|"emits instructions"| node_bytecode
node_cli -->|"compiles"| node_parser
node_cli -->|"runs bytecode"| node_vm
node_bytecode -->|"executes"| node_vm
node_vm -->|"accesses"| node_variables
node_vm -->|"manages calls"| node_callframes
node_vm -->|"dispatches jumps"| node_control
node_vm -->|"dispatches built-ins"| node_builtins
node_vm -->|"executes string ops"| node_stringops
node_vm -->|"executes I/O"| node_console
node_console -->|"reads"| node_stdin
node_stdin -->|"provides input"| node_console
node_console -->|"writes"| node_stdout
node_vm -->|"produces"| node_result

click node_cli "https://github.com/delfinibnkadafi/el-language/blob/main/src/main.c"
click node_lexer "https://github.com/delfinibnkadafi/el-language/blob/main/src/lexer.c"
click node_parser "https://github.com/delfinibnkadafi/el-language/blob/main/src/parser.c"
click node_bytecode "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.h"
click node_vm "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c"
click node_variables "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c"
click node_callframes "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c"
click node_control "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c"
click node_builtins "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c"
click node_stringops "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c"
click node_console "https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.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_cli toneBlue
class node_lexer,node_parser,node_bytecode toneAmber
class node_vm,node_variables,node_callframes,node_control toneMint
class node_builtins,node_stringops,node_console toneRose
class node_author,node_source,node_stdin,node_stdout,node_result toneIndigo
```

## Components

### CLI entry

- [CLI runner](https://github.com/delfinibnkadafi/el-language/blob/main/src/main.c): `src/main.c`

### Compilation

- [Lexer](https://github.com/delfinibnkadafi/el-language/blob/main/src/lexer.c): `src/lexer.c`
- [Parser and compiler](https://github.com/delfinibnkadafi/el-language/blob/main/src/parser.c): `src/parser.c`
- [Bytecode](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.h): `src/elvm.h`

### VM execution

- [Virtual machine](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`
- [Variables and arrays](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`
- [Calls and recursion](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`
- [Control flow](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`

### Runtime services

- [Built-in functions](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`
- [Strings and formatting](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`
- [Console I/O](https://github.com/delfinibnkadafi/el-language/blob/main/src/elvm.c): `src/elvm.c`

### Other components

- **Program author**
- **Ellang source**
- **Standard input**
- **Program output**
- **Execution result**

## Connections

- Program author → Ellang source: writes
- Ellang source → CLI runner: provides file
- CLI runner → Lexer: initializes
- Lexer → Parser and compiler: supplies tokens
- Parser and compiler → Lexer: requests tokens
- Parser and compiler → Bytecode: emits instructions
- CLI runner → Parser and compiler: compiles
- CLI runner → Virtual machine: runs bytecode
- Bytecode → Virtual machine: executes
- Virtual machine → Variables and arrays: accesses
- Virtual machine → Calls and recursion: manages calls
- Virtual machine → Control flow: dispatches jumps
- Virtual machine → Built-in functions: dispatches built-ins
- Virtual machine → Strings and formatting: executes string ops
- Virtual machine → Console I/O: executes I/O
- Console I/O → Standard input: reads
- Standard input → Console I/O: provides input
- Console I/O → Program output: writes
- Virtual machine → Execution result: produces
