Idea · Aug 23, 2026
Mini-Compiler Workbench
A multi-week course project in which students implement a complete compiler pipeline from scratch: lexer, recursive-descent parser, AST, type checker, and a bytecode virtual machine, culminating in a working language that compiles and runs a reference program.
What it would do
Most CS students use compilers but never build one. Mini-Compiler Workbench is a staged assignment sequence where each lab builds on the previous: Lab 1 implements a regex-based lexer for a toy language; Lab 2 adds a recursive-descent parser producing an explicit AST; Lab 3 implements a structural type checker; Lab 4 generates bytecode for a stack-based VM; Lab 5 builds the VM itself. A reference language spec is provided that supports variables, arithmetic, conditionals, while-loops, and functions. Each lab has an autograded test suite. The final deliverable is a demo that compiles and runs Fibonacci, merge sort, and a student-chosen program. Students may use TypeScript, Python, or Java.
Key features
- Five modular labs with clear interfaces so each stage can be graded independently
- Reference language specification with a grammar and sample programs
- Autograded test suite for each lab stage (lexer tokens, parser AST shapes, VM execution traces)
- Stretch goals: garbage collection, closures, or a REPL mode
- Written reflection prompt comparing their VM design decisions to real-world VMs (CPython, JVM)