use this repo: /Users/careylai/Desktop/geobe
You are an expert programming language designer and Python engineer.
Design and implement a Python-based interpreter for a new esoteric programming language where computation is represented using ASCII/Unicode geometric shapes arranged spatially in 2D grids.
The language encodes programs as diagrams like:
△
○ → □ ▽
Each symbol is a semantic operator:
CORE SYMBOLS:
- ○ = input source (read / stdin / external value)
- □ = storage / variable / memory node
- △ = transformation / function / computation
- ▽ = output / sink (print / return)
- → = directional flow (left-to-right execution)
Optional:
- ↑ ↓ ← → = directional flow modifiers
- Program is a 2D grid of characters (multiline string)
- Execution starts at any ○ node
- Flow follows arrows (→ ← ↑ ↓)
- Nodes execute when visited
- Output is collected from ▽
- Multiple flows may exist (you may implement single-threaded traversal for MVP, but design should allow extension)
- PARSER
- Accept multiline string input
- Convert into a 2D grid (list of lists)
- INTERPRETER ENGINE
- Traverse grid based on directional arrows
- Maintain execution state:
- current position(s)
- memory store (for □ nodes)
- input buffer (for ○ nodes)
- output buffer (for ▽ nodes)
- SYMBOL SEMANTICS
Implement behavior:
○ : read input value into flow □ : store current value △ : transform value (start with identity function, but design extensible system) ▽ : output current value → ← ↑ ↓ : control movement
- FLOW RULES
- Movement determined by arrows
- If no direction exists, terminate path
- Support branching if multiple directions exist (can be BFS/DFS or simplified single-path MVP)
△
○ → □ ▽
EXPECTED BEHAVIOR:
- Take input
- Store it
- Transform it (identity by default)
- Output unchanged value
- Use Python 3
- Modular architecture:
- Parser
- Interpreter
- Execution Engine
- Include a demo runner (main)
- Print execution trace for debugging
- Keep code extensible for future symbol additions
If possible, include:
- User-defined transformations for △
- Multi-flow concurrency model
- Step-by-step visual debug mode
- Support for annotations in grid (ignored characters)
- File loading/saving for ".geo" programs
This is a spatial programming language:
- Geometry defines syntax
- Flow defines execution
- English is a semantic interpretation layer, not the source of truth
Return:
- Full Python implementation
- Example program(s)
- Short architecture explanation (max 10 lines)