3 ms·
How does this relate to https://www.microsoft.com/en-us/research/publication/the-implementation-of-functional-programming-languages/ https://www.microsoft.com/e
by js8 8y ago
How does this relate to https://www.microsoft.com/en-us/research/publication/the-implementation-of-functional-programming-languages/ https://www.microsoft.com/en-us/research/publication/the-imp... or https://www.microsoft.com/en-us/research/publication/implementing-functional-languages-a-tutorial/ https://www.microsoft.com/en-us/research/publication/impleme... ?
- nils-m-holm 8y agoThe book by Peyton Jones et al is certainly broader, covering denotational semantics, pattern matching, polymorphism, list comprehension, type-checking, laziness, garbage collection, etc. It has also quite a few chapters on Miranda, Wadler's (one of the co-authors) favorite language. Compiling Lambda Calculus (CLC) concentrates on one thing: compiling untyped lambda calculus (or its incarnation, Scheme) to abstract machine code and then to C. It goes more into the depths of lambda calculus and has more examples (like Church numerals, etc). It also contains the complete source code to all compilers described in the text. I would argue that CLC would be the better choice for a beginner.
- YorkshireSeason 8y agoThe SPJ book is from 1987, so more than 3 decades old. There has been quite a bit of progress in compilers since. While I'm not up to scratch on the latest version of the GHC compiler, it's quite a bit different. I recommend looking at Peyton Jones and Marlow's overview article [1]. The Scala compiler(s) are also interesting. I'm not aware of an overview article, but I found last year's [2] worth reading. A big breakthrough in the compilation of functional languages was Xavier Leroy's on (O)Caml. I am not aware of any recent descriptions, but maybe [3, 4] are better than nothing. Note that languages like Javascript have full functional sublanguages, so all recent progress in JIT compilation for Javascript could/should be considered here too. Historically, the main issue in the compilation of FP languages has been laziness. In a statically-scoped call-by-value language, compilation is not that different from compilation of 'normal' languages. [1] S. Marlow, S. Peyton-Jones, The Glasgow Haskell Compiler. http://www.aosabook.org/en/ghc.html http://www.aosabook.org/en/ghc.html [2] D. Petrashko, O. Lhotak, M. Odersky, Miniphases: Compilation using Modular and Efficient Tree Transformations. https://infoscience.epfl.ch/record/228518/files/paper.pdf https://infoscience.epfl.ch/record/228518/files/paper.pdf [3] X. Leroy, Functional programming languages Part II: abstract machines. [4] X. Leroy, The ZINC experiment: an economical implementation of the ML language.