Cross-Language Interoperability in a Multi-Language Runtime

Matthias Grimmer, Roland Schatz, Chris Seaton, Thomas Würthinger, Mikel Luján

Research output: Contribution to journalArticlepeer-review

Abstract

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 GraalVM, a VM that can execute different programming languages and is able to compose them in a seamless way. GraalVM 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 virtual ma- chine. GraalVM 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 GraalVM resolves to efficient foreign-language-specific operations at run time. 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 API for Ruby. We show that generic access guarantees good run-time 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.
Original languageEnglish
Article number8
JournalACM Transactions on Programming Languages and Systems
Volume40
Issue number2
Early online date2 Jun 2018
DOIs
Publication statusPublished - 18 Jun 2018

Fingerprint

Dive into the research topics of 'Cross-Language Interoperability in a Multi-Language Runtime'. Together they form a unique fingerprint.

Cite this