(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.
(The bits labeled "interlude" are sort-of related articles in that the cover
issues with writing/developing compilers, or issues related to compilation,
but are not directly tied into the actual article series)
Step 1 - Creating a simple prolog / epilog for the main function
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