Found in 6 comments on Hacker News
pjmlp · 2017-03-06 · Original thread
Are you aware of "Compiling with Continuations?

My three favorite books on compilers (in no particular order) are:

* Engineering a Compiler:

* Modern Compiler Implementation in ML:

* Compiling with Continuations:

kxyvr · 2016-06-07 · Original thread
Depending on how neurotic you want to get, Andrew Appel spent years working on SML and other functional programming language compilers and has written a few books about how to do it well. Namely, Compiling with Continuations:

and Modern Compiler Implementation in ML:

There's a certain kind of equivalence between continuations and SSA. Mostly, I bring that up because if you go down the rabbit hole of designing a compiler in C, you'll find talk of SSA, but continuations are somewhat advantageous for designing functional compilers. If you're just looking to design an interpreter, Ben Pierce's book Types and Programming Languages does a good job at showing how to put together a simple functional language both theoretically and practically:

kruhft · 2015-12-11 · Original thread
A (classic?) book on writing compilers with ML:

chollida1 · 2015-03-23 · Original thread
Would highly recommend this book, with the caveat of only if you are a common lisp user with a fair bit of experience using common lisp.

This book goes into some of the more advanced uses of macros and I don't believe most carries over to other "lisps".

I really loved the section on reader macros!! That's a topic that doesn't get enough attention from people coming to common lisp.

I don't believe clojure, for example, supports user defined reader macros, atleast I can't remember it having them the last time I used it(circa 2011).

EDIT, it looks like clojure does have reader macros now. Clojure just keeps getting better:)

In addition to Let over Lambda, my common lisp reading list includes:


I'd love to hear if anyone else has book recommendations in a similar vein. I'm in the middle of a month off to read books and research papers so this is pretty timely for me:)

larsberg · 2011-06-26 · Original thread
A lot has changed. If you're looking at other strongly-typed functional language, particularly if you don't have to handle laziness, Compiling with Continuations is a fantastic book ( ).

There is still a lot that has changed since then. In particular:

1) Control-flow analysis has become much more well-understood, and there's a lot more you can do in your optimization phases to dramatically speed up code and reduce allocations (allocations and heap accesses are the bane of functional language implementation, btw. Unless you're Haskell, and then you also have to deal with mutation for shared lazy computation results).

2) Certain tricks such as monomorphisation ( ) dramatically improve the ability of the compiler to generate optimized code from originally polymorphic inputs without paying huge representation overheads.

Unfortunately, #1 and #2 are mainly written up "in the source" of modern functional language compilers or at best in JFP (Journal of Functional Programming) articles :-( But the Appel book provides most of the fundamentals you'll need to get bootstrapped with anything more modern, so I'd recommend it anyway!

Fresh book recommendations delivered straight to your inbox every Thursday.