Results 1 -
3 of
3
SugarJ: Librarybased syntactic language extensibility
- In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA). ACM
, 2011
"... 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 l ..."
Abstract
-
Cited by 3 (1 self)
- Add to MetaCart
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 selfapplicability by embedding XML Schema, a metalanguage to define XML languages.
Extending scala with database query capability
"... The integration of database and programming languages is difficult due to the different data models and type systems prevalent in each field. We present a solution where the developer may express queries encompassing program and database data. The notation used for queries is based on comprehensions ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
The integration of database and programming languages is difficult due to the different data models and type systems prevalent in each field. We present a solution where the developer may express queries encompassing program and database data. The notation used for queries is based on comprehensions, a declarative style that does not impose any specific execution strategy. In our approach, the type safety of language-integrated queries is analyzed at compile-time, followed by a translation that optimizes for database evaluation. We show the translation total and semantics preserving, and introduce a language-independent classification. According to this classification, our approach compares favorably with Microsoft’s LINQ, today’s best known representative. We provide an implementation in terms of Scala compiler plugins, accepting two notations for queries: LINQ and the native Scala syntax for comprehensions. The prototype relies on Ferry, a query language that already supports comprehensions yet targets SQL:1999. The reported techniques pave the way for further progress in bridging the programming and the database worlds. 1
Growing a Language in Pattern Calculus
"... Pattern calculus treats all computation as pattern matching, which is, in turn, central to the implementation of programming languages. Hence, its realisation in the general-purpose language bondi provides a natural host in which to develop domain-specific languages (DSLs). bondi is a strongly typed ..."
Abstract
- Add to MetaCart
Pattern calculus treats all computation as pattern matching, which is, in turn, central to the implementation of programming languages. Hence, its realisation in the general-purpose language bondi provides a natural host in which to develop domain-specific languages (DSLs). bondi is a strongly typed language that supports mixing of all the programming styles required for language implementation, including imperative programming (for handling input streams), functional programming (for transforming abstract syntax trees), generic queries (for performing traversals) and object-orientation (for growing DSLs). The approach is illustrated by growing a small combinatory language in which each language feature, i.e. each production of each grammar, is isolated within a single object-oriented class that captures the rules for parsing, type inference, evaluation and printing. Further, growth is used to support lambda-abstraction and pattern matching, providing good evidence that this combinatory language could grow to support all of bondi. 1

