Compiler Construction by N. Wirth

by Bijan Parsia

I just noticed that Nikolas Wirth has put his classic little book, Compiler Construction, online. It’s a slim book chock full of nutty crunchy compliery goodness. I find it extremely lucidly written with spare, elegant prose. And he can turn a phrase:

To keep both the resulting compiler reasonably simple and the development clear of details that are of relevance only for a specific machine and its idiosyncrasies, we postulate an architecture according to our own choice. Thereby we gain the considerable advantage that it can be tailored to the needs of the source language. This architecture does not exist as a real machine; it is therefore virtual. But since every computer executes instructions according to a fixed algorithm, it can easily be specified by a program. A real computer may then be used to execute this program which interprets the generated code. The program is called an interpreter, and it emulates the virtual machine, which therefore can be said to have a semi-real existence.

Or this cranky bit:

Ultimately, the basic idea behind every language is that it should serve as a means for communication. This means that partners must use and understand the same language. Promoting the ease by which a language can be modified and extended may therefore be rather counterproductive. Nevertheless, it has become customary to build compilers using table-driven parsers, and to derive these tables from the syntax automatically with the help of tools. The semantics are expressed by procedures whose calls are also integrated automatically into the parser. Compilers thereby not only become bulkier and less efficient than is warranted, but also much less transparent. The latter property remains one of our principal concerns, and therefore we shall not pursue this course any further.

Finally, there is this lovely digression:

One wonders why an exact definition of the sentences belonging to a language should be of any great importance. In fact, it is not really. However, it is important to know whether or not a sentence is well formed. But even here one may ask for a justification. Ultimately, the structure of a (well formed) sentence is relevant, because it is instrumental in establishing the sentence’s meaning. Owing to the syntactic structure, the individual parts of the sentence and their meaning can be recognized independently, and together they yield the meaning of the whole.

Am I the only one who got shivers? Yes?

I’m such a geek. Anyone have any (Tofu) chicken heads to gnaw?

Ooo, there’s a nice recent article by Writh with plenty of crankiness: Good Ideas, Through the Looking Glass. Here he is on software “wizards”:

Although it would be unwise to launch a crusade against wonderful wizards, this author’s experiences with wizards were largely unfortunate. He found it impossible to avoid confronting them in text editors. Worst are those wizards that constantly interfere with one’s writing, automatically indenting and numbering lines when not desired, capitalizing certain letters and words at specific places, combining sequences of characters into some special symbol…automatically converting a sequence of minus signs into a solid line, etc. If at least they could easily be deactivated, but typically they are obstinate and immortal like devils. So much for clever software for dummies: a bad idea!

There’s a lot in that article that is merely cranky (e.g., the functional programming rant is rather weak, IMHO), but it’s still a fun read and there’s some interesting insight. The essay ends with a sentiment I share:

We believe that we can learn not only from bad ideas and past mistakes, but even more from good ideas, analysing them from the distance of time. This collection of topics may appear as accidental, and it is certainly incomplete. Also, it is written from an individual’s perspective, with the feeling that Computing Science would benefit from more frequent analysis, critique, particularly self-critique. After all, thorough self-critique is the hallmark of any subject claiming to be a science.
Spread the word:
  • Reddit
  • Digg
  • del.icio.us
  • TwitThis
  • Technorati

Leave a Reply