Title
SugarJ: library-based syntactic language extensibility
Abstract
Existing approaches to extend a programming language with syntactic sugar often leave a bitter taste, because they cannot be used with the same ease as the main extension mechanism of the programming language - libraries. Sugar libraries are a novel approach for syntactically extending a programming language within the language. A sugar library is like an ordinary library, but can, in addition, export syntactic sugar for using the library. Sugar libraries maintain the composability and scoping properties of ordinary libraries and are hence particularly well-suited for embedding a multitude of domain-specific languages into a host language. They also inherit self-applicability from libraries, which means that sugar libraries can provide syntactic extensions for the definition of other sugar libraries. To demonstrate the expressiveness and applicability of sugar libraries, we have developed SugarJ, a language on top of Java, SDF and Stratego, which supports syntactic extensibility. SugarJ employs a novel incremental parsing technique, which allows changing the syntax within a source file. We demonstrate SugarJ by five language extensions, including embeddings of XML and closures in Java, all available as sugar libraries. We illustrate the utility of self-applicability by embedding XML Schema, a metalanguage to define XML languages.
Year
DOI
Venue
2011
10.1145/2048066.2048099
OOPSLA
Keywords
Field
DocType
library-based syntactic language extensibility,xml language,language extension,syntactic sugar,export syntactic sugar,programming language,syntactic extensibility,sugar library,ordinary library,domain-specific language,host language,xml schema,domain specific language
Programming language,Computer science,Data control language,Very high-level programming language,High-level programming language,Syntactic sugar,XML schema,First-generation programming language,Low-level programming language,Language primitive
Conference
Volume
Issue
ISSN
46
10
0362-1340
Citations 
PageRank 
References 
68
2.35
32
Authors
4
Name
Order
Citations
PageRank
Sebastian Erdweg146133.21
Tillmann Rendel239216.15
Christian Kästner33591135.92
Klaus Ostermann445723.97