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

https://www.amazon.com/Compiling-Continuations-Andrew-W-Appe...

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

* Engineering a Compiler: https://www.amazon.com/Engineering-Compiler-Second-Keith-Coo...

* Modern Compiler Implementation in ML: https://www.cs.princeton.edu/~appel/modern/ml/

* Compiling with Continuations: https://www.amazon.com/Compiling-Continuations-Andrew-W-Appe...

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:

http://www.amazon.com/Compiling-Continuations-Andrew-W-Appel...

and Modern Compiler Implementation in ML:

https://www.cs.princeton.edu/~appel/modern/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:

https://www.cis.upenn.edu/~bcpierce/tapl/

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

http://www.amazon.com/Compiling-Continuations-Andrew-W-Appel...

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:)

http://en.wikibooks.org/wiki/Learning_Clojure/Reader_Macros

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

http://www.amazon.ca/Lisp-Small-Pieces-Christian-Queinnec-eb...

http://www.amazon.ca/Compiling-Continuations-Andrew-W-Appel-...

and http://www.amazon.ca/Paradigms-Artificial-Intelligence-Progr...

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 (http://www.amazon.com/Compiling-Continuations-Andrew-W-Appel... ).

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 (http://mlton.org/Monomorphise ) 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.