Author:
FLATT MATTHEW,CULPEPPER RYAN,DARAIS DAVID,FINDLER ROBERT BRUCE
Abstract
AbstractRacket is a large language that is built mostly within itself. Unlike the usual approach taken by non-Lisp languages, the self-hosting of Racket is not a matter of bootstrapping one implementation through a previous implementation, but instead a matter of building a tower of languages and libraries via macros. The upper layers of the tower include a class system, a component system, pedagogic variants of Scheme, a statically typed dialect of Scheme, and more. The demands of this language-construction effort require a macro system that is substantially more expressive than previous macro systems. In particular, while conventional Scheme macro systems handle stand-alone syntactic forms adequately, they provide weak support for macros that share information or macros that use existing syntactic forms in new contexts. This paper describes and models features of the Racket macro system, including support for general compile-time bindings, sub-form expansion and analysis, and environment management. The presentation assumes a basic familiarity with Lisp-style macros, and it takes for granted the need for macros that respect lexical scope. The model, however, strips away the pattern and template system that is normally associated with Scheme macros, isolating a core that is simpler, can support pattern and template forms themselves as macros, and generalizes naturally to Racket's other extensions.
Publisher
Cambridge University Press (CUP)
Reference24 articles.
1. Herman D. (2010) A Theory of Typed Hygienic Macros. PhD dissertation, Northeastern University, Boston, Massachusetts.
Cited by
22 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Rhombus: A New Spin on Macros without All the Parentheses;Proceedings of the ACM on Programming Languages;2023-10-16
2. MacoCaml: Staging Composable and Compilable Macros;Proceedings of the ACM on Programming Languages;2023-08-30
3. Composable Sequence Macros for Fast Iteration;Proceedings of the 21st ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2022-11-29
4. Deep and shallow types for gradual languages;Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation;2022-06-09
5. A Survey of Metaprogramming Languages;ACM Computing Surveys;2020-11-30