Latest Tweets:

Scheme 9 from Empty Space, A Guide to Implementing Scheme in C

A while back I offered to review Nils M Holm’s book Scheme 9 from Empty Space, A Guide to Implementing Scheme in C, available on Lulu as a paperback, PDF and HTML.

It took me way too long, but here it is:

Scheme 9 from Empty Space, A Guide to Implementing Scheme in C is a thorough guide of the internals of the scheme system with the same name. It provides a detailed account of every aspect of a non-trivial interpreter, from memory management, through the implementation of primitives, all the way up to the user-level forms and functions.

I was very delighted to see the discussions about practical matters in the implementation. One such discussion is the section about memory management, where a pointer reversal algorithm is laid out in beautiful detail. This is very refreshing since many other smaller scheme systems usually implement a naïve mark-and-sweep collector and call it a day without any further motivation.

The implementation is also very faithful to the lisp tradition of building things bottom-up, which is evident in the book by the fact that you get a good mental picture from the start, despite the rather mechanical walk through of the source. (Which certainly isn’t bad: this is a documentary after all, and not a cookbook.)

I’d say that this book is for the reader with some previous experience in writing compilers and/or interpreters. For the absolute beginner, the material may come across as dry and bewildering since it presents all concepts in the same order as they appear in the source. For the programming language buff, it is a interesting behind-the-scenes tour of a real-world scheme system.

All in all, it is a good read. Many scheme implementations have been written over the years, but very few have a thorough guide of such detail as this book.