Stack Switching in WebAssembly with Effect Handlers
WebAssembly is a low-level portable compilation target intended for a variety of programming languages. However, presently, WebAssembly is missing support for efficient compilation of non-local control flow features such as async/await, yield-style generators, lightweight threads, first-class continuations, and so forth. This means source languages with such features have to resort to ceremonious whole program transformations such a continuation-passing style to target WebAssembly. To address this disparity, we present a bespoke instruction set extension based on effect handlers known as WasmFX, where we model stacks as continuations. This extension is minimal as it adds only three main instructions for creating, suspending, and resuming continuations. Moreover, our primitive instructions are type-safe providing typed continuations which synergises well with the stack typing of WebAssembly. This talk will cover the design principles behind WasmFX, demonstrate some of the applications enabled by WasmFX, and discuss potential future extensions of WasmFX.
Mon 15 JanDisplayed time zone: London change
11:00 - 12:30 | |||
11:00 45mTalk | RichWasm: Bringing Safe, Fine-Grained, Shared Memory Interoperability to WebAssembly WAW Amal Ahmed Northeastern University, USA | ||
11:45 45mTalk | Stack Switching in WebAssembly with Effect Handlers WAW Daniel Hillerström Huawei Zurich Research Center |