Need help?
<- Back

Comments (24)

  • simonw
    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'>
  • 12_throw_away
    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.)
  • njoyablpnting
    Pyodide is great. I teach coding to kids, mostly creating 2d games with Python, and it was always a pain to manage an environment for each student. Now I have a browser based environment that runs Pygame/Arcade/Pyglet in Pyodide, so the kids can just do everything in the browser, I don't have to worry about Python versions, OS differences, files, etc. As a bonus they can easily publish what they make since it all runs in browser.They haven't made anything too crazy, but performance is surprisingly good, even wiring in Pymunk for some physics stuff. If they get to the point where it's ever an issue they probably know enough to be working in a real game engine anyway.
  • zek
    I've been working on a server-side wasm impl of cpython called boomslang [1] and have been thinking a lot lately about packaging, one of the downsides of my current impl is the need to statically link all c/rust extensions. Its too bad IMO how much of the wasm ecosystem targets/depends on emscripten directly. It'd be interesting to see if a more generic ABI could be provided for non emscripten/js based wasm runtimes.[1] https://github.com/HubSpot/boomslang
  • willXare
    Python in the browser keeps sounding ridiculous right up until it works.
  • wolfgangK
    I presume this works (will work) also for JupyterLite that is based on Pyodide ? Would be great if it helped getting the latest OpenCV-python version [0] and it's dnn goodies being available on a zero-install client side Notebook ![0] https://news.ycombinator.com/item?id=48421858
  • fzumstein
    Pyodide 314.0 is already available in xlwings Lite (the Python in Excel alternative you actually wanted).
  • efromvt
    Fantastic to have PyO3/Maturin guides too - the rust/python/typescript turducken I’ve always wanted.
  • runningmike
    Great news. And indeed a nice step to an even broader Python ecosystem.
  • sgammon
    nice to see JS/python interop becoming a thing
  • agrijakhetarpal
    [flagged]