
A Simple Scheme Compiler (1997) - azhenley
https://www.cs.utexas.edu/ftp/garbage/cs345/schintro-v14/schintro_142.html#SEC271
======
juliangamble
Ghuloum's scheme compiler tutorial essentially follows a useful process:
[http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf](http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf).
It starts with emitting x86 machine code for constants, then unary and binary
primitives, local variables, conditionals, heap allocation, procedure calls,
and finally closures. It helps that Scheme has little to no parser to speak
of, but it is straightforward to extend the technique to a language that does.

------
mcguire
The book this is from (follow the contents link) is dated 1997, which I find
very disappointing. I think it is part of Paul Wilson's garbage collection
archive. It was apparently intended to go from an introduction to Scheme all
the way to implementation details. Unfortunately, it was never finished.

~~~
vector_spaces
You might like "Lisp In Small Pieces", which starts from a simple Lisp-1
interpreter to a Lisp-2 to C transport.

~~~
ilammy
With a bytecode compiler, multiple implementation approaches, and a couple of
macrosystems dissected along the line. Though, LiSP is geared a bit more
towards Scheme semantics rather than pragmatics. _There are_ some details like
closures, and dynamic binding, and call/cc, but you won't find truly gnarly
details on garbage collection, value representation, threads, etc.
Nevertheless, it's still an amazing book which I would recommend reading!

~~~
agumonkey
Fair enough. I heard that John Anatomy of Lisp might have more details. Do you
know books talking about the topics you mentionned ?

~~~
register
I would like to know as well. I would also be interested in opinions about
"Lisp system implementation by Nils M Holm". I tried to read "Lisp in small
pieces" at least 3 times but never managed to go further than the 1st chapter.
I find the prose pedantic and often it doesn't go straight to the point that
is the objective of the chapter. Maybe this is an issue due to the translation
from French. In any case I find it a very heavy read. I have the feeling that
the contents of the book could be easily condensed in half the pages.

~~~
Jtsummers
I've also attempted it several times. If I were not so burnt out on
programming at the moment (WFH is not a vacation, and I desperately need one)
I'd probably have made it through this last time. Maybe, like all those SICP
study groups, someone should make a LiSP study group to help keep people
engaged and moving.

~~~
agumonkey
what part are you stuck on ?

~~~
Jtsummers
Actually, I was making good headway with this last attempt. I just burned out
on programming (generally), not specific to the text. And since I don't want
to program right now, there's no point in trying to progress through the book.
An earlier attempt failed entirely because of that ( _reading_ and not _doing_
), other times I stalled out because I just didn't understand it.

Generally I've found more advanced material requires a lot of "steeping" in my
mind before it clicks. I was literally in my 4th year of college before
Calculus finally actually clicked in my brain, this book seems to have the
same issue. My first couple times I just didn't understand what I was reading,
and I put it down (for many years actually, time flies). When I picked it up
this time I honestly don't know what my issue was with comprehending it
before. In the intervening years I did a much deeper dive into using Common
Lisp as my hobby language, and I think that's helped a lot. What I'm reading
connects better with the practice I've had in using a Lisp. Similar to
calculus, I had spent a couple years applying it (not just studying it) and
when I went back and reexamined some basic materials everything just fell into
place in my mind.

~~~
agumonkey
Same here. Time did half the work. Revisiting the book every year or so made
me click.

