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 条
  • [31] First-Class Citizens All
    Scherer, Marge
    EDUCATIONAL LEADERSHIP, 2013, 71 (02) : 7 - 7
  • [32] Contracts for First-Class Classes
    Strickland, T. Stephen
    Dimoulas, Christos
    Takikawa, Asumu
    Felleisen, Matthias
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2013, 35 (03):
  • [33] Associations as First-class Elements
    Bildhauer, Daniel
    DATABASES AND INFORMATION SYSTEMS VI: SELECTED PAPERS FROM THE NINTH INTERNATIONAL BALTIC CONFERENCE (DB&IS 2010), 2011, 224 : 108 - 121
  • [34] An experiment in first-class protein
    Mann, HCC
    Hopkins, FG
    LANCET, 1935, 1 : 145 - 147
  • [35] Contracts for First-Class Modules
    Strickland, T. Stephen
    Felleisen, Matthias
    ACM SIGPLAN NOTICES, 2009, 44 (12) : 27 - 38
  • [36] First-Class Object Sets
    Ernst, Erik
    TYPES FOR PROOFS AND PROGRAMS, 2009, 5497 : 83 - 99
  • [37] Amongst First-Class Protocols
    Miller, Tim
    McGinnis, Jarred
    ENGINEERING SOCIETIES IN THE AGENTS WORLD VIII, 2008, 4995 : 208 - +
  • [38] First-class type classes
    Sozeau, Matthieu
    Oury, Nicolas
    THEOREM PROVING IN HIGHER ORDER LOGICS, PROCEEDINGS, 2008, 5170 : 278 - +
  • [39] Parsing with First-Class Derivatives
    Brachthaeuser, Jonathan Immanuel
    Rendel, Tillmann
    Ostermann, Klaus
    ACM SIGPLAN NOTICES, 2016, 51 (10) : 588 - 606
  • [40] First-class attribute grammars
    de Moor, Oege
    Backhouse, Kevin
    Swierstra, S.Doaitse
    Informatica (Ljubljana), 2000, 24 (03) : 329 - 341