# zer0-official/simpl-py architecture

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

- Interactive diagram: https://gitdiagram.com/zer0-official/simpl-py
- Repository: https://github.com/zer0-official/simpl-py

## Overview

Simpl-Py is a Python-like recreational language implemented primarily in one script. A user enters commands into its interactive loop; the interpreter dispatches tokens to command handlers, which implement printing and math, variables, text-file operations, modules, and other commands. The README also describes module imports and coded errors, while the excerpts show module loading and error handling. Most runtime responsibilities share Simpl.py; omitted source prevents tracing every handler and dispatch in detail.

Main entry points: [`Simpl.py`](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py) (Token dispatcher), [`src/MyDocuments`](https://github.com/zer0-official/simpl-py/tree/main/src/MyDocuments) (User documents), [`src/mod/SPY_module.py`](https://github.com/zer0-official/simpl-py/blob/main/src/mod/SPY_module.py) (Example module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Interpreter runtime"]
  node_repl["Interactive loop<br/>[Simpl.py]"]
  node_dispatcher["Token dispatcher<br/>[Simpl.py]"]
  node_system["System information<br/>[Simpl.py]"]
end

subgraph group_commands["Language commands"]
  node_print["Print commands<br/>[Simpl.py]"]
  node_math["Print math<br/>[Simpl.py]"]
  node_slash["Slash commands<br/>[Simpl.py]"]
  node_call["Call commands<br/>[Simpl.py]"]
end

subgraph group_state["Variables and files"]
  node_variables["Variable commands<br/>[Simpl.py]"]
  node_textfiles["Text-file commands<br/>[Simpl.py]"]
  node_documents[("User documents")]
end

subgraph group_modules["Modules and errors"]
  node_module_handler["Module handler<br/>[Simpl.py]"]
  node_module_code["Example module<br/>[SPY_module.py]"]
  node_errors["Error reporting<br/>[Simpl.py]"]
end

node_user(("Language user"))

node_user -->|"enters commands"| node_repl
node_repl -.->|"dispatches tokens"| node_dispatcher
node_dispatcher -->|"dispatches"| node_print
node_dispatcher -->|"dispatches"| node_variables
node_dispatcher -->|"dispatches"| node_textfiles
node_dispatcher -->|"dispatches"| node_module_handler
node_dispatcher -->|"dispatches"| node_slash
node_dispatcher -->|"dispatches"| node_call
node_print -->|"handles math"| node_math
node_textfiles -->|"reads and writes"| node_documents
node_module_handler -->|"imports and invokes"| node_module_code
node_module_handler -->|"reports failures"| node_errors
node_dispatcher -->|"reports invalid tokens"| node_errors
node_repl -.->|"displays information"| node_system

click node_repl "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_dispatcher "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_print "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_math "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_slash "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_call "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_variables "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_textfiles "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_documents "https://github.com/zer0-official/simpl-py/tree/main/src/MyDocuments"
click node_module_handler "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_module_code "https://github.com/zer0-official/simpl-py/blob/main/src/mod/SPY_module.py"
click node_errors "https://github.com/zer0-official/simpl-py/blob/main/Simpl.py"
click node_system "https://github.com/zer0-official/simpl-py/blob/main/Simpl.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_repl,node_dispatcher,node_system,node_user toneBlue
class node_print,node_math,node_slash,node_call toneAmber
class node_variables,node_textfiles,node_documents toneMint
class node_module_handler,node_module_code,node_errors toneRose
```

## Components

### Interpreter runtime

- [Interactive loop](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [Token dispatcher](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [System information](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`

### Language commands

- [Print commands](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [Print math](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [Slash commands](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [Call commands](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`

### Variables and files

- [Variable commands](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [Text-file commands](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [User documents](https://github.com/zer0-official/simpl-py/tree/main/src/MyDocuments): `src/MyDocuments`

### Modules and errors

- [Module handler](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`
- [Example module](https://github.com/zer0-official/simpl-py/blob/main/src/mod/SPY_module.py): `src/mod/SPY_module.py`
- [Error reporting](https://github.com/zer0-official/simpl-py/blob/main/Simpl.py): `Simpl.py`

### Other components

- **Language user**

## Connections

- Language user → Interactive loop: enters commands (evidence: `README.md`)
- Interactive loop → Token dispatcher: dispatches tokens (evidence: `Simpl.py`)
- Token dispatcher → Print commands: dispatches (evidence: `Simpl.py`)
- Token dispatcher → Variable commands: dispatches (evidence: `Simpl.py`)
- Token dispatcher → Text-file commands: dispatches (evidence: `Simpl.py`)
- Token dispatcher → Module handler: dispatches (evidence: `Simpl.py`)
- Token dispatcher → Slash commands: dispatches (evidence: `Simpl.py`)
- Token dispatcher → Call commands: dispatches (evidence: `Simpl.py`)
- Print commands → Print math: handles math (evidence: `README.md`)
- Text-file commands → User documents: reads and writes (evidence: `Simpl.py`)
- Module handler → Example module: imports and invokes (evidence: `Simpl.py`)
- Module handler → Error reporting: reports failures (evidence: `Simpl.py`)
- Token dispatcher → Error reporting: reports invalid tokens (evidence: `Simpl.py`)
- Interactive loop → System information: displays information (evidence: `Simpl.py`)
