Scheme from Scratch project

I hope it is not considered bad form to mention a series of articles I've been writing recently. I think some LtU readers may find them interesting. I wish I'd found such a link here on LtU.

I'm recording the construction of a Scheme interpreter implemented in C. It is a node-walking interpreter modeled on the first meta-circular interpreter in SICP. The idea of the series is to help readers over the hump of thinking that writing an interpreter in C is an insurmountable task.

Introduction

Bootstrap Scheme v0.1 integers

It has been great to see some readers inspired enough to write their own interpreters with different approaches.

Peter

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

FScheme

I've been following your articles; very interesting!

Funny enough, I had the same "itch" this New Year and started a similar series in F#:

FScheme - Scheme interpreter in F# (following Bill Hails' book)

Coincidentally just got to implementing lambda (:

a bytecode interpreting VM is next

In case anyone here is interested, we've almost started the next implementation in the Scheme from Scratch series. Royal Scheme will be a bytecode interpreting virtual machine. If you've wanted to implement such a beast yourself and you want to join everyone else who is along for the ride, the more the merrier.

Take a look at...

Sarkar, Wadell and and Dybvig's A Nanopass Framework for Compiler Education is very helpful if you want to design your compiler and VM in an iterative way.

Dissertation online

The dissertation of Sarkar's Nanopass framework is available free as a PDF from Proquest. Search for Dipanwita Sarkar at http://disexpress.umi.com/ (It's one of their "open dissertations".)

Sorry there's not a direct link to the PDF...

Goal Reminds me of XLisp, XScheme, Bob, etc.

I remember reading the sources to XLisp and Bob (an algol syntax OO variant interpreter, with a byte code compiler, IIRC(?)) roughly 20 years ago.

What made these implementations very valuable reads at the time? 1) A highly portable system, nearly ZERO system specific cruft or every damn source term wrapped in some macro. 2) *Very* readable, generic C source code - stuff looked liked examples from K&R :-) 3) simply organized code, as in ~10 files in one directory - no wading through directories and make files.

In sum, I read through my first sources of a simple mark/sweep gc memory system late at night while on vacation in Paris from hard copy printouts of the source in my luggage. Read pretty much like a book - not even search/grep required to navigate the entire system.

If your goals are pedagogical, it might be useful to consider these ease-of-reading system level, not application or design level, quality criteria.