COOLER: COmpOsing LanguagE Runtimes
COOLER: COmpOsing LanguagE Runtimes
批准号:
EP/K01790X/1
负责人:
Laurence Tratt
金额:
$78.86万
依托单位:
依托单位国家:
英国
项目类别:
Research Grant
财政年份:
2013
资助国家:
英国
项目状态:
已结题
起止时间:
2013 至 --
中文摘要
传统上,大多数软件项目都是使用单一的编程语言来处理的。然而,随着我们对软件的野心的增长,这越来越不自然:没有一种语言,无论多么“好”,都适合所有的东西。越来越多的不同社区创建或采用非传统语言--通常(尽管并非总是)打着领域特定语言(DSL)的旗号--以满足他们的特定需求。其后端软件可能使用SQL和Java;其桌面软件C#;其网站后端PHP和前端JavaScript和HTML5;报告可能使用R创建;一些部门可能使用Python或Haskell制作原型软件。虽然组织使用不同的语言,但每种语言都必须在自己的筒仓中执行。目前,我们几乎没有什么技术可以让一个运行中的程序使用多种语言编写。在Cooler项目中,我们称之为“运行时组合”问题:语言如何直接相互执行,交换数据,相互调用,相互优化等?编写语言运行时的主要现有技术是将组合中的所有语言转换为基本语言,最常见的是“大”虚拟机(VM)之一的字节码- Java的HotSpot或.NET的Java。虽然这在某些情况下效果很好,但它有两个主要问题。首先,VM将有意地针对特定的语言家族,并且可能不提供该家族之外的语言所需的原语。例如,HotSpot不支持尾递归或延续,排除了许多高级语言。其次,VM暴露的原语可能不允许程序的有效执行。例如,在HotSpot上运行的动态类型语言比看起来不那么复杂的“自制”虚拟机运行得慢。它假设元跟踪将允许任意语言运行时的有效组合。元跟踪是最近开发的一种技术,它使用自定义即时(JIT)编译器创建高效的VM。首先,语言设计者为他们选择的语言编写一个解释器。当解释器执行用户程序时,代码中的热路径被记录(“跟踪”),优化并转换为机器码;随后的调用使用快速的机器码而不是缓慢的解释器。元跟踪与部分求值不同:它记录解释器在特定用户程序上执行的实际操作。元跟踪是一种令人兴奋的新技术,原因有三。首先,它导致了快速的VM:PyPy VM(完全兼容的Python重新实现)比CPython(基于C的Python VM)和Jython(JVM上的Python)快5倍以上。其次,它需要很少的资源:Converge语言的元跟踪实现在不到3个月的时间内完成,并且比CPython和Jython运行得更快。第三,由于用户自己编写解释器,因此不会偏向任何特定的语言家族。Cooler项目最初将设计第一种专门为元跟踪设计的语言(而不是像现有系统那样重用不合适的现有语言)。这将使我们能够探索语言运行时组合的各个方面。首先,跨运行时共享:不同的范例(例如命令式和函数式)如何交换数据和行为?第二,优化:如何优化以多种范式编写的程序(空间和时间)?最后,该方法的局限性将通过已知的困难问题进行探讨:跨运行时垃圾收集;并发性;以及在何种程度上可以组成未设计用于组合的运行时。最终,该项目将允许用户以目前不可行的方式将运行时和程序组合在一起。
英文摘要
Traditionally, most software projects have been tackled using a single programming language. However, as our ambitions for software grow, this is increasingly unnatural: no single language, no matter how "good", is well-suited to everything. Increasingly, different communities have created or adopted non-traditional languages - often, though not always, under the banner of Domain Specific Languages (DSLs) - to satisfy their specific needs.Consider a large organisation. Its back-end software may utilise SQL and Java; its desktop software C#; its website back-end PHP and the front-end Javascript and HTML5; reports may be created using R; and some divisions may prototype software with Python or Haskell. Though the organisation makes use of different languages, each must execute in its own silo. We currently have few techniques to allow a single running program to be written using multiple languages. In the Cooler project, we call this the "runtime composition" problem: how can languages execute directly alongside each other, exchange data, call each other, optimise with respect to each other, etc.?The chief existing technique for composing language runtimes is to translate all languages in the composition down to a base language, most commonly the byte code for one of the "big" Virtual Machines (VMs) - Java's HotSpot or .NET's CLR. Though this works well in some cases, it has two major problems. Firstly, a VM will intentionally target a specific family of languages, and may not provide the primitives needed by languages outside that family. HotSpot, for example, does not support tail recursion or continuations, excluding many advanced languages. Secondly, the primitives that a VM exposes may not allow efficient execution of programs. For example, dynamically typed languages running on HotSpot run slower than their seemingly much less sophisticated "home brew" VMs.The Cooler project takes a new approach to the composition problem. It hypothesizes that meta-tracing will allow the efficient composition of arbitrary language runtimes. Meta-tracing is a recently developed technique that creates efficient VMs with custom Just-in-Time (JIT) compilers. Firstly, language designers write an interpreter for their chosen language. When that interpreter executes a user's program, hot paths in the code are recorded ("traced"), optimised, and converted into machine code; subsequent calls then use that fast machine code rather than the slow interpreter. Meta-tracing is distinct from partial evaluation: it records actual actions executed by the interpreter on a specific user program. Meta-tracing is an exciting new technique for three reasons. Firstly, it leads to fast VMs: the PyPy VM (a fully compatible reimplementation of Python) is over 5 times faster than CPython (the C-based Python VM) and Jython (Python on the JVM). Secondly, it requires few resources: a meta-tracing implementation of the Converge language was completed in less than 3 person months, and runs faster than CPython and Jython. Third, because the user writes the interpreter themselves, there is no bias to any particular family of languages.The Cooler project will initially design the first language specifically designed for meta-tracing (rather than, as existing systems, reusing an unsuitable existing language). This will enable the exploration of various aspects of language runtime composition. First, cross-runtime sharing: how can different paradigms (e.g. imperative and functional) exchange data and behaviour? Second, optimisation: how can programs written in multiple paradigms be optimised (space and time)? Finally, the limits of the approach will be explored through known hard problems: cross-runtime garbage collection; concurrency; and to what extent runtimes not designed for composition can be composed. Ultimately, the project will allow users to compose together runtimes and programs in ways that are currently unfeasible.
期刊论文(10)
专著(0)
科研奖励(0)
会议论文
登录
查看更多内容
Unipycation
单一化
DOI:
10.1145/2542142.2542146
发表时间:
2013
期刊:
影响因子:
--
作者:
[Barrett E]
通讯作者:
Barrett E
Pycket: a tracing JIT for a functional language
Pycket:函数式语言的跟踪 JIT
DOI:
10.1145/2784731.2784740
发表时间:
2015
期刊:
影响因子:
--
作者:
[Bauman S]
通讯作者:
Bauman S
DOI:
10.48550/arxiv.1409.0757
发表时间:
2014
期刊:
影响因子:
--
作者:
[Barrett E]
通讯作者:
Barrett E
Sound gradual typing: only mostly dead
声音渐进打字:只有大部分死了
DOI:
10.1145/3133878
发表时间:
2017
期刊:
Proceedings of the ACM on Programming Languages
影响因子:
--
作者:
[Bauman S]
通讯作者:
Bauman S
DOI:
10.1145/3133876
发表时间:
2016-02
期刊:
Proceedings of the ACM on Programming Languages
影响因子:
--
作者:
[Edd Barrett;Carl Friedrich Bolz-Tereick;Rebecca Killick;S. Mount;L. Tratt]
通讯作者:
Edd Barrett;Carl Friedrich Bolz-Tereick;Rebecca Killick;S. Mount;L. Tratt
共 6 条
Chrompartments: Hybrid Compartmentalisation for Web Browsers
-
批准号:EP/X015963/1
-
项目类别:Research Grant
-
资助金额:$137.27万
-
财政年份:2022
-
负责人:Laurence Tratt
-
依托单位:
CapableVMs
-
批准号:EP/V000373/1
-
项目类别:Research Grant
-
资助金额:$106.67万
-
财政年份:2020
-
负责人:Laurence Tratt
-
依托单位:
HAMLET: Hardware Enabled Meta-Tracing (ext.)
-
批准号:EP/S020861/1
-
项目类别:Fellowship
-
资助金额:$117.61万
-
财政年份:2019
-
负责人:Laurence Tratt
-
依托单位:
LECTURE: LanguagE ComposiTion UnifiEd
-
批准号:EP/L02344X/1
-
项目类别:Fellowship
-
资助金额:$121.48万
-
财政年份:2014
-
负责人:Laurence Tratt
-
依托单位:
海外基金