Compositional Embeddings of Domain-Specific Languages

被引:0
|
作者
Sun, Yaozhu [1 ]
Dhandhania, Utkarsh [1 ]
Oliveira, Bruno C. D. S. [1 ]
机构
[1] Univ Hong Kong, Dept Comp Sci, Hong Kong, Peoples R China
来源
关键词
Compositional Programming; Extensible Typesetting; GENERICS;
D O I
10.1145/3563294
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页数:29
相关论文
共 50 条
  • [31] Domain-specific chatbots for science using embeddings
    Yager, Kevin G.
    [J]. DIGITAL DISCOVERY, 2023, 2 (06): : 1850 - 1861
  • [32] Domain-Specific Word Embeddings with Structure Prediction
    Lassner, David
    Brandl, Stephanie
    Baillot, Anne
    Nakajima, Shinichi
    [J]. TRANSACTIONS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, 2023, 11 : 320 - 335
  • [33] Using Ontologies in the Domain Analysis of Domain-Specific Languages
    Tairas, Robert
    Mernik, Marjan
    Gray, Jeff
    [J]. MODELS IN SOFTWARE ENGINEERING, 2009, 5421 : 332 - +
  • [34] EXTENSIBLE HOST LANGUAGE FOR DOMAIN-SPECIFIC LANGUAGES
    Chodarev, Sergej
    Kollar, Jan
    [J]. COMPUTING AND INFORMATICS, 2016, 35 (01) : 84 - 110
  • [35] UML customization versus domain-specific languages
    Gray, Jeff
    Rumpe, Bernhard
    [J]. SOFTWARE AND SYSTEMS MODELING, 2018, 17 (03): : 713 - 714
  • [36] A Foundation for the Composition of Multilevel Domain-Specific Languages
    Rodriguez, Alejandro
    Rutle, Adrian
    Kristensen, Lars Michael
    Duran, Francisco
    [J]. 2019 ACM/IEEE 22ND INTERNATIONAL CONFERENCE ON MODEL DRIVEN ENGINEERING LANGUAGES AND SYSTEMS COMPANION (MODELS-C 2019), 2019, : 88 - 97
  • [37] JTS: Tools for implementing domain-specific languages
    Batory, D
    Lofaso, B
    Smaragdakis, Y
    [J]. FIFTH INTERNATIONAL CONFERENCE ON SOFTWARE REUSE - PROCEEDINGS, 1998, : 143 - 153
  • [38] A framework for qualitative assessment of domain-specific languages
    Gökhan Kahraman
    Semih Bilgen
    [J]. Software & Systems Modeling, 2015, 14 : 1505 - 1526
  • [39] Generating Version Convertors for Domain-Specific Languages
    de Geest, Gerardo
    Vermolen, Sander
    van Deursen, Arie
    Visser, Eelco
    [J]. FIFTEENTH WORKING CONFERENCE ON REVERSE ENGINEERING, PROCEEDINGS, 2008, : 197 - 201
  • [40] Domain-Specific Languages: A Systematic Mapping Study
    Mernik, Marjan
    [J]. SOFSEM 2017: THEORY AND PRACTICE OF COMPUTER SCIENCE, 2017, 10139 : 464 - 472