High-performance cross-language interoperability in a multi-language runtime
- 21 October 2015
- conference paper
- conference paper
- Published by Association for Computing Machinery (ACM) in Proceedings of the 11th Symposium on Dynamic Languages
Abstract
Programmers combine different programming languages because it 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, existing cross-language mechanisms suffer from complex interfaces, insufficient flexibility, or poor performance. We present the TruffleVM, a multi-language runtime that allows composing different language implementations in a seamless way. It reduces the amount of required boiler-plate code to a minimum by allowing programmers to access foreign functions or objects by using the notation of the host language. We compose language implementations that translate source code to an intermediate representation (IR), which is executed on top of a shared runtime system. Language implementations use language-independent messages that the runtime resolves at their first execution by transforming them to efficient foreign-language-specific operations. The TruffleVM avoids conversion or marshaling of foreign objects at the language boundary and allows the dynamic compiler to perform its optimizations across language boundaries, which guarantees high performance. This paper presents an implementation of our ideas based on the Truffle system and its guest language implementations JavaScript, Ruby, and C.Keywords
This publication has 30 references indexed in Scilit:
- Memory-safe Execution of C on a Java VMPublished by Association for Computing Machinery (ACM) ,2015
- High-performance language interoperability in multi-language runtimesPublished by Association for Computing Machinery (ACM) ,2014
- The challenge of cross-language interoperabilityCommunications of the ACM, 2013
- One VM to rule them allPublished by Association for Computing Machinery (ACM) ,2013
- Self-optimizing AST interpretersPublished by Association for Computing Machinery (ACM) ,2012
- Virtual machines should be invisiblePublished by Association for Computing Machinery (ACM) ,2011
- Safe Cross-Language InheritanceLecture Notes in Computer Science, 2008
- Fine-grained interoperability through mirrors and contractsACM SIGPLAN Notices, 2005
- No-Longer-Foreign: Teaching an ML compiler to speak C “natively”Electronic Notes in Theoretical Computer Science, 2001
- How not to lie with statistics: the correct way to summarize benchmark resultsCommunications of the ACM, 1986