4 pages tagged with "compilers"
Falsehoods programmers believe about undefined behavior
November 27, 2022 - 2421 words - 13 mins
Undefined behavior (UB) is a tricky concept in programming languages and compilers.
Over the many years I've been an industry mentor for MIT's 6.172 Performance Engineering course,
An excellent class that I highly recommend. It's very thorough and hands-on, at the expense of also requiring a lot of…
read more
Compiler Adventures, part 3: Value Numbering
May 17, 2022 - 3096 words - 16 mins
A beginner-friendly introduction to compilers: follow along as we build a compiler from scratch, or fork the code on GitHub and add your own optimizations too! In this episode: value numbering helps track how values are used in the program.
Last time on Compiler Adventures, we implemented constant p…
read more
Compiler Adventures, part 2: Constant Propagation
February 17, 2022 - 2392 words - 12 mins
A beginner-friendly introduction to compilers: follow along as we build a compiler from scratch, or fork the code on GitHub and add your own optimizations too! In this episode: propagating constant values to eliminate more instructions.
Last time on Compiler Adventures, we wrote an optimization that…
read more
Compiler Adventures, part 1: No-op Instructions
February 03, 2022 - 1955 words - 10 mins
A beginner-friendly introduction to compilers: follow along as we build a compiler from scratch, or fork the code on GitHub and add your own optimizations too! In this episode: eliminating no-op instructions.
What part of computer science feels most like arcane magic? I'd say compilers. "The magical…
read more