Porting Python to WebAssembly
summary
CPython gains upstream WebAssembly support in 3.11 with Python 3.11 adds Emscripten and WASI support, a bootstrap interpreter and a Deep‑Frozen standard library compiled into C, an automation script to build and open a browser REPL, and a Node-based test harness that spawns processes. Most tests run; by April 2022 the build passes with 92 network tests skipped (sandboxing limits). Workarounds include autoconf checks for missing pthreads and socket APIs and fixes for strict WASM call‑signature crashes.
AI-written summary · about
chapters (15)
- 0:00Intro
- 2:11CPython implementation
- 4:18Build system
- 5:56Cross compiling improvements
- 10:05Invalid assumptions
- 10:47Bugs in Python
- 12:03Bugs in Emscripten
- 12:43Improving Emscripten
- 13:41Tier 3 support (PEP 11)
- 14:59Build automation
- 15:41Unofficial builds & nightly smoke tests
- 16:11WASI challenges
- 18:40Executable docs and examples
- 20:52Python binary extension hell
- 23:15Use Python as smoke tests
related talks
29mWhat can't WebAssembly do?
02h 47mA Pythonista's Introductory Guide to Web Assembly
45mHow to run Python in the browser
28mWebAssembly: Of Portability, and Performance
31mThe CPU in your browser: WebAssembly demystified
30mWASM in your wheel?
53mWebAssembly
35mWebAssembly: now web is a new compiler target architecture
