Fortifying macros
Ryan Culpepper · Journal of Functional Programming · 2012
Abstract Existing macro systems force programmers to make a choice between clarity of specification and robustness. If they choose clarity, they must forgo validating significant parts of the specification and thus produce low-quality language extensions. If they choose robustness, they must write in a style that mingles the implementation with the specification and therefore obscures the latter. This paper introduces a new language for writing macros. With the new macro system, programmers naturally write robust language extensions using easy-to-understand specifications. The system translates these specifications into validators that detect misuses—including violations of context-sensitive constraints—and automatically synthesize appropriate feedback, eliminating the need for ad hoc validation code.
Cited by 14 works. doi:10.1017/s0956796812000275 Open-access PDF
Authors
References
- Correspondence between ALGOL 60 and Church's Lambda-notation
- Revised 6 Report on the Algorithmic Language Scheme
- Syntactic abstraction in scheme
- DrScheme: a programming environment for Scheme
- Disambiguation Filters for Scannerless Generalized LR Parsers
- Macro-by-example: Deriving syntactic transformations from their specifications
- Scheme with Classes, Mixins, and Traits
- Scribble
- Packrat parsing:
- A Theory of Hygienic Macros