logoalt Hacker News

simonwtoday at 4:36 AM2 repliesview on HN

Pyodide is one of the hidden gems of the Python ecosystem. It's SO good at what it does, and it's nearly 8 years old now so it's pretty mature.

I love using Pyodide to build web UIs for trying out new Python libraries. Here's one I built a few weeks ago to exercise my pure-Python SQLite AST parser, for example: https://tools.simonwillison.net/sqlite-ast

It's also pretty easy[1] to get C or Rust libraries that have Python bindings compiled to a WebAssembly wheel that Pyodide can then load.

Here's a bit of a nutty example - the new Monty Python-like sandbox library (written in Rust) compiled to WASM and then loaded in Pyodide in the browser: https://simonw.github.io/research/monty-wasm-pyodide/pyodide...

[1] OK, Claude Code knows how to do it.


Replies

VagabundoPtoday at 8:28 AM

The who python web feels underused to be honest.

Maybe if browsers start shipping or downloading WASMs for python and others on request. And storing them for all sites going forward. Similar to how uv does it for for venvs it creates, there are standalone python version blobs.

iamcreasytoday at 4:59 AM

How do you call those C/Rust libraries compiled from to webassembly from Python/Pyodide?

show 1 reply