Hand-crafting WebAssembly
summary
Shows how to handwrite WAT, compile it with the WebAssembly Binary Toolkit (wat2wasm / wabt) and bundle to JS using wat2js; a handcrafted square module compiles to ~44 bytes and runs. Reports microbenchmarks showing ~20–30% speedup over V8-optimized JavaScript for simple math but near-C speed for crypto when using i64; explains linear memory, manual pointers and page sizing, loops via br/br_if and a simple parser+macro DSL that generates readable WAT. Implements sodium-universal primitives in production.
AI-written summary · about
