Writing a compiler in Ruby, bottom up

(To follow my compiler related posts, either subscribe to my main RSS feed, or the compiler specific one )

Back in March 2008 I started publishing a series on how to write a compiler in Ruby, bottom up, that is, starting with the code generator and working my way up instead of the more traditional approach of writing the parser first. Here are the parts I've published on my blog so far:

All the code can now be found in this GitHub repository


Someone commenting on this series on Hackernews pointed to Nicklaus Wirth's excellent book on compiler construction (PDF available on his homepage) as a good starting point from a traditional, top down point of view. It's a good and very approachable book, and well worth a read.

Another great series with a more traditional approach is a famous series by Jack Crenshaw: Let's build a compiler

This page at Stackoverflow has a great list of other compiler writing resources.

blog comments powered by Disqus