A JavaScript interpreter and REPL implemented in C from scratch, with split-screen Python visualizer of AST.
Screen.Recording.2025-06-25.at.11.00.52.mov
├── src/ # Source code
│ ├── lexer/ # Tokenization
│ ├── parser/ # AST generation
│ ├── interpreter/ # Execution engine
│ ├── debug/ # Debug and visualization tools
│ ├── memory/ # Memory management (planned)
│ ├── error/ # Error handling (planned)
│ └── cli/ # Command-line interface
├── include/ # Header files
├── tests/ # Test suite
├── visualizer/ # Python visualization tools
├── build/ # Build artifacts
├── planning.md # Design documentation
└── ARCHITECTURE.md # Current implementation status
makemake runExperience the interpreter with real-time visualization:
# Setup (one time)
cd visualizer
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd ..
# Build debug tool
make debug
# Launch live REPL
source visualizer/venv/bin/activate
python visualizer/live_repl.pyThis provides a split-screen interface with:
- Left pane: Interactive REPL for entering expressions
- Right pane: Live tokens and AST visualization
For one-off expression analysis:
# Visualize expressions
source visualizer/venv/bin/activate
python visualizer/visualize.py "2 + 3 * 4" # Both tokens and AST
python visualizer/visualize.py "(1 + 2) * 3" tokens # Just tokens
python visualizer/visualize.py "-5 + 8" ast # Just ASTSee visualizer/README.md for detailed visualization documentation.
- Lexical analysis (numbers, operators, parentheses)
- Expression parsing with proper precedence
- Basic arithmetic evaluation (+, -, *, /, unary -)
- Interactive REPL
- Comprehensive test suite
- Visualization tools
- Variable declarations and assignments
- String and boolean literals
- Comparison and logical operators
- Control flow (if/else, loops)
- Function declarations and calls
- Advanced REPL features (history, multi-line)
See planning.md for detailed design decisions and implementation phases.