Python 3.11 in the Web Browser

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • pyground

    Playground for running Python using WASM on data in the browser

    Yep, it’s all static with no server side and the Python all runs locally. The source is on GitHub: https://github.com/mcintyre94/pyground so you can run it locally or deploy it yourself if you’d like too

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • cpython

    The Python programming language (by tiran)

  • webappsec-subresource-integrity

    WebAppSec Subresource Integrity

    One proposed solution is checksums on CDN provided javascript:

    https://w3c.github.io/webappsec-subresource-integrity/

  • pyodide

    Pyodide is a Python distribution for the browser and Node.js based on WebAssembly

    Those interested in this should check out Pyodide[0]. It basically "just works" so long as the libraries you import are pure Python or are part of the core scientific stack (the Pyodide authors have done the work to manually port all the C code behind numpy, scipy, etc.).

    What I really wish for is for ~all Python packages to work in the browser without manual porting of the underlying C/Rust/etc. being needed, since a lot of the interesting and useful libraries aren't pure Python, and manual porting is non-trivial.

    I'm not sure what the best route to that future is, but I'm guessing it'd probably help if Python had a wasm runtime in its standard library[1], since then authors of libraries that use C/Rust/etc. might make cross-platform builds (perhaps by default).

    Regarding this Pycon speech, it seems that it's related to this entry in the 3.11 changelog[2], which the speaker was heavily involved with:

    > CPython now has experimental support for cross compiling to WebAssembly platform wasm32-emscripten. The effort is inspired by previous work like Pyodide. (Contributed by Christian Heimes and Ethan Smith in bpo-40280[3])

    [0] https://github.com/pyodide/pyodide

    [1] https://discuss.python.org/t/add-a-webassembly-wasm-runtime/...

    [2] https://docs.python.org/3.11/whatsnew/3.11.html

    [3] https://bugs.python.org/issue40280

  • skulpt

    Skulpt is a Javascript implementation of the Python programming language (by blockpy-edu)

    MatPlotLib support in Skulpt for BlockPy [1]. Not complete, but workable for a lot of common graphs that I use in my CS1 course.

    [1]: https://github.com/blockpy-edu/skulpt/blob/master/src/lib/ma...

  • mma

    MMA - Musical MIDI Accompaniment. This is a mirror of the original author's code drops.

    Can someone explain to me, really slowly please, how to take an existing Python codebase such as https://github.com/infojunkie/mma and run it in the browser using one of the technologies mentioned in this thread? Especially, how to deal with filesystem calls that expect some files to be present in various folders. Thanks!

  • wasmtime

    A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

  • wasm3

    🚀 A fast WebAssembly interpreter and the most universal WASM runtime

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Requiem for a Stringref

    4 projects | news.ycombinator.com | 19 Oct 2023
  • WebAssembly: byte-code of the future

    3 projects | dev.to | 14 Aug 2023
  • Questions about pygame

    1 project | /r/pygame | 15 May 2023
  • WebAssembly: Adding Python Support to WASM Language Runtimes

    9 projects | news.ycombinator.com | 31 Jan 2023
  • Wasi-JS: a JavaScript library for interacting with WASI Modules

    1 project | news.ycombinator.com | 29 Jan 2023

Did you konow that Python is
the 2nd most popular programming language
based on number of metions?