Wasm/k: Delimited Continuations for WebAssembly
Donald Pinckney, Arjun Guha, Yuriy Brun

TL;DR
This paper introduces Wasm/k, an extension to WebAssembly that natively supports delimited continuations, enabling more efficient compilation of high-level language features and improving performance and code size.
Contribution
Wasm/k extends WebAssembly with native delimited continuations without changing value types, ensuring safety and efficiency, and demonstrates practical benefits through a C/C++ implementation.
Findings
Wasm/k improves green thread performance by 18% over Asyncify.
Wasm/k reduces code size by 30%.
Wasm/k maintains safety with foreign function calls.
Abstract
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,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
