Full disclosure: I’m no expert I just really like programming languages. I use Rust and so a lot of resources here will be geared towards that but hopefully the knowledge is general enough to be translated to your language of preference.
How to use this guide
I tried my best to arrange them into categories that made sense to me. I’m personally horrible at following rigid curriculums and prefer jumping around to whatever interests me.
1. Crafting Interpreters
This book is the best introduction to language development, I’ve seen. Most programming books are either:
- A short blog post on writing a fancy calculator, or.
- A 600 page compiler textbook, that assumes you’re already a master of Programming Language theory.
Crafting Interpreters is a mix of the best parts of both, it focuses mainly on applied stuff but also makes sure to do justice to the theory associated with it. Throughout the book, you implement an inter
All in all my only complaint with it is that the first part is written in Java, I personally don’t like Java and feel it’s not well suited for writing languages.
2. Whatever you want
Parsers
Simple but Powerful Pratt Parsing
Great article on how to write pratt parsers in Rust.
Learning Parser Combinators With Rust
Tutorial on implementing Parser Combinators in Rust.
Interpreters
The best.
Writing a cheap fast interpreter
Great article by Facebook engineers on writing fast interpreters and the known tradeoffs.
Compilers
How I wrote my own “proper” programming language
Great tutorial on writing a compiler in Ocaml.
Writing a WASM compiler in Rust
Covers implementing a compiler for a subset of the WebAssembly spec in Rust.
Example repo for using Cranelift for writing a JIT-compiled language.