Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Mozilla Hacks 7 min read Release mediumAdept

Pyodide Spin Out and 0.17 Release

Pyodide, CPython 3.8 compiled to WebAssembly for running Python in the browser, has spun out of Mozilla into an independent, community-governed project, and Mozilla is winding down Iodide. The 0.17 release redesigns Python/JavaScript type translation so round trips return identical objects: only primitives convert implicitly, other objects are shared as proxies with explicit to_py/toJs/to_js converters. It also adds an asyncio event loop on the browser event loop with mutual awaiting of Promises and coroutines, and bidirectional exception translation. Migrating to upstream-LLVM Emscripten shrank SciPy from 92 MB to 15 MB and the base environment from 8.1 MB to 6.4 MB, with 25–30% faster runtime.

Related posts

  • Introducing the WebAssembly JavaScript Promise Integration API

    V8 mediumAdept

    JSPI 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.

  • Serverless Jupyter Notebooks at Meta

    Meta Engineering mediumAdept

    Meta's Bento notebook platform now runs "lite" workloads directly in the browser using Pyodide on WebAssembly, skipping the slow remote-compute reservation step. A kernel bridge lets the Pyodide kernel speak the Jupyter protocol like server kernels, a web worker keeps expensive kernel operations off the main thread, and middleware intercepts cell magics (%%sql, %%googlesheet, %%graphql, %%dataframe) in JavaScript and injects their results into the Python kernel. Uploads are handed off to async Tupperware jobs. The main limitation is that internal libraries not ported to Wasm are unavailable. Planned work includes auto-detecting lite workloads and falling back to server kernels when needed.

  • WebAssembly JSPI has a new API

    V8 mediumAdept

    WebAssembly 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.

  • Introducing Ruvy

    Shopify Engineering mediumAdept

    Ruvy is an open-source toolchain built on ruby.wasm that compiles Ruby scripts into WebAssembly modules, pre-initializing the Ruby VM and preloaded Ruby files at build time instead of at startup. Compared with ruby.wasm plus wasi-vfs, Ruvy modules instantiate and run about 20% faster (roughly 44 ms vs 56 ms in Wasmtime) and compile to native code with Cranelift about 70% faster (about 0.45 s vs 1.65 s). Because the script is embedded, Ruvy modules need no WASI arguments at runtime, which suits edge platforms that can't pass them. Ruvy is currently built from source, and contributions are invited, including Shopify Functions compatibility work.

  • Gradio-Lite: Serverless Gradio Running Entirely in Your Browser

    Hugging Face mediumAdept

    Gradio-Lite (@gradio/lite) is a JavaScript library that runs Python Gradio apps entirely in the browser using Pyodide, the WebAssembly build of CPython, so no server is needed. Apps are written in Python inside a <gradio-lite> HTML tag. Multi-file apps use <gradio-file> tags with an entrypoint, and extra dependencies are installed via micropip from a <gradio-requirements> block, for example transformers_js_py for in-browser sentiment classification. The main costs are a 5–15 second initial load while Pyodide downloads and the fact that only Pyodide-compatible packages work.

The quest for software engineering knowledge.

Look:
Layout: