Re:TinyCompiler: A compiler in a week-end
by sieve on Thursday February 20, 2025 @09:54PM
(#43123469)
I got started from the books that were available here in the early 2000s. The one I like the most is "Programming Language Pragmatics" by Michael Scott, mainly for its simplicity. Then there is "Advanced Compiler Design and Implementation" by Steven Muchnick. I have Allen-Kennedy's book too, but I think it went over my head when I went through it. So I kept it aside.
"Engineering a Compiler" is quite approachable.
But, once you know the basics, you get the best bang-for-the-buck by looking at source code of various compilers and virtual machines.
Re:TinyCompiler: A compiler in a week-end
by sitkack on Friday February 21, 2025 @02:25AM
(#43124981)
There is a whole body of non-academic work aimed at practioners for implementing compilers.
Nils Holm's work https://t3x.org/
Teaching and Learning Compilers Incrementally - Jeremy Siek - RacketCon 2023 https://www.youtube.com/watch?v=43VA_QaTRT8
Nanopass https://nanopass.org/
original paper that was the basis for nanopass http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
https://www.reddit.com/r/ProgrammingLanguages/comments/gnzra...
The Crafting Interpreters and the Thorsten Ball books
https://craftinginterpreters.com/contents.html
Re:TinyCompiler: A compiler in a week-end
by ratmice on Friday February 21, 2025 @01:53PM
(#43131400)
I don't think that the ghuloum 2006 paper was the initial basis for nanopass,
at least the paper A Nanopass Framework for Compiler Education∗ seems to predate it in 2004
https://dl.acm.org/doi/10.1145/1016848.1016878
I'm curious what you'd recommend.
For what it's worth my goal was to compile to machine code. Anything less would have seemed insufficient. Later I got Appel's "Modern Compiler Implementation in Java" and Allen and Kennedy "Optimizing Compilers for Modern Architectures".
Cooper and Torczon "Engineering a Compiler" was recommended here recently. I haven't seen it.