How to Write a Compiler

How to Write a Compiler

Back in my high school days, I found that I liked knowing the hoary details of low level computer operations: assembly language, instruction decoding, firmware and register manipulation.

One regret I’ve had, though, is not ever taking a Compilers course. That is, how to write a compiler for a language like C or C++. Unlike some of the fruitier “Learn to code in Pascal, LANGUAGE OF THE FUTURE” courses, writing a compiler is a marriage between expression of code in a high level language and implementation in nice spurts of machine code. While I have no great desire to write compilers for a living, I do wish I knew more about how they work. So I was bopping around the web today and came across Inger, an open-source compiler with an e-book. Cool. And also Open C++, an open-source C++ compiler project. The Internet rocks.


  1. Bo Jordan 15 years ago

    Same thing for me… I recently wished I knew more about how they work, and I came across the dragon book.  Apparently this is one of the better-known books on the subject, and isn’t cheap, but from the tiny bit I’ve seen it is definitely worth a few cups of coffee and a few hours at your local strip-mall bookseller.

  2. Dave 15 years ago

    Cool…thanks for the link! I’ll have to see if I can find it used.