Build your own regex engine
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 Lisp interpreter from scratch. Write a tokenizer, parser and evaluator, then add closures to discover how a language executes your code.
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.
Lisp was chosen for one reason: its syntax is so minimal that the parser gets out of the way in an afternoon, letting you spend the rest of the challenge on the interesting part, which is evaluation.
You'll build a full interpreter: environments, functions, closures, recursion and macros. By the end you'll understand what your favourite language does between hitting “run” and the result appearing.
11 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.
Tokenizer, S-expression reader, and representing atoms and lists.
Environments, variables, arithmetic, conditionals and special forms.
Lambdas, lexical scope, recursion and optimised tail calls.
Quote, macros, errors with a trace, and a small library.
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
Build a compiler from scratch. Turn source code into bytecode with lexing, an AST, semantic analysis, code generation and a virtual machine.
Rust · C++ · TypeScript