Skip to content

SYSTEM Cited by 1 source

Pyodide

Pyodide is a distribution of CPython compiled to WebAssembly (via the Emscripten toolchain), letting Python — and a large slice of the scientific/PyPI package ecosystem — run inside browsers and other Wasm hosts without a native Python installation. It is open-source and community-run.

Role on this wiki

Canonical system for running Python inside a Wasm sandbox at the edge. When Cloudflare made Python Workers GA (2026-09-21), the underlying mechanism was a Pyodide interpreter compiled to Wasm and embedded in the Workers runtime — the same runtime that hosts JavaScript/TypeScript — so a Python Worker is CPython-on-Wasm, not native CPython (Source: sources/2026-09-21-cloudflare-python-workers-are-now-generally-available).

Why Pyodide (Cloudflare's choice)

  • Reuses an existing Python-on-Wasm platform. Because Workers already supported Wasm since 2018, Pyodide gave Cloudflare a fast path to "quickly support a wide range of Python applications" without building a Python runtime from scratch.
  • Community alignment over a private fork. Rather than build packages usable only in Python Workers, Cloudflare deliberately evolved the ecosystem "in a way that benefits Pyodide and the entire Python-on-WebAssembly community" — an upstream-the-standard stance.

PyEmscripten / PEP 783

Packages with native C/C++/Rust extensions must be cross-compiled to Wasm to run under Pyodide. Historically there was no standard for this, forcing Cloudflare to hand-compile and host custom Wasm wheels (limiting the usable package set). To fix it broadly, Cloudflare proposed and landed PEP 783, standardizing the PyEmscripten platform so maintainers build/publish once for every PyEmscripten-implementing environment. Cloudflare also stabilized the Pyodide build toolchain and added PyEmscripten support to cibuildwheel.

Constraints it inherits from Wasm

Running inside a Wasm sandbox means no ambient OS networking: stdlib socket POSIX syscalls are stubbed-to-fail. Cloudflare works around this in Python Workers with a socket-syscall shim over the Workers connect() TCP API (enabling drivers like aiomysql/asyncpg and thus Hyperdrive) and by routing HTTP clients (requests/httpx) through the JS fetch API — see the source page for detail.

Last updated · 766 distilled / 2,225 read