Pyodide 314.0: Python packages can now publish WebAssembly wheels to PyPI
agriyakhetar
·
2026-06-09
·
via HN's home page
 | |
I've been looking forward to this for ages! This means we can now take any C/Rust/whatever extension for Python, compile that as a `.wasm` extension, and then load it directly in browser Pyodide projects using: await micropip.install("package-on-pypi")
import package_name
Here's how to try the new feature out. Visit https://pyodide.org/en/stable/console.html and type: import micropip
await micropip.install("pydantic_core")
import pydantic_core
That gets you this WASM wheel: https://pypi.org/project/pydantic_core/#pydantic_core-2.47.0... You can tell that it's got compiled code in (and not just Python) by running: pydantic_core._pydantic_core
I get this: <module 'pydantic_core._pydantic_core' from '/lib/python3.14/site-packages/pydantic_core/_pydantic_core.cpython-314-wasm32-emscripten.so'>
|
 | |
`await micropip.install()` is starting to feel dangerously close to "just ship the whole universe to the browser." |
 | |
Executing normal python programs inside a cpython vm inside a wasm context inside a javascript process inside a sandbox inside a browser is - genuinely - extremely exciting! (Might as well run the browser inside a container inside a VM while you're at it though.) |
 | |
This sounds like a solution looking for an unnecessary security nightmare. Something as little as the runtime can just get exploited (which that as happened.) and cause a sandbox escape on the client side. There was a Chrome 0day at the runtime level which allowed untrusted code to run and escape the sandbox in the WASM runtime. This complete worship of WASM (and their runtimes) as this magical silver bullet reminds me of the days and failures of Native Client (NaCL), Java Applets and Flash all over again. |
 | |
Yeah it should definitely work there, anything you can `micropip.install()` into a Pyodide environment will work with JupyterLite. |
 | |
Pyodide 314.0 is already available in xlwings Lite (the Python in Excel alternative you actually wanted). |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。