How eliaperantoni/koi works
Main Components
A. Compiler/Interpreter Pipeline Components:
• Lexer (src/lexer/)
• Parser (src/parser/)
• AST (src/ast/)
• Interpreter (src/interp/)
B. Web Interface:
• Web Frontend (web/)
• Code Snippets System (web/snippets/)
Component Relationships and Flow
[Source Code Input] → [Lexer] → [Parser] → [AST] → [Interpreter] → [Program Output]
Detailed Component Breakdown
Lexer Component:
• Submodules: Raw Lexer, Peek Buffer, Record System
Parser Component:
• Submodules: Command Parser, Expression Parser, Function Parser, Statement Parser
• How these components interact with the AST generation
Interpreter Component:
• Environment Management
• Function Handling
• Native Functions Support
• Command Execution System
• Value System
Web Interface:
• Connection to the core interpreter
• Snippet management system
• Firebase deployment configuration
Implementation Details to Highlight
• Token handling system
• Environment management
• Function call mechanism
• Native function integration
• Command execution pipeline
Architectural Patterns
Emphasize:
• Pipeline architecture of the compiler
• Visitor pattern for AST traversal
• Environment hierarchy
• Module system design
Remember to:
• Both compile-time and runtime components clearly separated
• Test coverage and golden test integration points
• Public APIs and interfaces
• Error handling flow
This will create a comprehensive system design that accurately represents the Koi language implementation while maintaining clarity and usefulness for development purposes.