Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A book about writing compilers. In very early stages of writing.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

So, I'm writing a compiler book. Inspiration comes from this HN comment. Kudos also to Matthew Walton for thinking it'd be a good idea. ☺

Here's a tentative table of contents, cribbed straight from the HN comment in question, but hopefully evolvable into something more complete:

  • SSA
  • abstract interpretation
  • compiling high level languages
  • pointer analysis
  • compiling dynamic dispatch
  • garbage collection
  • closures

Other ideas, added later:

  • various optimizations, such as loop optimizations, strength reduction, and data-flow optimizations
  • register allocation

I expect to delve deeply into the Dragon book, SICP, and Modern Compiler Design in order to learn more of the theory and practice of writing compilers. It'll be both a learning experience and a teaching experience. ☺

My plan:

  • Use nqp as the implementation language/compiler platform. It has Perl 6 grammars and is meant to be used to build higher-level languages.
  • Build a language (called "Nugget") which is easy to read and explain. It has a small core and is easy to improve in various directions. It is powerful enough to self-host a parser easily.

Oh, here's another link, full of compiler optimizations. Might be useful when I dig into the literature.

Something went wrong with that request. Please try again.