A toy Lox language interpreter implemented while following the Crafting Interpreters book.
The language implementation is not complete. Only the scanner (lexer) is functional so far. There is no entry point — only test files are runnable.
- Language: TypeScript on Bun instead of Java/C.
- Grammar generator: A custom PEG-grammar-to-opcodes compiler (
grammar_builder.ts) built from scratch, not in the book. - Parser VM: A custom stack-based virtual machine (
parser.ts) that interprets the opcodes produced by the grammar generator. - Two scanners:
scanner.tsfollows the book's class-based design;scanner2.tsis a separate experiment with a simpler union token type.
bun installbun test