Wasm/k: delimited continuations for WebAssembly

Wasm/k: delimited continuations for WebAssembly
复制标题

Wasm/k:WebAssembly 的分隔延续

DOI:
10.1145/3426422.3426978
复制
发表时间:
2020
期刊:
ACM SIGPLAN International Symposium on Dynamic Languages (DLS
影响因子:
--
通讯作者:
Brun, Yuriy
Brun, Yuriy
中科院分区:
--
文献类型:
--
作者:
Pinckney, Donald;Guha, Arjun;Brun, Yuriy

文献摘要

参考文献

被引文献

相似文献

WebAssembly被设计成JavaScript的替代品,它是各种语言的安全,可移植和高效的编译目标。高级语言的性能不仅取决于WebAssembly的底层性能,还取决于生成的WebAssembly代码的质量。在本文中,我们确定了高级语言的几个功能,目前的方法只能通过生成复杂和低效的代码编译为WebAssembly。我们认为,这些问题可以解决,如果WebAssembly原生支持一流的延续。然后,我们介绍Wasm/k,它扩展了WebAssembly,带有分隔的延续。Wasm/k没有引入新的值类型,因此不需要对WebAssembly类型系统(验证)进行重大更改。Wasm/k是安全的,即使存在外部函数调用(例如,和来自JavaScript)。最后,Wasm/k可以有效地实现:我们将Wasm/k实现为Wasmtime的本地更改,Wasmtime是现有的WebAssembly JIT。我们通过实现C/k来评估Wasm/k,它将分隔的延续添加到C/C++。C/k使用Emscripten,它的实现可以作为如何在面向WebAssembly的编译器中使用Wasm/k的案例研究。我们提出了几个案例研究,使用C/k,并表明,在实现绿色线程,它可以优于最先进的方法Asyncify的性能提高了18%,代码大小提高了30%。
WebAssembly is designed to be an alternative to JavaScript that is a safe, portable, and efficient compilation target for a variety of languages. The performance of high-level languages depends not only on the underlying performance of WebAssembly, but also on the quality of the generated WebAssembly code. In this paper, we identify several features of high-level languages that current approaches can only compile to WebAssembly by generating complex and inefficient code. We argue that these problems could be addressed if WebAssembly natively supported first-class continuations. We then present Wasm/k, which extends WebAssembly with delimited continuations. Wasm/k introduces no new value types, and thus does not require significant changes to the WebAssembly type system (validation). Wasm/k is safe, even in the presence of foreign function calls (e.g., to and from JavaScript). Finally, Wasm/k is amenable to efficient implementation: we implement Wasm/k as a local change to Wasmtime, an existing WebAssembly JIT. We evaluate Wasm/k by implementing C/k, which adds delimited continuations to C/C++. C/k uses Emscripten and its implementation serves as a case study on how to use Wasm/k in a compiler that targets WebAssembly. We present several case studies using C/k, and show that on implementing green threads, it can outperform the state-of-the-art approach Asyncify with an 18% improvement in performance and a 30% improvement in code size.
控制分隔符及其层次结构
DOI: 10.1007/bf01806126
发表时间: 1990
期刊: LISP and Symbolic Computation
影响因子: --
作者:
Dorai Sitaram;M. Felleisen
通讯作者: M. Felleisen
DOI: 10.1145/91556.91622
发表时间: 1990
期刊: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation
影响因子: --
作者:
O. Danvy;Andrzej Filinski
通讯作者: Andrzej Filinski
文章的复制包:从民间传说到事实:比较 Stack 和 Continuations 的实现
DOI: --
发表时间: 2020
期刊: Artifact Digital Object Group
影响因子: --
作者:
K. Farvardin;John H. Reppy
通讯作者: John H. Reppy
从民间传说到事实:比较堆栈和延续的实现
DOI: 10.1145/3385412.3385994
发表时间: 2020
期刊: ACM SIGPLAN International Conference on Programming Language Design and Implementation
影响因子: --
作者:
Farvardin, Kavon;Reppy, John
通讯作者: Reppy, John
DOI: 10.1007/978-1-4842-1922-5_30
发表时间: 2021
期刊: OCP Oracle® Certified Professional Java® SE 11 Developer Practice Tests
影响因子: --
作者:
Coen de Groot
通讯作者: Coen de Groot