DConf '24 | The Black Art of Code Generation | Walter Bright (Day 1 Keynote)

Опубликовано: 16 Июнь 2026
на канале: The D Language Foundation
1,409
54

There are plenty of compiler books out there covering parsing and lexing, but information on code generation is hard to find. In this talk, Walter does a deep dive into the code generator in the DMD compiler's back end, a project he has maintained and evolved since he created it for his first C compiler in the early 80s.

The PDF slides are available here:
https://dconf.org/2024/slides/bright.pdf

DConf '24 Homepage
https://dconf.org/2024/index.html

The D Programming Language Home
https://dlang.org/

DConf '24 was hosted by Symmetry Investments.
https://symmetryinvestments.com/

DConf '24 was sponsored by Weka.
https://www.weka.io/

#dlang #dconf #programming

TIMECODES
00:00 Title & Introduction
03:18 Data structures intro
03:50 Expression tree
06:45 Block structure
09:17 Code structure
11:20 Local optimizations
12:22 Common subexpressions
13:37 Q: How are common subexpressions identified?
14:37 Q: What is the algorithmic complexity?
15:13 Comment on using Grok for information
16:14 Register masks
18:35 Effective address
20:00 Code generator algorithm details 1
23:00 Q: Did Walter come up with the algorithm himself?
23:21 Q about register allocation in relation to optimization
24:23 Code generator algorithm details 2
29:32 Example code gen function
32:18 Finishing up
32:54 Inherent limitations
33:31 Final thoughts
34:01 Comment about SSA (Static Single Assignment)
34:36 Q about code generator documentation
36:33 Q: DMD's new back-end inliner enabled?
37:07 Q: When will Walter publish a code gen book?
37:43 Q about linkers
39:16 Q: What would Walter do differently if he wrote the generator today?
40:49 Q and discussion about JIT