Change search
ReferencesLink to record
Permanent link

Direct link
Scala-Virtualized: linguistic reuse for deep embeddings
EPFL, Switzerland.
EPFL, Switzerland.
EPFL, Switzerland.
EPFL, Switzerland.ORCID iD: 0000-0002-2659-5271
Show others and affiliations
2012 (English)In: Higher-Order and Symbolic Computation, ISSN 1388-3690, E-ISSN 1573-0557, Vol. 25, no 1, 165-207 p.Article in journal (Refereed) Published
Abstract [en]

Scala-Virtualized extends the Scala language to better support hosting embedded DSLs. Scala is an expressive language that provides a flexible syntax, type-level computation using implicits, and other features that facilitate the development of embedded DSLs. However, many of these features work well only for shallow embeddings, i.e. DSLs which are implemented as plain libraries. Shallow embeddings automatically profit from features of the host language through linguistic reuse: any DSL expression is just as a regular Scala expression. But in many cases, directly executing DSL programs within the host language is not enough and deep embeddings are needed, which reify DSL programs into a data structure representation that can be analyzed, optimized, or further translated. For deep embeddings, linguistic reuse is no longer automatic.

Scala-Virtualized defines many of the languageā€™s built-in constructs as method calls, which enables DSLs to redefine the built-in semantics using familiar language mechanisms like overloading and overriding. This in turn enables an easier progression from shallow to deep embeddings, as core language constructs such as conditionals or pattern matching can be redefined to build a reified representation of the operation itself.

While this facility brings shallow, syntactic, reuse to deep embeddings, we also present examples of what we call deep linguistic reuse: combining shallow and deep components in a single DSL in such a way that certain features are fully implemented in the shallow embedding part and do not need to be reified at the deep embedding level.

Place, publisher, year, edition, pages
2012. Vol. 25, no 1, 165-207 p.
National Category
Computer Science
URN: urn:nbn:se:kth:diva-165623DOI: 10.1007/s10990-013-9096-9OAI: diva2:808708

QC 20150504

Available from: 2015-04-29 Created: 2015-04-29 Last updated: 2015-05-04Bibliographically approved

Open Access in DiVA

No full text

Other links

Publisher's full text

Search in DiVA

By author/editor
Haller, Philipp
In the same journal
Higher-Order and Symbolic Computation
Computer Science

Search outside of DiVA

GoogleGoogle Scholar
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

Altmetric score

Total: 13 hits
ReferencesLink to record
Permanent link

Direct link