High-performance cross-language interoperability in a multi-language runtime

High-performance cross-language interoperability in a multi-language runtime
复制标题

多语言运行时的高性能跨语言互操作性

DOI:
--
复制
发表时间:
2015
期刊:
Dynamic Languages Symposium
影响因子:
--
通讯作者:
H. Mössenböck
H. Mössenböck
中科院分区:
--
文献类型:
--
作者:
Matthias Grimmer;Chris Seaton;Roland Schatz;Thomas Würthinger;H. Mössenböck

文献摘要

被引文献

相似文献

程序员组合不同的编程语言,因为它允许他们针对给定的问题使用最合适的语言,逐渐地将现有的项目从一种语言迁移到另一种语言,或者重用现有的源代码。然而,现有的跨语言机制存在接口复杂、灵活性不足或性能差的问题。我们介绍了TruffleVM,这是一个多语言运行时,允许以无缝的方式组合不同的语言实现。它允许程序员通过使用宿主语言的符号来访问外部函数或对象,从而将所需的样板代码数量减少到最低限度。我们编写语言实现,将源代码转换为中间表示(IR),在共享运行时系统之上执行。语言实现使用与语言无关的消息,运行库在第一次执行时通过将其转换为高效的特定于外语的操作来解析这些消息。TruffleVM避免在语言边界上转换或封送外部对象,并允许动态编译器跨语言边界执行优化,从而保证高性能。本文介绍了基于Truffle系统的我们的想法的实现及其客户语言实现JavaScript, Ruby和C。
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.