
Implementing functional languages: a tutorial (1992) - rspivak
http://research.microsoft.com/en-us/um/people/simonpj/papers/pj-lester-book/
======
ced
This seems to be a shorter version of the same author's book from 1987, also
available online

[http://research.microsoft.com/en-
us/um/people/simonpj/papers...](http://research.microsoft.com/en-
us/um/people/simonpj/papers/slpj-book-1987/)

I haven't read the tutorial, but the book is strongly recommended.

~~~
dang
They explain it like this:

 _An earlier book by one of us, [Peyton Jones 1987], covers similar material
to this one, but in a less practically oriented style. Our intention is that a
student should be able to follow a course on functional-language
implementations using the present book alone, without reference to the other.
The scope of this book is somewhat more modest, corresponding to Parts 2 and 3
of [Peyton Jones 1987]. Part 1 of the latter, which discusses how a high-level
functional language can be translated into a core language, is not covered
here at all._

------
DenisM
Nothing is said in the abstract about type system. Anyone knows if the subject
is covered?

Also, the book is from 1992, which should be added to the title.

~~~
dang
_We focus exclusively in this book on the ‘back end’ of functional-language
compilers. We make no attempt to discuss how to translate programs written in
a fully fledged functional language [...] or how to type-check such programs._

(Added the year. Thanks.)

~~~
nickpsecurity
I imagine this would still be useful if compilers like Haskell can produce
intermediate code for what's described in the book. Not sure if they do but I
have an academic paper that created a G-machine to Forth (CPU) compiler for
embedded Haskell. Made me think there was a G-machine output option.

Point being, plenty one can contribute to FP in terms of safety, performance,
integration, and so on just knowing backends. Esp if more people do FP CPU's.

~~~
tel
There's a "Core" output option which is not far from STG if I remember right.

~~~
nickpsecurity
Here it is:

[https://downloads.haskell.org/~ghc/7.6.2/docs/html/users_gui...](https://downloads.haskell.org/~ghc/7.6.2/docs/html/users_guide/ext-
core.html)

The next page references dllthomas's command. Here's the language it outputs:

[https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Co...](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType)

So, the trick to answer our question is if any knowledgeable readers can tell
us whether what's in this guide helps on the path to understanding that
language. If so, then it's a start to working with and improving it.

------
Apanatshka
I've been meaning to read more of this book. The first chapters are great. Now
of only I had time...

------
alkonaut
I realize this was before excellent broadband and before the smartphone, but
why gzip a pdf :(

