# Graydon Hoare: 21 compilers and 3 orders of magnitude in 60 minutes

DevFeed: [Graydon Hoare: 21 compilers and 3 orders of magnitude in 60 minutes](<https://devfeed.tech/articles/graydon-hoare-21-compilers-and-3-orders-of-magnitude-in-60-minutes-29487.md>)

Original publisher: [Read original article](<http://lambda-the-ultimate.org/node/5648>)

Published: 2022-02-27T14:47:26Z

Content type: opinion

Language: en

Sources: [Lambda the Ultimate](<https://devfeed.tech/sources/lambda-the-ultimate.md>)

Topics: [Compiler](<https://devfeed.tech/topics/compiler.md>), [Code](<https://devfeed.tech/topics/code.md>), [Lisp](<https://devfeed.tech/topics/lisp.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [lisp](<https://devfeed.tech/tags/lisp.md>), [ml](<https://devfeed.tech/tags/ml.md>), [pdf](<https://devfeed.tech/tags/pdf.md>), [presentation](<https://devfeed.tech/tags/presentation.md>), [talk](<https://devfeed.tech/tags/talk.md>), [theory](<https://devfeed.tech/tags/theory.md>)

## AI overview

The article discusses Graydon Hoare's 2019 undergraduate talk about compiler design, summarizing different approaches ranging from large traditional compilers to variants using selective optimization, compiler-friendly languages, theory-driven tools, intermediate representations, interpretation, partial evaluation, or hand-written implementations.

## Source excerpt

In 2019, Graydon Hoare gave a talk to undergraduates (PDF of slides) trying to communicate a sense of what compilers looked like from the perspective of people who did it for a living. I've been aware of this talk for over a year and meant to submit a story here, but was overcome by the sheer number of excellent observations. I'll just summarise the groups he uses: The giants: by which he means the big compilers that are built the old-fashioned way that throw massive resources at attaining efficiency The variants, which use tricks to avoid being so massive: Fewer optimisations: be traditional, but be selective and only the optimisations that really pay off Use compiler-friendly languages, by which he is really taking about languages that are good for implementing compilers, like Lisp and ML Theory-driven meta-languages, esp. how something like yacc allows a traditional Dragon-book style compiler to be written more easily Base compiler on a carefully designed IR that is either easy to compile or reasonable to bytecode-interpret Exercise discretion to have the object code be a mix of compiled and interpreted Use sophisticated partial evaluation Forget tradition and implement everything directly by hand I really recommend spending time working through these slides. While much of the material I was familiar with, enough was new, and I really appreciated the well-made points, shout-outs to projects that deserve more visibility, such as Nanopass compilers and CakeML, and the presentation of the Futamura projections, a famously tricky concept, at the undergraduate level.