Found in 1 comment on Hacker News
rayiner · 2014-08-07 · Original thread
Morgan's "Building an Optimizing Compiler" recommends doing a "spike" method: http://www.amazon.com/Building-Optimizing-Compiler-Bob-Morga.... The idea is that you should write enough of each stage, from the front-end to the back-end, to get one feature working. Then do the same for the next feature, and so on. That way, you have very early insight into how the stages fit together.

Ghuloum's scheme compiler tutorial essentially follows this method: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf. It starts with emitting x86 machine code for constants, then unary and binary primitives, local variables, conditionals, heap allocation, procedure calls, and finally closures. It helps that Scheme has little to no parser to speak of, but it is straightforward to extend the technique to a language that does.

Fresh book recommendations delivered straight to your inbox every Thursday.