Cross-Language Interoperability in a Multi-Language Runtime

被引:19
|
作者
Grimmer, Matthias [1 ]
Schatz, Roland [1 ]
Seaton, Chris [2 ]
Wuerthinger, Thomas [3 ]
Lujan, Mikel [4 ]
机构
[1] Oracle Labs Linz, Allenbergerstr 69, A-4040 Linz, Austria
[2] Oracle Labs, 6 Boundary Lane, Heswall CH60 5RR, Cheshire, England
[3] Oracle Labs Switzerland, Bahnhofstr 100, CH-8001 Zurich, Switzerland
[4] Univ Manchester, Sch Comp Sci, Manchester M13 9PL, Lancs, England
关键词
Cross-language; language interoperability; virtual machine; optimization; language implementation;
D O I
10.1145/3201898
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In large-scale software applications, programmers often combine different programming languages because this allows them to use the most suitable language for a given problem, to gradually migrate existing projects from one language to another, or to reuse existing source code. However, different programming languages have fundamentally different implementations, which are hard to combine. The composition of language implementations often results in complex interfaces between languages, insufficient flexibility, or poor performance. We propose TruffleVM, a virtual machine (VM) that can execute different programming languages and is able to compose them in a seamless way. TruffleVM supports dynamically-typed languages (e.g., JavaScript and Ruby) as well as statically typed low-level languages (e.g., C). It consists of individual language implementations, which translate source code to an intermediate representation that is executed by a shared VM. TruffleVM composes these different language implementations via generic access. Generic access is a language-agnostic mechanism that language implementations use to access foreign data or call foreign functions. It features language-agnostic messages that the TruffleVM resolves to efficient foreign-language-specific operations at runtime. Generic access supports multiple languages, enables an efficient multi-language development, and ensures high performance. We evaluate generic access with two case studies. The first one explains the transparent composition of JavaScript, Ruby, and C. The second one shows an implementation of the C extensions application programming interface (API) for Ruby. We show that generic access guarantees good runtime performance. It avoids conversion or marshalling of foreign objects at the language boundary and allows the dynamic compiler to perform its optimizations across language boundaries.
引用
收藏
页数:43
相关论文
共 50 条
  • [41] Separation of concerns in multi-language specifications
    Damasevicius, R
    Stuikys, V
    [J]. INFORMATICA, 2002, 13 (03) : 255 - 274
  • [42] Operational semantics for multi-language programs
    Matthews, Jacob
    Findler, Robert Bruce
    [J]. ACM SIGPLAN NOTICES, 2007, 42 (01) : 3 - 10
  • [43] Compressive approaches for cross-language multi-document summarization
    Pontes, Elvys Linhares
    Huet, Stephane
    Torres-Moreno, Juan-Manuel
    Linhares, Andrea Carneiro
    [J]. DATA & KNOWLEDGE ENGINEERING, 2020, 125
  • [44] MULTI-LANGUAGE SERVICE LITERATURE PROGRAM
    MATTHEWS, PA
    [J]. IEEE TRANSACTIONS ON PROFESSIONAL COMMUNICATION, 1977, 20 (04) : 225 - 228
  • [45] A versatile kernel for multi-language AOP
    Tanter, É
    Noyé, J
    [J]. GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING, PROCEEDINGS, 2005, 3676 : 173 - 188
  • [46] Semantic language and multi-language MT approach based on SL
    QingShi Gao
    Yue Hu
    Li Li
    XiaoYu Gao
    [J]. Journal of Computer Science and Technology, 2003, 18 : 848 - 852
  • [47] On the Impact of Inter-language Dependencies in Multi-language Systems
    Grichi, Manel
    Abidi, Mouna
    Jaafar, Fehmi
    Eghan, Ellis E.
    Adams, Bram
    [J]. 2020 IEEE 20TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY, AND SECURITY (QRS 2020), 2020, : 509 - 509
  • [48] Typing a multi-language intermediate code
    Gordon, AD
    Syme, D
    [J]. ACM SIGPLAN NOTICES, 2001, 36 (03) : 248 - 260
  • [49] Cross-national and multi-language qualitative research: challenges and recommendations
    Haak, Maria
    Himmelsbach, Ines
    Granbom, Marianne
    Lofqvist, Charlotte
    [J]. BRITISH JOURNAL OF OCCUPATIONAL THERAPY, 2013, 76 (07) : 333 - 336
  • [50] Operational Semantics for Multi-Language Programs
    Matthews, Jacob
    Findler, Robert Bruce
    [J]. CONFERENCE RECORD OF POPL 2007: THE 34TH ACM SIGPLAN SIGACT SYMPOSIUM ON PRINCIPLES OF PROGAMMING LANGUAGES, 2007, : 3 - 10