paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Cross-Language Interoperability in a Multi-Language Runtime

多语言运行时中的跨语言互操作性
TOPLAS 40(2)2018匹配度 1/10 · 论文研究多语言运行时、跨语言互操作与动态编译,未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户核心研究方向几乎没有直接交集。引用 39 inbox
Matthias Grimmer, Roland Schatz, Chris Seaton, Thomas Würthinger, Mikel Luján, Hanspeter Mössenböck
crossref: 2026-09-10

AI 速览

一句话:提出 TruffleVM 与 generic access 机制,实现多语言运行时中高效无缝的跨语言互操作。

大型软件常混合多种编程语言以选用最合适的语言、渐进迁移或复用代码,但不同语言实现差异大,组合时接口复杂、灵活性差且性能低。本文提出 TruffleVM,一个可无缝组合多语言的虚拟机,支持 JavaScript、Ruby 等动态类型语言与 C 等静态低层语言;各语言实现将源码翻译为共享 VM 执行的中间表示。核心机制 generic access 是语言无关的访问外部数据或调用外部函数的途径,通过语言无关消息在运行时解析为高效的外部语言特定操作。两个案例研究:JavaScript、Ruby 与 C 的透明组合,以及 Ruby 的 C 扩展 API 实现。结果表明该机制性能良好,避免边界处对象转换或封送,并允许动态编译器跨语言边界优化。

问题
大型异构软件常混合多种语言,但不同语言的实现差异导致组合时接口复杂、灵活性不足且性能低下,如何在同一运行时中无缝、高效地组合多种语言是核心问题。
方法
提出 TruffleVM 多语言虚拟机,各语言实现将源码转为共享 VM 执行的中间表示;通过语言无关的 generic access 机制访问外部数据与调用外部函数,在运行时将语言无关消息解析为高效的外部语言特定操作。
评估
通过两个案例研究评估:JavaScript、Ruby 与 C 的透明组合,以及 Ruby 的 C 扩展 API 实现;结果显示 generic access 保证良好运行时性能,避免跨语言边界对象转换/封送,并支持动态编译器跨边界优化。
原文摘要(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 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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot322,
  title = {Cross-Language Interoperability in a Multi-Language Runtime},
  author = {Matthias Grimmer and Roland Schatz and Chris Seaton and Thomas Würthinger and Mikel Luján and Hanspeter Mössenböck},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {40},
  number = {2},
  year = {2018},
  doi = {10.1145/3201898}
}