Scheme Implementation Learning Materials

This is an email from Racket-devel mailing by Jens Axel Søgaard to answer Austin T’s question with email subject “Looking for explanation on Racket’s C code & core systems implementation (hello from Shaka Scheme)”.  I found this is very useful, so copy it here.  Thanks Jens!

> I would like to know:
> – What should I read?

Since Scheme is an old language the literature on Scheme compilers is surprisingly rich.

Some of the classics (can’t recommend these enough):
“Lisp in Small Pieces” by Christian Queinnec
This book is a delight to read – and even includes a chapter on compiling to C.

“Three Implementation Models for Scheme” by R. Kent Dybvig
Dybvig’s thesis. Very clear explanations. Explains how to implement  using a stack of frames (like C).

> – Expressing Scheme types in C data structures

Take a look at how Larceny represents Scheme values. The approach is fairly typical.
http://www.larcenists.org/Documentation/Documentation0.97/LarcenyNotes/note2-repr.html

> Garbage collection vs. reference counting

Reference counting has problems with cyclic data that becomes dead.  A simple stop-copy garbage collector would be a good place to start.

“Programming Languages: Application and Interpretation” (PLAI) by Shriram Krishnamurthi has a chapter on memory management:
http://cs.brown.edu/courses/cs173/2012/book/Memory_Management.html
(There is a nice language for implementation garbage collectors available.  See http://blog.brownplt.org/2013/02/19/teaching-gc.html .  I can’t find the linked exercises – have they moved?)

> Parsing input from characters & type of algorithm used

The Scheme Compiler Workshop has a section on writing a scanner and parser:
http://www.cs.indiana.edu/eip/compile/scanparse.html


Jens Axel Søgaard

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s