WASI 0.3 Launched
WASI 0.3.0 is ratified and rebases WASI onto the Component Model's native async primitives. The canonical ABI gains `stream<T>`, `future<T>` and `async func`, which replace `wasi:io` pollables and streams. Scheduling moves to a single host-managed, completion-based event loop modeled on io_uring/IOCP, so async components can finally be composed with each other. Streams now return a separate error future, and `wasi:http` is reorganized into `service` and `middleware` worlds that allow in-process service chaining. Wasmtime 46 will enable WASI 0.3 by default, jco already supports it, and Rust and Go bindings illustrate idiomatic stackless and stackful async.
Related posts
- Introducing the WebAssembly JavaScript Promise Integration API
V8 mediumAdeptJSPI lets WebAssembly code written against synchronous APIs call asynchronous Web APIs. It intercepts Promises returned from wrapped JavaScript imports, suspends the Wasm computation, and resumes it from the browser's event loop when the Promise resolves. Wrapped exports return a Promise instead of a direct value. JSPI changes neither JavaScript nor Wasm, and suspend/resume costs are roughly constant: a deliberately bad Promise-based Fibonacci benchmark puts each JSPI'd call at about 1μs. The API is at phase 4 and ships in Chrome 137 and Firefox 139. Emscripten examples show `-s JSPI` with `EM_ASYNC_JS`, plus a trampoline pattern that lazily fetches and instantiates a Wasm module on first call.
- Why is WebAssembly a second-class language on the web?
Mozilla Hacks mediumAdeptWebAssembly remains second-class on the web because it can only load code and reach Web APIs through JavaScript. That forces arcane instantiation boilerplate, language-specific glue code from tools like wasm-bindgen and embind, JS-centric documentation, and real runtime overhead. A 2020 TodoMVC experiment with the Dodrio Rust framework found that removing JS glue cut DOM-update time by 45%. The esm-integration proposal, being implemented in Firefox, simplifies loading, and the WebAssembly Component Model with WIT interfaces is proposed as a standardized artifact that could let Wasm call Web APIs directly with no JavaScript in between.
- WebAssembly JSPI has a new API
V8 mediumAdeptWebAssembly JavaScript Promise Integration (JSPI) ships a revised API in Chrome M126 that drops explicit Suspender objects and instead uses the most recent JS-to-Wasm export call as the suspension cut point. The new API consists of WebAssembly.promising() to wrap exports and a WebAssembly.Suspending constructor to mark imports, removing the dependency on the Type Reflection proposal. Suspending imports now only suspend when the JS function actually returns a Promise, which avoids unnecessary event-loop trips. Emscripten 3.1.61+ users need no code changes, the old API is removed after Chrome M128, and V8 is working on growable (segmented) stacks so that millions of suspended coroutines become feasible.
- Bringing Goodnotes to the web with Swift and WebAssembly
Swift.org mediumAdeptGoodnotes runs the same Swift code behind its iPad app in browsers by compiling it to WebAssembly with SwiftWasm, sharing 1.47M lines (66% of the 2.2M-line web codebase) including a rendering engine that targets Metal on iOS and WebGL on the web. The port required replacing libdispatch with Swift Concurrency, fixing code that assumed a 64-bit Int on wasm32, and abstracting I/O through dependency injection. WASI threads with Web Workers and SharedArrayBuffer, plus custom actor executors (SE-0392) that pin actors to specific workers, more than doubled INP but require cross-origin isolation. The roughly 50 MB binary (12 MB with Brotli) is cached with Service Workers, and Chrome DevTools debugging and a custom wasm-memprof heap profiler make the tooling workable. The WebAssembly support is upstreamed as of Swift 6.2.
- What's coming to JavaScript
Deno mediumAdeptTC39's 108th meeting advanced nine JavaScript proposals. Explicit Resource Management (`using`/`await using` with `Symbol.dispose`), `Array.fromAsync` and `Error.isError` reached stage 4, and Immutable `ArrayBuffer` (`transferToImmutable`, `sliceToImmutable`) reached stage 3. Earlier-stage proposals include seeded PRNGs, `Number.prototype.clamp`, `Intl.NumberFormat` trailing-zero control, a standard value-inspection format for diffs, and a `Random` namespace for sampling and shuffling. Each proposal comes with code examples and runtime support status, and Deno plans to use immutable buffers to avoid copies and disposable `AsyncContext.Variable` to simplify tracing spans.