2019
DOI: 10.22152/programming-journal.org/2019/3/10
|View full text |Cite
|
Sign up to set email alerts
|

Shallow EDSLs and Object-Oriented Programming: Beyond Simple Compositionality

Abstract: Context. Embedded Domain-Specific Languages (EDSLs) are a common and widely used approach to DSLs in various languages, including Haskell and Scala. There are two main implementation techniques for EDSLs: shallow embeddings and deep embeddings.Inquiry. Shallow embeddings are quite simple, but they have been criticized in the past for being quite limited in terms of modularity and reuse. In particular, it is often argued that supporting multiple DSL interpretations in shallow embeddings is difficult.Approach. T… Show more

Help me understand this report
View preprint versions

Search citation statements

Order By: Relevance

Paper Sections

Select...
1
1
1

Citation Types

0
3
0

Year Published

2019
2019
2022
2022

Publication Types

Select...
1
1
1

Relationship

1
2

Authors

Journals

citations
Cited by 3 publications
(3 citation statements)
references
References 24 publications
0
3
0
Order By: Relevance
“…With the functional decomposition version, these extensions have to be added by defining new case classes of Operator and modifying existing consumers on Operator scattered around the file. In contrast, it can be simplified by switching to object-oriented style and adding the extensions modularly as classes with C : The transformed object-oriented code looks very much like the core part of Zhang and Oliveira [2019]'s hand-written implementation. Similarly, when the need of new operations such as compiling SQL queries to C backend arises, we can transform the implementation back to functional style to facilitate operation extensions.…”
Section: Sql Processormentioning
confidence: 99%
“…With the functional decomposition version, these extensions have to be added by defining new case classes of Operator and modifying existing consumers on Operator scattered around the file. In contrast, it can be simplified by switching to object-oriented style and adding the extensions modularly as classes with C : The transformed object-oriented code looks very much like the core part of Zhang and Oliveira [2019]'s hand-written implementation. Similarly, when the need of new operations such as compiling SQL queries to C backend arises, we can transform the implementation back to functional style to facilitate operation extensions.…”
Section: Sql Processormentioning
confidence: 99%
“…Nevertheless, that approach still requires a lot of boilerplate that needs to be repeated for each DSL, as well as explicit projections that need to be written in each interpretation. Another alternative Haskell encoding that also enables multiple dependent interpretations is proposed by Zhang and Oliveira [55], but it does not eliminate the explicit delegation and still requires substantial amounts of boilerplate. A final remark is that adding new primitives (e.g., a "right stretch" rstretch combinator [25]) can also be easily achieved [46].…”
Section: Composition Of Embeddingsmentioning
confidence: 99%
“…While using advanced meta-programming techniques enables automating the merge combinator to a large extent in existing programming languages [37,42], those techniques have several problems: error messages can be problematic, type-unsafe reflection is needed in some approaches [37] and advanced type-level features are required in others [42]. An alternative to the merge combinator that supports modular multiple interpretations and works in OO languages with support for some form of multiple inheritance and covariant type-refinement of fields has also been recently proposed [55]. While this approach is relatively simple, it still requires a lot of manual boilerplate code for composition of interpretations.…”
Section: Introductionmentioning
confidence: 99%