u/theindigamerin r/ProgrammingLanguages • Recommends
#racket#hygienicmacros#macroexpansion
"Let's Build a Hygienic Macro Expander" by Matthew Flatt
88K subscribers • 110 videos on Hallway • Conference channel
- Recommended by 3 people: 2 in engineering communities and 1 curated list.
- A classic. People kept recommending it from 2018 to 2023.
- Presented by Matthew Flatt
Advanced. Deep dive for people who know the field.
10K views10 years ago3 recommendations
Programming languagesComputer scienceLanguage design and type systemsCompilers and interpretersLisp and Clojure
Matthew Flatt explains the mechanics of hygienic macro expansion using a scope-sets model and walks through its implementation.
Although the idea of hygienic macro expansion appeals to many programmers, the details of hygienic expansion have scared away many language implementors. In fact, in the same way that lexical scope used to seem exotic and difficult to implement compared to dynamic scope---at least, until its implementation via closures became widely understood---the extra dimension of "macro scope" can seem mysterious. Historically, dynamic scope seemed obvious, because it involves a linear sequence of bindings, while lexical scope demands an implementation that matches the two-dimensional nature of nested expressions. Macro scope demands yet another dimension to binding. This talk aims to dispel the mystery of hygienic expansion: first, through a new explanation of macro scope based on "scopes sets"; and second, by walking through the implementation of a macro expansion using scope-sets.Why it's here
3 people recommend thisWhat people say. Recommended as an excellent resource for understanding and implementing hygienic macro systems in programming languages.
u/lyhokiayulain r/ProgrammingLanguages • Recommends
programming-talkscurated list on GitHubRecommends
Under “Programming Language Design”
u/lexi-lambdain r/haskell • Mentions
On ““Haskell's semantics, plus Lisp's macros. Meet Axel: a purely functional, extensible, and powerful programming language.””
u/davidchristiansenin r/ProgrammingLanguages • Mentions
On “Functional Programming in Lean - an in-progress book on using the Lean theorem prover to write programs”