Skip to content

Instantly share code, notes, and snippets.

@mrnugget
Last active June 3, 2023 11:59
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mrnugget/97d65fafc2e92cca0a3c38a1b37700ec to your computer and use it in GitHub Desktop.
Save mrnugget/97d65fafc2e92cca0a3c38a1b37700ec to your computer and use it in GitHub Desktop.
So you're finished with "Writing An Interpreter In Go" and want to read more?

This is what I once wrote to a reader:

  • Nand2Tetris book - http://www.nand2tetris.org/
  • The paper "An Incremental Approach to Compiler Construction", by Abdulaziz Ghuloum. You can find a hosted PDF version of the paper and an implementation of its contents here: https://github.com/namin/inc\
  • Jack Crenshaw's classic "LET'S BUILD A COMPILER" from 1988. Even though it's kinda dated (he's using Turbo Pascal), it's one of the great "let's roll our sleeves up and write some code" texts. Here is the PDF version: http://compilers.iecc.com/crenshaw/tutorfinal.pdf
  • Then there are also the 4th and 5th chapters of Structure an Interpretation of Computer Programs (SICP), in which you'll build an interpreter and a kinda bytecode-compiler for a virtual register machine. It's a pretty abstract and seemingly alien affair (using a Lisp dialect to build a virtual register machine for a bytecode defined in Lisp, produced by a Lisp compiler, etc.), but it teaches the concepts behind the whole compiler and VM thing. You can find the full text here: https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start

Then I'd say diving into the source code is in order. I recommend starting with a small codebase. Here is a list of a few of my favorites:

More specific recommendations depend on what you want to do exactly: a compiler that outputs machine good, one that outputs C, one that outputs assembly and uses an assembler, or maybe even a JIT compiler?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment