Abstract |
Extensible
syntax systems can be powerful programming tools. They allow programmers
to create domain-specific languages, capture common patterns of code generation
and implement complex user languages in terms of simple kernel languages.
Unfortunately, traditional extensible syntax systems, like the C preprocessor,
suffer from severe usability problems. Previous work on hygienic macro systems
solved the usability problems associated with the use of identifiers by
syntax extensions. This work develops extensions to hygienic macro technology
that solve the problems associated with the static analysis of programs
that use syntax extensions. These extensions are used to build a macro system
for a Scheme-like language that statically analyzes programs using Hindley-Milner
type inference. This macro system makes it possible to report type errors
about macro uses in terms of original source code instead of macro-expanded
code. |