2 ms·
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 boo
by kxyvr 10y ago
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/dp/052103311X http://www.amazon.com/Compiling-Continuations-Andrew-W-Appel...
and Modern Compiler Implementation in ML:
https://www.cs.princeton.edu/~appel/modern/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/ https://www.cis.upenn.edu/~bcpierce/tapl/