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 条
  • [31] Cross-language rhetorical preferences
    Taft, M.
    Huen, W.
    Chan, R.
    Kacanas, D.
    [J]. AUSTRALIAN JOURNAL OF PSYCHOLOGY, 2006, 58 : 12 - 12
  • [32] Cross-Language Retrieval with Wikipedia
    Schoenhofen, Peter
    Benczur, Andras
    Biro, Istvan
    Csalogany, Karoly
    [J]. ADVANCES IN MULTILINGUAL AND MULTIMODAL INFORMATION RETRIEVAL, 2008, 5152 : 72 - 79
  • [33] Cross-Language Information Retrieval
    Federico, Marcello
    [J]. COMPUTATIONAL LINGUISTICS, 2011, 37 (02) : 411 - 412
  • [34] Cross-language information retrieval
    Oard, DW
    Diekema, AR
    [J]. ANNUAL REVIEW OF INFORMATION SCIENCE AND TECHNOLOGY, 1998, 33 : 223 - 256
  • [35] Cross-language mediation in foreign language teaching and testing
    Antoniou, Celia
    [J]. SYSTEM, 2017, 69 : 185 - 186
  • [36] Second Language Proficiency and Cross-Language Lexical Activation
    van Hell, Janet G.
    Tanner, Darren
    [J]. LANGUAGE LEARNING, 2012, 62 : 148 - 171
  • [38] Multi-Language Online Handwriting Recognition
    Keysers, Daniel
    Deselaers, Thomas
    Rowley, Henry A.
    Wang, Li-Lun
    Carbune, Victor
    [J]. IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, 2017, 39 (06) : 1180 - 1194
  • [39] Morphological learning in a novel language: A cross-language comparison
    Havas, Viktoria
    Waris, Otto
    Vaquero, Lucia
    Rodriguez-Fornells, Antoni
    Laine, Matti
    [J]. QUARTERLY JOURNAL OF EXPERIMENTAL PSYCHOLOGY, 2015, 68 (07): : 1426 - 1441
  • [40] Realization of multi-language operating system
    Wang, Z.H.
    [J]. 2001, Shanghai Computer Society (27):