How to port a Python kernel to Pyodide for a blazingly fast in-browser coding...
summary
Claim: a Python kernel and notebook run entirely in the browser by porting to Pyodide and keeping a single codebase with only ~5% runtime-specific code. Kernel semantics move from processes/threads to an async event loop in a web worker; interrupts use a shared buffer via set interrupt buffer; installs use awaitable micropip.install. The deployed marimo playground serves ~50,000 Pyodide kernels/week (~2.5M yearly). Workarounds include Pyodide HTTP and Polars patches, a custom Pyodide build, custom lockfile, background dependency loading, and multiple web workers.
AI-written summary · about
chapters (21)
- 0:00Pyodide and Marimo intro
- 1:48Python in the browser
- 2:36Marimo demo in Pyodide
- 4:21Pyodide & WebAssembly terms
- 5:22Pyodide history
- 6:04Marimo’s Pyodide migration
- 7:47Kernel without processes
- 9:56Async event loop
- 10:59Fully async Pyodide
- 12:47Handling interrupts
- 14:11HTTP and package issues
- 15:14Native vs Pyodide Python
- 16:39Cross-runtime utilities
- 17:44Pyodide performance
- 20:55Migration takeaways
- 22:19Pyodide caveats
- 24:06Pyodide accessibility
- 25:12Q&A: Compatible packages
- 26:14Q&A: Python vs JavaScript
- 27:16Q&A: Signal handling
- 28:17Q&A: Private packages
related talks
41mPyodide: A Python distribution for the browser
31mIodide and Pyodide: Bringing Data Science...
45mThe marvelous world of Python in Browser: a nice surprise
45mHow to run Python in the browser
30mNext Level Python Applications with PyScript
39mJupyterLite: run all your code in a web browser using WebAssembly
39mPyScript - Python in the Browser
33mPython in the browser
