Project P: The Pretty Laughable Compiler
Create your own programming language in a weekend!
We start with simple things. The first chapter is a program that can parse and evaluate an expression, and that’s less than 100 LoC.
Then we build something that resembles a programming language — it has common language constructs like variables, control flows, and functions — an interpreter in about 200 LoC.
If you are still bored, take the challenge of building a compiler and enjoy running your program natively on your machine.
The final compiler is on GitHub so you can play with it.
https://github.com/byo-books/pretty_laughable_lang
- P1. Expression Evaluation (Beginner)
- P2. Variables, Control Flows, and Functions (Intermediate)
- P3. Static Typing and Compiling to Binary (Advanced)