Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!solaris.cc.vt.edu!uunet!sytex!smcl
From: smcl@sytex.com (Scott McLoughlin)
Subject: Re: Implementing Scheme
Message-ID: <61FHTc2w165w@sytex.com>
Sender: bbs@sytex.com
Organization: Sytex Access Ltd.
References: <36hhhq$png@eccdb1.pms.ford.com>
Date: Fri, 30 Sep 1994 20:27:52 GMT
Lines: 86

poorman@cc4032.pms.ford.com (Glenn M. Poorman) writes:

> 
> a. Any written material someone can mail me.
> b. Ftp sights with some papers.
> c. One local bookstore said they could try to dig up some of the books
>    so (of the books listed in the FAQ), are there any outstanding ones
>    I should go for?  I was looking at:
>    1. "Anatomy of Lisp" by John Allen
>    2. "Programming Languages, An Interpreter Based Approach" by Samuel Kamin
>    3. "Lisp: A Portable Implementation" by Sharam Hekmatpour
> 

Howdy,
        I've hear (1) is good but out of print. I found (2) to be
a lovely book - but don't use it thinking you'll "extend" one of
the examples - they're toys.  I peeked once at (3). Don't want
to slam a book I haven't read but I remember being unimpressed.
For a nice book on Scheme and interpreters take a look at
"Essentials of Programming Languages" (Friedman, Wand, Haynes).
For lot's of nice implementation overview see "Performance and
Evaluation of Lisp Systems" (Gabriel)  See the chapters on
Lisp interpretation/compilation in both "Structure and Interpretation
of Computer Programs" (Abelson,Sussman) and "Paradigms of 
Artificial Intelligence Programming" (Norvig).
        Warning: some of these are rough going. I found the last
reference to be particularly lucid in presentation.  Haven't 
really found "the book I'd want to read on building a Lisp".
Maybe someday I'll write it (a man can dream...).
        OK. There are some _ESSENTIALS_ available via FTP.

(1) Paul Wilson's "Uniprocessor Garbage Collection Techniques"
available on cs.utexas.edu /pub/garbage/wilson..(?)
(2) David Gudeman's "Representing Type Information in Dynamically
Typed Languages" available at cs.arizona.edu I think in
/pub/reports with a name that begins TR93-27 ? That's the tech
report num - you'll find it.

        Read and digest these before writing a single line
of code.

        Henry Baker (a true dude) has recently made a number of
his papers available on ftp.netcom.com pub/hbaker. There's a 
README which is a sort of bibliography.  Many of these are
_very_ _good_.  Read his "CONS Should not CONS it Arguments..."
Take a look at the ISO critique to see a nice exposition on
how a good Lisp might be designed/built.  Read all the rest
and you won't be wasting your time.

        Here are the issues that you probably will visit and
revisit.
        (1) Tagging
        (2) Allocation/GC
        (3) call/cc
        (4) Making tail recursive loops "go fast"

Here's a suggested approach: Write a _minimal_ set of 
primitives:  constructors, type predicates, accessors,
setters, integer arithmetic, if, lambda, call/cc,
function call.  Get a Scheme macro system going (not
my forte - pointers anyone?)  Now write the rest of the
thing in Scheme (this will go pretty fast).  You now have
a minimal runtime to start testing, profiling, etc.
At this point, changes won't be deadly (as they can be
with a large runtime in C or asm or whatever). You'll
hit a bunch of issues along the way - trust me!

Anyway, by this time you won't need general advice ;-)
Oh yeah - stick to the standards like glue. You won't
regret it.  If you want extensions (object system,
records, lambda-case, ffi) make the thing a perfect
superset (full call/cc in an extension langauge may
be a problem depending on your platform - you'll be
forgiven ;-)  Read/reread the standards docs - the
different pieces of a language spec often "hang
together" in unexpected ways. thankfully the 
scheme standard is small.

Have fun! Keep us informed of your progress/problems.
Email if you have more specific questions relating
to your project.

=============================================
Scott McLoughlin
Conscious Computing
=============================================
