r/Compilers • u/vmcrash • Oct 11 '26
Papers for new compiler devs
What papers do you suggest for new compiler developers to read for different parts of a compiler?
My most important recommendation would be Linear Scan Register Allocation for the Java HotSpot™ Client Compiler, the master thesis of Christian Wimmer. It is very well written, easy to understand, and covers a lot of practical details.
45
Upvotes
10
u/chnoblouch Oct 11 '26
I'm not sure I'd go straight for papers to learn the basics, but Cornell University provides amazing resources that cover a wide range of topics (parsing, type checking, SSA-based optimization, instruction selection, register allocation, ...)
14
u/cxzuk Oct 11 '26
Hi VMCrash,
The knowledge pool is deep, and you can easily rabbit hole on one topic. Sometimes you want the theory side of things, sometimes the practical side of things.
While I believe there are some essential topics to know, ultimately everything in a compiler is based on the requirements of the work it has to do.
So I think I would encourage a new dev to consider reading the "A Survey of" or "landscape" papers - ones which give a broad stroke understanding of the options available such as:
Gabriel Blindell 2016 "Instruction Selection" - https://www.cs.tufts.edu/~nr/cs257/archive/gabriel-hjort-blindell/monograph.pdf
Cooper & Torczon 2023 "Engineering A Compiler: Chapter 12 - Instruction Scheduling" (cant link)
Jonathan Protzenko 2009 "A Survey Of Register Allocation Techniques" https://jonathan.protzenko.fr/papers/register09.pdf
Stanier & Watson 2013 "Intermediate Representations in Imperative Compilers" https://dl.acm.org/doi/epdf/10.1145/2480741.2480743
Keith Cooper 1998 "Compiler-Based Code-Improvement Techniques" https://www.cs.tufts.edu/~nr/cs257/archive/keith-cooper/survey.pdf
You might not be able to make a compiler after, but I think they can help give a better understanding of what's going on inside them, and to see some of the beauty of the domain subject.
M ✌
22
u/NXDLang Oct 11 '26 •
If your goal is to become a better compiler engineer rather than just collect papers, I'd recommend focusing on the papers that introduced ideas you're actually going to implement. A lot of new compiler developers jump straight into the latest PLDI papers and end up drowning in details. The classics are classics for a reason.
After reading those, start browsing papers from: • PLDI • POPL • CGO • CC (Compiler Construction) • OOPSLA But honestly, I'd rank implementing a compiler and reading LLVM/Rust/Go/Zig source code above reading most research papers. The papers teach the ideas. Real compiler code teaches how those ideas survive contact with reality.
4
u/EggplantExtra4946 Oct 11 '26
Alan C. Lawrence, 2007, Optimizing compilation with the Value State Dependence Graph https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-705.pdf
I only read the first 2 chapters but I found it illuminating, that the IR is that much a central piece of optimizing compilers. It made me understand what the fuss was all about concerning SSA.
2
u/splicer13 Oct 11 '26
Wimmer paper is good. We (mostly Carol Eidt) based the .NET JIT compiler on it.
Wegman and Zadek "Constant Propagation with Conditional Branches" I like and the descendant: Combining Analyses, Combining Optimizations
HOWEVER do not take that to mean I endorse sea of nodes representation. Everyone except for Cliff Click that I know regards SoN as a mistake both in Hotspot and Turbofan. And not just because Cliff Click makes himself very hard to like, which he does.
1
u/umlcat Oct 11 '26
Before you start, as a friendly disclaimer.
As it occurs with other software, there are several ways to built the same thing, so if you take a look at several compiler design sources, you may find that there are different, and may confuse you.
Take the one that suits you more.
Some questions that may affect the compiler design sources you choose:
Which is the programming language and programming framework you are used to work with ?
Which programming paradigm are you more used to, procedural, object oriented, functional ?
Are you already interested in some existing Compiler Design Framework, such as GCC, LLVM, ANTLR, Gold, or another ?
As an example, I will mention that I learned a lot of procedural pascal and object and class oriented pascal at college, and I also learned C and object and class oriented C++, at college.
My compiler related classes were using "Plain C" style, but there were already object and class oriented C++ techniques for programming design.
Speaking of Functional Programming, Python, neither Haskell did exist. There were some LISP compilers, but I didn't learned about it, until later.
I ended doing a small compiler design related project in procedural pascal in purpouse. It could done it object and class oriented, and in C or C++, but I choose procedural pascal as an alternative to commonly used "Plain C" compiler design techniques.
Sometimes, a Compiler Design student is used to work with a programming language, but needs to learn another one, used in some compiler design sources.
Good Luck, Good Work.
Note, this applies to interpreters and virtual machines, as well.