Abstract: “The article describes an implementation scheme of a hygienic syntactic macro system for JavaScript. Instead of implementing the complex logic of a hygienic macro system from scratch, the proposed method heavily relies on an existing Scheme implementation of its hygienic syntactic macro system. A program written in our macro-enhanced version of JavaScript is first translated into a Scheme program. It is then macro-expanded by a macro expander of Scheme into a macro-free Scheme code. Finally, it is translated back to Javascript, which at this point is free of macros. To deal with the macro-enhanced syntax, an extensible parser architecture based on top-down operator precedence is proposed. A prototype hygienic macro system, including both the parser and the two-way translator, is implemented by only 2,000 lines of Scheme code.”
Are they not aware of sweet.js?
My understanding is that Sweet.js postdates this work.
I wasn’t cuz I don’t do JS. I don’t know about them. Thanks for the tip, though!
Aside from Javascript macros, I found this interesting since it was really similar to one of my ideas for integrating Scheme macros with C. For me, the idea was more of a work-saving hack that might help in verification down the line.