Continuing WebAssembly with Effect Handlers
Luna Phipps-Costin, Andreas Rossberg, Arjun Guha, Daan Leijen, Daniel, Hillerstr\"om, KC Sivaramakrishnan, Matija Pretnar, Sam Lindley

TL;DR
WasmFX extends WebAssembly with effect handlers to support non-local control flow features directly, simplifying compiler design and maintaining type safety, with promising initial performance results.
Contribution
WasmFX introduces a minimal, type-safe effect handler extension to WebAssembly, enabling direct compilation of advanced control flow features.
Findings
Extension is minimal, adding only three instructions.
Prototype implementation in Wasmtime shows encouraging performance.
Formal specification and soundness proof provided.
Abstract
WebAssembly (Wasm) is a low-level portable code format offering near native performance. It is intended as a compilation target for a wide variety of source languages. However, Wasm provides no direct support for non-local control flow features such as async/await, generators/iterators, lightweight threads, first-class continuations, etc. This means that compilers for source languages with such features must ceremoniously transform whole source programs in order to target Wasm. We present WasmFX, an extension to Wasm which provides a universal target for non-local control features via effect handlers, enabling compilers to translate such features directly into Wasm. Our extension is minimal and only adds three main instructions for creating, suspending, and resuming continuations. Moreover, our primitive instructions are type-safe providing typed continuations which are well-aligned…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvancements in Photolithography Techniques · Software Testing and Debugging Techniques · Security and Verification in Computing
