Tradeoffs in Metaprogramming
Todd L. Veldhuizen

TL;DR
This paper explores the inherent tradeoffs in metaprogramming language design, analyzing the decidability of safety properties and the implications of language restrictions using computability theory.
Contribution
It provides a formal analysis of tradeoffs in metaprogramming languages, establishing conditions for capturing safety properties and demonstrating the complexity of translating between languages.
Findings
Safety properties are generally undecidable, e.g., halting and type correctness.
Restricted languages can sometimes capture safety properties, but not all.
Translating metaprograms between languages relates directly to the properties being verified.
Abstract
The design of metaprogramming languages requires appreciation of the tradeoffs that exist between important language characteristics such as safety properties, expressive power, and succinctness. Unfortunately, such tradeoffs are little understood, a situation we try to correct by embarking on a study of metaprogramming language tradeoffs using tools from computability theory. Safety properties of metaprograms are in general undecidable; for example, the property that a metaprogram always halts and produces a type-correct instance is -complete. Although such safety properties are undecidable, they may sometimes be captured by a restricted language, a notion we adapt from complexity theory. We give some sufficient conditions and negative results on when languages capturing properties can exist: there can be no languages capturing total correctness for metaprograms, and no…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · Software Engineering Research
