Build your own Lisp interpreter
Build a Lisp interpreter from scratch. Write a tokenizer, parser and evaluator, then add closures to discover how a language executes your code.
Python · JavaScript · TypeScript
Build a compiler from scratch. Turn source code into bytecode with lexing, an AST, semantic analysis, code generation and a virtual machine.
Build it in your language
The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.
Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.
This is the longest challenge in the catalog and the one that brings the most together: your own language, with its compiler and its virtual machine, built end to end.
You'll go from text to tokens, from tokens to a tree, from the tree to a type-checked representation, from there to bytecode and, finally, to a stack machine that executes it. You'll finish running programs written in a language you designed yourself.
16 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.
Lexer, a parser with precedence, and the language's syntax tree.
Name resolution, scopes, type checking and useful errors.
Instruction set, constants, jumps, and compiling the tree.
Stack virtual machine, call frames, functions and optimisations.
Build a Lisp interpreter from scratch. Write a tokenizer, parser and evaluator, then add closures to discover how a language executes your code.
Python · JavaScript · TypeScript
Build a regex engine from scratch. Turn expressions into automata with backtracking, groups and character classes without using a regex library.
TypeScript · Python · Rust
Build a JSON parser from scratch. Tokenize input, parse the grammar, construct a syntax tree and report useful errors for invalid JSON.
TypeScript · Python · Go · Java