lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


"Matt Holmes" <kerion@bellatlantic.net> wrote:

> I really need a decent book on the parsing -> code generation ->
> VM part of it all, or at least some good resources on the net to
> read. Lua's style is fine, as is a register based VM setup. I am
> not out ot learn the way that EVERY language works, just why Lua
> works internally the way it does :) If there are any "Golden
> Books" of language creation (like The C++ Language is a "Golden
> Book" for any C++ programmer, because its kind of a de factor
> standard book to own), I would like to pick them up :)

I see you've been recommended most of the best books on this topic, but the
book I think is (possibly) best suited to answering your question is "High
Level Languages and their Compilers" by Des Watson.  While many people (inc.
me) would complain that the Dragon Book is authoritative but very opaque, I
think this book is the best written on the subject, simply because it is the
easiest to grasp and understand.  It's not as in-depth as the Dragon Book,
but it covers most of what you'll be interested in, in a straightforward and
down to earth way.

I encountered it because the author was the lecturer who taught my Compilers
course at University.

Now for the downside: it's out of print. However, Amazon have a few used
copies for sale:

http://www.amazon.com/exec/obidos/ASIN/0201184893

The first part of the book (3 fairly short chapters) is an overview of
high-level languages, their characteristics, the issues that affect compiler
construction, the features of various languages that need to be supported,
and a brief review of the history and family tree of programming languages.
This part may be of interest you to you, judging from your stated
motivations.

Don't let the gentle introduction fool you - it does cover grammars,
parsing, semantic analysis, code generation and optimisation too, so you
won't be missing out on anything with this book.

I've always been puzzled as to why this book was never more popular.  Of
course, there are a few other books which are much more approachable than
the Dragon Book, but others have already recommended them to you, with the
possible exception of the mini-classic "Brinch Hansen on Pascal Compilers"
(also out of print, sadly).  Whenever I need to look up something related to
compiler construction, I go to the Dragon Book.  Then after 10 minutes, I
think "What the hell are they talking about?" and pick up the Watson book,
which gives me explanation rather than merely documentation, if you see what
I mean.

Tim
--
Tim Browse                                         tim@tdv.com
                   "But my Mom says I'm cool!"
                     -- Milhouse Van Houten