当前位置: X-MOL 学术ACM Trans. Program. Lang. Syst. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Cross-Language Interoperability in a Multi-Language Runtime
ACM Transactions on Programming Languages and Systems ( IF 1.5 ) Pub Date : 2018-05-29 , DOI: 10.1145/3201898
Matthias Grimmer 1 , Roland Schatz 1 , Chris Seaton 2 , Thomas Würthinger 3 , Mikel Luján 4 , Hanspeter Mössenböck 5
Affiliation  

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.

中文翻译:

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

在大型软件应用程序中,程序员经常结合不同的编程语言,因为这允许他们使用最适合给定问题的语言,将现有项目从一种语言逐渐迁移到另一种语言,或者重用现有的源代码。但是,不同的编程语言具有根本不同的实现,很难组合。语言实现的组合往往会导致语言之间的接口复杂、灵活性不足或性能不佳。我们提出了 TruffleVM,这是一种可以执行不同编程语言并能够以无缝方式组合它们的虚拟机 (VM)。TruffleVM 支持动态类型语言(例如,JavaScript 和 Ruby)以及静态类型的低级语言(例如,C)。它由单独的语言实现组成,将源代码转换为由共享 VM 执行的中间表示。TruffleVM 通过通用访问.通用访问是一种与语言无关的机制,语言实现使用它来访问外部数据或调用外部函数。它具有与语言无关的消息,TruffleVM 在运行时将其解析为有效的外语特定操作。通用访问支持多种语言,实现高效的多语言开发,保证高性能。我们评估通用访问有两个案例研究。第一个解释了 JavaScript、Ruby 和 C 的透明组合。第二个显示了 Ruby 的 C 扩展应用程序编程接口 (API) 的实现。我们表明通用访问保证良好的运行时性能。它避免了语言边界处外来对象的转换或编组,并允许动态编译器跨语言边界执行其优化。
更新日期:2018-05-29
down
wechat
bug