My talk at ILC2014 on a hygienic macro system for JavaScript

Thankfully our submission to the International Lisp conference 2014 has been accepted. The conference takes place at Montreal this August. We are excited to present our work on the following research.

Ken Wakita, Kanako Homizu, and Akira Sasaki
Hygienic Macro System for JavaScript and Its Light-weight Implementation Framework

In spite of its soundness, ease of use, and descriptive power, few hygienic macro systems have been incorporated to non-LISP programming languages.
The difficulty lies in the self-describing nature of the macro system. Proposed is the design and a systematic implementation framework of hygienic macro systems for general programming languages. In addition to the standard syntax-rules macro features, our macro system incorporates handling of punctuations and keywords, introduces invisible blocks of code called phantom groups, and proposes the notion of suffix pattern to address problems due to recursive macro definitions. These features have been introduced to deal with richer syntax of general programming languages. The proposed implementation framework incorporates staged parser architecture, a parser generation technique using parsing expression grammars, and mutual conversion technique between the macro-enabled host language and Scheme that allows our macro system delegate actual macro expansion task to a Scheme interpreter, instead of building hygienic macro expander from scratch. ExJS, our prototype implementation of a hygienic macro system for JavaScript, is implemented in less than 2,000 lines of JavaScript and Scheme, and exhibits its flexible syntactic extensibility.