Home > lambdatheultimate > Macros that Work Together

Macros that Work Together

February 3rd, 2011 02:25 admin Leave a comment Go to comments

Macros that Work Together – Compile-Time Bindings, Partial Expansion, and Definition Contexts, Matthew Flatt, Ryan Culpepper, David Darais, and Robert Bruce Findler. Under consideration for publication in J. Functional Programming.

Racket (formerly PLT Scheme) 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 novel 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, that can support

pattern and template forms themselves as macros, and that generalizes naturally to Racket’s other


A good description of Racket’s rocket science tools for growing languages.

Source: Macros that Work Together

Related Articles:

  1. A Theory of Typed Hygienic Macros
  2. Fortifying Macros
  3. Keyword and Optional Arguments in PLT Scheme
  4. Racket Released
  5. Two Years of GNU Guile Scheme 2.0
blog comments powered by Disqus