A JSON parser
Your first contact with lexers and grammars. Tokenize, build the tree and fail with useful errors.
TypeScript · Python · Go · Java
From the expression to the automaton. Backtracking, groups and character classes without your language's regex.
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.
Regular expressions look like an esoteric language until you build the engine that runs them. Then they become what they are: a small tree and a machine that walks it.
You'll parse the expression, turn it into an automaton and run it against text. You'll implement groups, quantifiers and character classes, and see first-hand why certain expressions take forever.
8 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.
Literals, the dot, anchors, and a first minimal recursive engine.
A parser for quantifiers, alternation, character classes and groups.
Captured groups, lazy quantifiers and substitution.
NFA simulation and a performance comparison against the backtracking engine.
Your first contact with lexers and grammars. Tokenize, build the tree and fail with useful errors.
TypeScript · Python · Go · Java
Tokenizer, parser, evaluator and closures. Discover how a language runs your code, step by step.
Python · JavaScript · TypeScript
From source code to runnable bytecode. Lexing, AST, semantic analysis, code generation and a VM that runs it.
Rust · C++ · TypeScript