File Download

There are no files associated with this item.

  Links for fulltext
     (May Require Subscription)
Supplementary

Article: Compositional embeddings of domain-specific languages

TitleCompositional embeddings of domain-specific languages
Authors
KeywordsCompositional Programming
Extensible Typesetting
Issue Date31-Oct-2022
PublisherAssociation for Computing Machinery (ACM)
Citation
Proceedings of the ACM on Programming Languages, 2022, v. 6, n. OOPSLA2 How to Cite?
Abstract

A common approach to defining domain-specific languages (DSLs) is via a direct embedding into a host language. There are several well-known techniques to do such embeddings, including shallow and deep embeddings. However, such embeddings come with various trade-offs in existing programming languages. Owing to such trade-offs, many embedded DSLs end up using a mix of approaches in practice, requiring a substantial amount of code, as well as some advanced coding techniques.

In this paper, we show that the recently proposed Compositional Programming paradigm and the CP language provide improved support for embedded DSLs. In CP we obtain a new form of embedding, which we call a compositional embedding, that has most of the advantages of both shallow and deep embeddings. On the one hand, compositional embeddings enable various forms of linguistic reuse that are characteristic of shallow embeddings, including the ability to reuse host-language optimizations in the DSL and add new DSL constructs easily. On the other hand, similarly to deep embeddings, compositional embeddings support definitions by pattern matching or dynamic dispatching (including dependent interpretations, transformations, and optimizations) over the abstract syntax of the DSL and have the ability to add new interpretations. We illustrate an instance of compositional embeddings with a DSL for document authoring called ExT. The DSL is highly flexible and extensible, allowing users to create various non-trivial extensions easily. For instance, ExT supports various extensions that enable the production of wiki-like documents, LaTeX documents, vector graphics or charts. The viability of compositional embeddings for ExT is evaluated with three applications.


Persistent Identifierhttp://hdl.handle.net/10722/331959
ISSN
2023 Impact Factor: 2.2
2023 SCImago Journal Rankings: 1.242
ISI Accession Number ID

 

DC FieldValueLanguage
dc.contributor.authorSun, Yaozhu-
dc.contributor.authorDhandhania, Utkarsh-
dc.contributor.authorOliveira, Bruno C d S-
dc.date.accessioned2023-09-28T04:59:53Z-
dc.date.available2023-09-28T04:59:53Z-
dc.date.issued2022-10-31-
dc.identifier.citationProceedings of the ACM on Programming Languages, 2022, v. 6, n. OOPSLA2-
dc.identifier.issn2475-1421-
dc.identifier.urihttp://hdl.handle.net/10722/331959-
dc.description.abstract<p>A common approach to defining domain-specific languages (DSLs) is via a direct embedding into a host language. There are several well-known techniques to do such embeddings, including shallow and deep embeddings. However, such embeddings come with various trade-offs in existing programming languages. Owing to such trade-offs, many embedded DSLs end up using a mix of approaches in practice, requiring a substantial amount of code, as well as some advanced coding techniques.</p><p>In this paper, we show that the recently proposed Compositional Programming paradigm and the CP language provide improved support for embedded DSLs. In CP we obtain a new form of embedding, which we call a compositional embedding, that has most of the advantages of both shallow and deep embeddings. On the one hand, compositional embeddings enable various forms of linguistic reuse that are characteristic of shallow embeddings, including the ability to reuse host-language optimizations in the DSL and add new DSL constructs easily. On the other hand, similarly to deep embeddings, compositional embeddings support definitions by pattern matching or dynamic dispatching (including dependent interpretations, transformations, and optimizations) over the abstract syntax of the DSL and have the ability to add new interpretations. We illustrate an instance of compositional embeddings with a DSL for document authoring called ExT. The DSL is highly flexible and extensible, allowing users to create various non-trivial extensions easily. For instance, ExT supports various extensions that enable the production of wiki-like documents, LaTeX documents, vector graphics or charts. The viability of compositional embeddings for ExT is evaluated with three applications.</p>-
dc.languageeng-
dc.publisherAssociation for Computing Machinery (ACM)-
dc.relation.ispartofProceedings of the ACM on Programming Languages-
dc.rightsThis work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.-
dc.subjectCompositional Programming-
dc.subjectExtensible Typesetting-
dc.titleCompositional embeddings of domain-specific languages-
dc.typeArticle-
dc.description.naturepublished_or_final_version-
dc.identifier.doi10.1145/3563294-
dc.identifier.scopuseid_2-s2.0-85168424076-
dc.identifier.volume6-
dc.identifier.issueOOPSLA2-
dc.identifier.eissn2475-1421-
dc.identifier.isiWOS:001083750200008-
dc.identifier.issnl2475-1421-

Export via OAI-PMH Interface in XML Formats


OR


Export to Other Non-XML Formats