Scheme x86 Compiler - Debugging wrong call
((lambda (g x) (g x)) (lambda (x) (prim-apply + 1 x)) 2)
Problem: generated code contains two functions.
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.
Note: I'm not the original author. That's Steve Yegge. I copied the essay here from Google+ for safekeeping before Google+ shuts down.
Author: Steve Yegge
Publication Date: 10 Aug 2012
I've spent the past eight years (starting back in June 2004) writing elaborate rants about a bunch of vaguely related software engineering issues.