wasm-rust
Installation
SKILL.md
Rust + WebAssembly
Run near-native Rust in the browser. WASM wins for compute-heavy, long-running work — not for DOM-bound or trivial tasks where the JS↔WASM boundary cost dominates.
When WASM is worth it
- ✅ Heavy number crunching: image/audio/video processing, physics, simulation, compression, crypto, parsers, geometry.
- ✅ Workloads that run for milliseconds+ per call and touch large typed-array buffers.
- ✅ Code you want to share with a native/Rust backend.
- ❌ Small/occasional ops where boundary marshaling > the compute saved.
- ❌ DOM-heavy logic (WASM can't touch the DOM directly; it calls back into JS).
Rule of thumb: fewer, bigger calls beat many tiny calls.
Toolchain
rustup target add wasm32-unknown-unknown
cargo install wasm-pack # bundles wasm + JS glue + TS types