Test CPython WebAssembly builds with Emscripten SDK and WASI SDK. Build artifacts are available from latest scheduled Emscripten nightly tests and WASI SDK nightly tests.
The project also provides unofficial builds of CPython for Emscripten and WASI.
See availability notes and WASM README.md for platform limitations.
The emsdk-tot-upstream builds are using Emscripte tip-of-tree (nightlies).
Python-3.11dev-wasm32-emscripten-3.1.24-browser: Python 3.11 branch, Emscripten SDK 3.1.24Python-3.11dev-wasm32-emscripten-3.1.24-browser-debug: Python 3.11 branch, Emscripten SDK 3.1.24, debug build with additional symbols and fewer optimizationsPython-3.11dev-wasm32-emscripten-3.1.24-browser: Python main branch (3.12), Emscripten SDK 3.1.24
The files must be served from a web server. You can use the
./wasm_webserver.py script to run a local web server and
access the browser REPL from http://localhost:8000/python.html
Python-3.11dev-wasm32-emscripten-3.1.24-node-dl: WASM dynamic linking, Python 3.11 branch, Emscripten SDK 3.1.24Python-3.11dev-wasm32-emscripten-3.1.24-node-dl-debug: WASM dynamic linking, Python 3.11 branch, Emscripten SDK 3.1.24, debug build with additional debug symbols and fewer optimizationsPython-3.12dev-wasm32-emscripten-3.1.24-node-dl: WASM dynamic linking, Python main branch (3.12), Emscripten SDK 3.1.24Python-3.11dev-wasm32-emscripten-3.1.24-node-pthreads: WASM pthreads emulation, Python 3.11 branch, Emscripten SDK 3.1.24Python-3.12dev-wasm32-emscripten-3.1.24-node-pthreads: WASM pthreads emulation, Python main branch (3.12), Emscripten SDK 3.1.24Python-3.12dev-wasm64-emscripten-tot-upstream-node: wasm64-emscripten (MEMORY64), Python main branch (3.12), Emscripten SDK tip-of-tree.
Run:
node python.jsYou may have to specify --experimental-wasm-bigint for older Node versions and
--experimental-wasm-threads --experimental-wasm-bulk-memory for pthread builds.
NOTE wasm64-emscripten is experimental and requires Node >= 16 and
--wasm-experimental-memory64 options.
Python-3.11dev-wasm32-wasi-16: Python 3.11 with WASI-SDK 16Python-3.12dev-wasm32-wasi-16: Python main branch (3.12-dev) with WASI-SDK 16
Run:
wasmtime run --dir . -- python.wasmNeeds a recent version of wasmtime.