Fully-parameterized, first-class modules with hygienic macros

Fully-parameterized, first-class modules with hygienic macros, dissertation by Martin Gasbichler, 2006.

It is possible to define a formal semantics for configuration, elaboration, linking, and evaluation of fully-parameterized first-class modules with hygienic macros, independent compilation, and code sharing. This dissertation defines such a semantics making use of explicit substitution to formalize hygienic expansion and linking. In the module system, interfaces define the static semantics of modules and include the definitions of exported macros. This enables full parameterization and independent compilation of modules even in the presence of macros. Thus modules are truly exchangeable components of the program. The basis for the module system is an operational semantics for hygienic macro expansion - computational macros as well as rewriting-based macros. The macro semantics provides deep insight into the nature of hygienic macro expansion through the use of explicit substitutions instead of conventional renaming techniques. The semantics also includes the formal description of Macro Scheme, the meta-language used for evaluating computational macros.

A very readable, interesting, and useful work.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

First-class macros

This thesis cites Bawden's First-class macros have types paper as prior work, as I mentioned in the First-class macros story. There's the general point that in the scheme world, modules need to handle macros, and they are the sort of thing that one thinks ought to be definable using macros, so the two things need to be figured out together.

We're all waiting for the definitive truth on hygiene from Dave Herman.

Re: First-class macros

they are the sort of thing that one thinks ought to be definable using macros

Not necessarily. For example, PLT Scheme's second-class modules cannot be macro-defined, though their first-class modules can (and are).

We're all waiting for the definitive truth on hygiene from Dave

No pressure or anything, right? :) Seriously, I'm working on a new paper (and the dissertation), so hang tight just a little longer. (As for "definitive truth," I think the salient phrase would be "above my pay grade.")