# jack-avery/voidfuck architecture

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

- Interactive diagram: https://gitdiagram.com/jack-avery/voidfuck
- Repository: https://github.com/jack-avery/voidfuck

## Overview

voidfuck is a small command-line interpreter for a Brainfuck-like language using Voidtongue commands. The workflow is: a user supplies a program file, the CLI reads and decodes it, splits it into whitespace-delimited tokens, then interprets those tokens while updating a byte tape and loop stack. The interpreter can also read a character from and print output to the terminal. These responsibilities are all implemented in `src/main.rs`; the README documents an included example program. The graph reflects the sampled entry point, not additional unsampled subsystems.

Main entry points: [`src/main.rs`](https://github.com/jack-avery/voidfuck/blob/main/src/main.rs) (Interpreter)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_program["Program file"]
node_cli["CLI entry<br/>[main.rs]"]
node_loader["File loading<br/>[main.rs]"]
node_tokenizer["Tokenization<br/>[main.rs]"]
node_interpreter["Interpreter<br/>[main.rs]"]
node_machine["Tape and loops<br/>[main.rs]"]
node_terminal(("Terminal"))

node_user -->|"runs with path"| node_cli
node_program -->|"read from"| node_loader
node_cli -->|"reads file"| node_loader
node_loader -->|"passes text"| node_tokenizer
node_tokenizer -->|"passes tokens"| node_interpreter
node_interpreter -->|"updates state"| node_machine
node_interpreter -->|"reads input"| node_terminal
node_interpreter -->|"prints output"| node_terminal

click node_cli "https://github.com/jack-avery/voidfuck/blob/main/src/main.rs"
click node_loader "https://github.com/jack-avery/voidfuck/blob/main/src/main.rs"
click node_tokenizer "https://github.com/jack-avery/voidfuck/blob/main/src/main.rs"
click node_interpreter "https://github.com/jack-avery/voidfuck/blob/main/src/main.rs"
click node_machine "https://github.com/jack-avery/voidfuck/blob/main/src/main.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_user toneBlue
class node_program,node_terminal toneIndigo
class node_cli,node_loader,node_tokenizer,node_interpreter,node_machine toneTeal
```

## Components

### Other components

- **User**
- **Program file**
- [CLI entry](https://github.com/jack-avery/voidfuck/blob/main/src/main.rs): `src/main.rs`
- [File loading](https://github.com/jack-avery/voidfuck/blob/main/src/main.rs): `src/main.rs`
- [Tokenization](https://github.com/jack-avery/voidfuck/blob/main/src/main.rs): `src/main.rs`
- [Interpreter](https://github.com/jack-avery/voidfuck/blob/main/src/main.rs): `src/main.rs`
- [Tape and loops](https://github.com/jack-avery/voidfuck/blob/main/src/main.rs): `src/main.rs`
- **Terminal**

## Connections

- User → CLI entry: runs with path
- Program file → File loading: read from
- CLI entry → File loading: reads file
- File loading → Tokenization: passes text
- Tokenization → Interpreter: passes tokens
- Interpreter → Tape and loops: updates state
- Interpreter → Terminal: reads input
- Interpreter → Terminal: prints output
