How masak/ipso works
Core Components and Pipeline
a. Tokenization (tokenize.ts)
b. Parsing (parse-expr.ts, parse-value.ts)
c. Evaluation (evaluate.ts)
d. Compilation (compile.ts)
Key Architectural Elements
a. Environment Management:
• Relationship between env.ts and std-env.ts
• Global environment handling mentioned in the README's "Surprise 3"
• Scope management system
b. Evaluation Components:
• CEK Machine architecture (mentioned in README)
• Continuation handling (kont.ts, comp-kont.ts)
• State management (state.ts, comp-state.ts)
c. Core Data Structures:
• Expression representation (expr.ts)
• Value system (value.ts, abstract-value.ts)
• Primitive operations (prims.ts)
• Forms handling (forms.ts)
• Ipso Interpreter |
• ↓
• Input Process | | Parser | | Evaluator | | Compiler |
• tokenize.ts | -> | parse-expr.ts| -> | evaluate.ts | -> | compile.ts |
• parse-value.ts| | | | |
• ↑ ↑ ↑
• Core Types | |Environment| | Runtime Support |
• expr.ts | | env.ts | | state.ts |
• value.ts | | std-env.ts| | kont.ts |
• forms.ts | | | | comp-state.ts |
Additional Notes
• Showing the complete pipeline from input to execution
• Highlighting the unique aspects of this implementation (CEK machine, environment handling)
• Demonstrating the relationship between components
• Illustrating the special cases and surprises mentioned in the README