Lab Project 05 / Language Implementation
AJS INTERPRETER
Typed Racket • Recursive-Descent Parsing • AST Evaluation
Educational interpreter
Project insight
Overview
A JavaScript-inspired language interpreter written in Typed Racket, with its own syntax and semantics rather than JavaScript compatibility.
Problem
Exploring how source text becomes executable behavior requires explicit handling of tokens, syntax trees, lexical scope, and runtime values.
My Contribution
Implemented the scanner, recursive-descent parser, lexical resolver, and tree-walk interpreter under src/ajs/libraries, including arithmetic, functions, classes, and mutable environments.
Main Technologies
- Typed Racket
- Recursive-Descent Parsing
- AST Evaluation
- Lexical Resolution
Key Technical Decisions
- Separated scanning, parsing, resolution, and evaluation into distinct language-processing stages.
- Resolved lexical scope before evaluating expressions against linked mutable environments.
- Used custom language semantics: const declares mutable bindings, let is not a declaration keyword, and output uses print followed by an expression.
Challenges and Solutions
- Connecting variable references to the correct enclosing scope.
- Used a resolver and environment-distance lookups rather than treating every name as global.
Outcome
Implemented an inspectable language pipeline with arithmetic, control flow, functions, and classes; repository examples exercise recursion and composed function calls.
Limitations / Verification Boundary
- This is a custom educational language, not a standards-compliant JavaScript engine; const is mutable and let is unsupported.
- The actual interpreter runs in Racket, not in a browser. The portfolio demonstration illustrates a limited subset rather than running the Racket runtime.
- Repository examples are evidence of intended usage, not a claim of comprehensive conformance or passing tests.
Evidence / Sources
Interactive Walkthrough
Local educational sample only. No deployed backend, hardware connection, network scan, or embedded interpreter.
Walkthrough not running