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 条
  • [1] High-Performance Cross-Language Interoperability in a Multi-language Runtime
    Grimmer, Matthias
    Seaton, Chris
    Schatz, Roland
    Wurthinger, Thomas
    Moessenboeck, Hanspeter
    [J]. ACM SIGPLAN NOTICES, 2016, 51 (02) : 78 - 90
  • [2] Cross-Language Interoperability in a Multi-Language Runtime (vol 40, 8, 2018)
    Grimmer
    Mossenbock, Hanspeter
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2018, 40 (04):
  • [3] The Challenge of Cross-Language Interoperability
    Chisnall, David
    [J]. COMMUNICATIONS OF THE ACM, 2013, 56 (12) : 50 - 56
  • [4] Cross-Language Interoperability of Heterogeneous Code
    Stratikopoulos, Athanasios
    Blanaru, Florin
    Fumero, Juan
    Xekalaki, Maria
    Papadakis, Orion
    Kotselidis, Christos
    [J]. COMPANION PROCEEDINGS OF THE 7TH INTERNATIONAL CONFERENCE ON THE ART, SCIENCE, AND ENGINEERING OF PROGRAMMING, PROGRAMMING 2023, 2023, : 17 - 21
  • [5] SuperContra: Cross-Language, Cross-Runtime Contracts As a Service
    Dimopoulos, Stratos
    Krintz, Chandra
    Wolski, Rich
    Gupta, Anand
    [J]. 2015 IEEE INTERNATIONAL CONFERENCE ON CLOUD ENGINEERING (IC2E 2015), 2015, : 283 - 286
  • [6] On Multi-language Abstraction Towards a Static Analysis of Multi-language Programs
    Buro, Samuele
    Crole, Roy L.
    Mastroeni, Isabella
    [J]. STATIC ANALYSIS (SAS 2020), 2020, 12389 : 310 - 332
  • [7] On multi-language abstraction: Towards a static analysis of multi-language programs
    Buro, Samuele
    Crole, Roy
    Mastroeni, Isabella
    [J]. FORMAL METHODS IN SYSTEM DESIGN, 2023,
  • [8] Multi-language synchronization
    Ennals, Robert
    Gay, David
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2007, 4421 : 475 - +
  • [9] On the Multi-Language Construction
    Buro, Samuele
    Mastroeni, Isabella
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, ESOP 2019: 28TH EUROPEAN SYMPOSIUM ON PROGRAMMING, 2019, 11423 : 293 - 321
  • [10] Language and cognition: A cross-language perspective
    Chen, HC
    [J]. INTERNATIONAL JOURNAL OF PSYCHOLOGY, 2004, 39 (5-6) : 148 - 148