# alef768/768cal architecture

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

- Interactive diagram: https://gitdiagram.com/alef768/768cal
- Repository: https://github.com/alef768/768cal

## Overview

768cal is a small interpreted language implemented in one Python file. A user supplies a script path; the interpreter reads and processes the script, then executes its commands. Its documented language capabilities include variables and substitution, console input/output, arithmetic and numeric operations, string manipulation, and control flow. These are conceptual runtime responsibilities within the monolith, not separate packages. The excerpts show script loading, tokenization, parsing, execution, and parts of command registration; unsampled implementation details are not inferred.

Main entry points: [`768cal.py`](https://github.com/alef768/768cal/blob/main/768cal.py) (Command registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Script execution"]
  node_interpreter["Interpreter loop<br/>[768cal.py]"]
  node_commands["Command registry<br/>[768cal.py]"]
end

subgraph group_language["Language features"]
  node_state["Variables and TEMPVAL<br/>[768cal.py]"]
  node_io["Console input/output<br/>[768cal.py]"]
  node_numeric["Numeric operations<br/>[768cal.py]"]
  node_strings["String operations<br/>[768cal.py]"]
  node_control["Control flow<br/>[768cal.py]"]
end

node_user(("Script author"))
node_script["768cal script"]

node_user -->|"runs script"| node_interpreter
node_user -->|"provides"| node_script
node_interpreter -->|"reads"| node_script
node_interpreter -->|"dispatches"| node_commands
node_commands -.->|"updates"| node_state
node_commands -->|"handles"| node_io
node_commands -->|"handles"| node_numeric
node_commands -->|"handles"| node_strings
node_commands -.->|"handles"| node_control

click node_interpreter "https://github.com/alef768/768cal/blob/main/768cal.py"
click node_commands "https://github.com/alef768/768cal/blob/main/768cal.py"
click node_state "https://github.com/alef768/768cal/blob/main/768cal.py"
click node_io "https://github.com/alef768/768cal/blob/main/768cal.py"
click node_numeric "https://github.com/alef768/768cal/blob/main/768cal.py"
click node_strings "https://github.com/alef768/768cal/blob/main/768cal.py"
click node_control "https://github.com/alef768/768cal/blob/main/768cal.py"

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_interpreter,node_commands toneBlue
class node_state,node_io,node_numeric,node_strings,node_control toneAmber
class node_user,node_script toneIndigo
```

## Components

### Script execution

- [Interpreter loop](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`
- [Command registry](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`

### Language features

- [Variables and TEMPVAL](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`
- [Console input/output](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`
- [Numeric operations](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`
- [String operations](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`
- [Control flow](https://github.com/alef768/768cal/blob/main/768cal.py): `768cal.py`

### Other components

- **Script author**
- **768cal script**

## Connections

- Script author → Interpreter loop: runs script (evidence: `README.md`)
- Script author → 768cal script: provides (evidence: `README.md`)
- Interpreter loop → 768cal script: reads (evidence: `768cal.py`)
- Interpreter loop → Command registry: dispatches (evidence: `768cal.py`)
- Command registry → Variables and TEMPVAL: updates (evidence: `768cal.py`)
- Command registry → Console input/output: handles (evidence: `768cal.py`)
- Command registry → Numeric operations: handles (evidence: `768cal.py`)
- Command registry → String operations: handles (evidence: `768cal.py`)
- Command registry → Control flow: handles (evidence: `768cal.py`)
