4 ms·
A lot of people write Lisp interpreters, post it to HN and call it a day, but I think compilation is the far more interesting task for a Lisp implementation. S
by anothername12 2y ago
A lot of people write Lisp interpreters, post it to HN and call it a day, but I think compilation is the far more interesting task for a Lisp implementation.
SBCL is great to poke around in and the decompiler’s great. Also check out ABCL, ECL for what compilation to JVM bytecode and C looks like.
- mtreis86 2y agoThe scheme compiler in Paradigms of Artificial Intelligence Programming by Peter Norvig is a great introduction to compiling Lisp. I was particularly impressed by it only taking a change in one line to go from regular recursion to handling tail call optimization.
- fooker 2y agoThis is a bit Haskell oriented, but the "Implementation of Functional Programming Languages" by SPJ is one of my all time favorite books. https://simon.peytonjones.org/slpj-book-1987/ https://simon.peytonjones.org/slpj-book-1987/ These compilers were pulling heroic data structure optimization stunts in 1985, that no modern production compiler for major compiled languages can replicate in 2024.
- thewakalix 2y agoWhy? Is it mostly because of Haskell's purity (side-effect-freeness), so optimizations can change expressions more freely and safely?
- fooker 2y agoThat, and the uniform s-expr/gadt representation of data structures instead of going wild with clever pointers.
- nxobject 2y agoHuh – I didn't know he'd left MSR for Epic Games.
- nequo 2y agoHe did. He’s working on a new language called Verse now: https://dev.epicgames.com/documentation/en-us/uefn/verse-language-reference https://dev.epicgames.com/documentation/en-us/uefn/verse-lan...
- fooker 2y agoHuh interesting. The language seems sort of complicated for the domain (gameplay scripting).
- deleted 2y ago[deleted]