No free lunch: Limits of WASM as a bridge from Rust to JS
summary
A Rust language parser is compiled with wasm-bindgen and executed in Node.js to test the bridge: CPU-bound Rust can be up to 50× faster, but practical limits appear — panics become obfuscated runtime errors, stdout/stderr and panic unwinding are lost without ad hoc JS shims, many structs (vectors, non-C enums, lifetimes, String ownership) refuse automatic serialization, and WASI I/O gaps remain; tsify and serde mitigate typing but add macros, unsafe glue, and fragility.
AI-written summary · about
chapters (5)
- 0:00Start
- 1:42Establishing expectations
- 3:29Serialization: Strings (1/2)
- 5:05Serialization: Lifetime (4/4)
- 10:12Serialization: Enums (ADTs)
related talks
20mUsing Rust and WASM
30mRust in the Browser for Javascripters:New Frontiers,New Possibilities
43mDo things blazingly fast with WebAssembly
28mPowering Up NodeJS Performance by Rust and WebAssembly
30mImproving web app with Rust and WASM
44mOut of the JavaScript Box: Front-End Rust Programming
46mA State Of WebAssembly - The Browser is now a real VM
32mBringing WebAssembly outside the web with WASI
