Debugging WebAssembly? Put some Whamm on it!

📅 2025-04-28
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
WebAssembly debugging and monitoring face three key challenges: tool fragmentation, high overhead from generic instrumentation frameworks, and the labor-intensive development of low-level, high-performance probes. This paper introduces Whamm—the first declarative instrumentation DSL tailored for WebAssembly—unifying bytecode rewriting and engine-internal support to jointly optimize abstraction and performance. Its core contributions are: (1) a programming model based on declarative matching rules, static/dynamic predicates, and automatic state reporting; and (2) deep integration with Wasm runtimes, enabling inline probes and intrinsification optimizations. Evaluated across diverse monitoring tasks, Whamm delivers expressive power comparable to manual implementations while achieving near-native performance, significantly reducing instrumentation overhead. It maintains compatibility with mainstream Wasm runtimes and supports seamless cross-platform deployment.

Technology Category

Application Category

📝 Abstract
Debugging and monitoring programs are integral to engineering and deploying software. Dynamic analyses monitor applications through source code or IR injection, machine code or bytecode rewriting, and virtual machine or direct hardware support. While these techniques are viable within their respective domains, common tooling across techniques is rare, leading to fragmentation of skills, duplicated efforts, and inconsistent feature support. We address this problem in the WebAssembly ecosystem with Whamm, a declarative instrumentation DSL for WebAssembly that abstracts above the instrumentation strategy, leveraging bytecode rewriting and engine support as available. Whamm solves three problems: 1) tooling fragmentation, 2) prohibitive instrumentation overhead of general-purpose frameworks, and 3) tedium of tailoring low-level high-performance mechanisms. Whamm provides fully-programmable instrumentation with declarative match rules, static and dynamic predication, automatic state reporting, and user library support, while achieving high performance through compiler and engine optimizations. At the back end, Whamm provides instrumentation to a Wasm engine as Wasm code, reusing existing engine optimizations and unlocking new ones, most notably intrinsification, to minimize overhead. In particular, explicitly requesting program state in match rules, rather than reflection, enables the engine to efficiently bundle arguments and even inline compiled probe logic. Whamm streamlines the tooling effort, as its bytecode-rewriting target can run instrumented programs everywhere, lowering fragmentation and advancing the state of the art for engine support. We evaluate Whamm with case studies of non-trivial monitors and show it is expressive, powerful, and efficient.
Problem

Research questions and friction points this paper is trying to address.

Addressing WebAssembly debugging and monitoring fragmentation
Reducing instrumentation overhead in general-purpose frameworks
Simplifying low-level high-performance mechanism customization
Innovation

Methods, ideas, or system contributions that make the work stand out.

Declarative instrumentation DSL for WebAssembly
Leverages bytecode rewriting and engine support
Enables high performance with compiler optimizations
🔎 Similar Papers
No similar papers found.
E
Elizabeth Gilbert
Carnegie Mellon University, USA
M
Matthew Schneider
Carnegie Mellon University, USA
Z
Zixi An
Carnegie Mellon University, USA
S
Suhas Thalanki
Carnegie Mellon University, USA
W
Wavid Bowman
Florida Institute for National Security, USA
A
Alexander Bai
Max Planck Institute for Software Systems, Germany
B
Ben L. Titzer
Carnegie Mellon University, USA
Heather Miller
Heather Miller
Carnegie Mellon University
Programming LanguagesDistributed ProgrammingParallel ProgrammingConcurrent Programming