Almost First-Class Language Embedding

被引:0
|
作者
Scherr, Maximilian [1 ]
Chiba, Shigeru [1 ]
机构
[1] Univ Tokyo, Tokyo 1138654, Japan
关键词
!text type='Java']Java[!/text; implementation; embedded DSLs; metaprogramming; program transformation; staging; programming languages; design;
D O I
10.1145/2936314.2814217
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Embedded domain-specific languages (EDSLs), inheriting a general-purpose language's features as well as look-and-feel, have traditionally been second-class or rather non-citizens in terms of host-language design. This makes sense when one regards them to be on the same level as traditional, non-EDSL library interfaces. However, this equivalence only applies to the simplest of EDSLs. In this paper we illustrate why this is detrimental when moving on to EDSLs that employ staging, i.e. program reification, by example of various issues that affect authors and users alike. We believe that if EDSLs are to be considered a reliable, language-like interface abstraction, they require exceptional attention and design scrutiny. Instead of unenforceable conventions, we advocate the acceptance of EDSLs as proper, i.e. almost first-class, citizens while retaining most advantages of pure embeddings. As a small step towards this goal, we present a pragmatic framework prototype for Java. It is based on annotations that explicate and document membership to explicit EDSL entities. In a nutshell, our framework identifies (annotated) method calls and field accesses as EDSL terms and dynamically constructs an abstract-syntax representation, which is eventually passed to a semantics-defining back end implemented by the EDSL author.
引用
收藏
页码:21 / 30
页数:10
相关论文
共 50 条
  • [21] Measurements As First-class Artifacts
    Laffranchini, Paolo
    Rodrigues, Luis
    Canini, Marco
    Krishnamurthy, Balachander
    IEEE CONFERENCE ON COMPUTER COMMUNICATIONS (IEEE INFOCOM 2019), 2019, : 415 - 423
  • [22] Creating first-class universities
    不详
    CHINESE EDUCATION AND SOCIETY, 2004, 37 (06): : 27 - 37
  • [23] A Case for First-Class Environments
    Tan, Jinhao
    Oliveira, Bruno C. D. S.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (OOPSLA): : 2521 - 2550
  • [24] First-class monadic schedules
    Mirani, R
    Hudak, P
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2004, 26 (04): : 609 - 651
  • [25] FIRST-CLASS SCIENTIFIC CONTRIBUTION
    Cirgic, Adnan
    LINGUA MONTENEGRINA, 2023, 31 : 377 - 381
  • [26] A first-class approach to genericity
    Allen, E
    Bannet, J
    Cartwright, R
    ACM SIGPLAN NOTICES, 2003, 38 (11) : 96 - 114
  • [27] First-Class Dynamic Types
    Homer, Michael
    Jones, Timothy
    Noble, James
    PROCEEDINGS OF THE 15TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON DYNAMIC LANGUAGES (DLS '19), 2019, : 1 - 14
  • [28] The lure of first-class science
    不详
    SCIENCE, 2002, 297 (5586) : 1472 - 1472
  • [29] Becoming a First-Class Noticer
    Bazerman, Max H.
    HARVARD BUSINESS REVIEW, 2014, 92 (7-8) : 116 - 119
  • [30] First-class contexts in ML
    Hashimoto, H
    ADVANCES IN COMPUTING SCIENCE-ASIAN' 98, 1998, 1538 : 206 - 223