Skip to main content
eScholarship
Open Access Publications from the University of California

Hygienic Macros for JavaScript

  • Author(s): Disney, Timothy Charles
  • Advisor(s): Flanagan, Cormac
  • et al.
Abstract

Languages like Lisp, Scheme, and Racket have shown that powerful and expressive macro systems can give programmers the ability to grow their own language. Unfortunately, in languages with syntax like JavaScript, macros have had less success, due in part to the difficulty of integrating macro expansion and complex grammars.

This dissertation describes sweet.js, a hygienic macro system for JavaScript that fixes long standing challenges in lexing JavaScript and provides expressive pattern matching that allows macros to manipulate the complex grammar of JavaScript. With sweet.js programmers can experiment with syntax extensions for future versions of JavaScript and craft domain specific languages.

Main Content
Current View