This book demonstrates one of many approaches of how to implement a compiler for the programming language Toad
. In doing so, it documents the journey of Toad ( ), a fellow amphibian who is enthusiastic about programming languages and their implementation. Like every journey ever, it is done so step-by-step: Each chapter concludes with a runnable compiler. The final product is an optimising compiler from Toad to ARM assembly.
The journey will teach you standard vocabularly of the community and enable understanding of real research papers. You will learn how to implement register allocation, pattern matching, bidirectional type checking, instruction selection, program analyzers, higher-order functions, and much more!
The book is freely available here
The book is not finished. If you want to stay updated, I’d love to tell you to just sign up to my mailing list, but I don’t have one. I don’t like spam and I don’t like being spammed or spamming others, something that feels more interactive is what I prefer. So, instead, join the Programming Languages Discord server here or contact me personally by some other means.
Hi, I’m Matthis ‘dasnacl’ Kruse. I’ve got a weird obsession with compilers, much like mountain climbers obsess about mountains. While I also do enjoy mountain climbing (alpine style), smelling (papers writing about) compilers pays my bills. I have developed a number of prototype compilers, both on a practical and theoretical level, the latter being part of my research job.
If you want to get in touch, drop me a message on discord (dasnacl
), find me on mastodon (@dasnacl
), or just drop me an email to dasnacl
at this site.