WebAssembly: Adding Python Support to WASM Language Runtimes

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

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • wasmtime-py

    Python WebAssembly runtime powered by Wasmtime

  • Wasmtime's `wasmtime-py` embedding in python has support for Wasm Components: https://github.com/bytecodealliance/wasmtime-py#components (disclosure, I helped create it)

    The remaining piece of the puzzle would be to create a wit-bindgen guest generator https://github.com/bytecodealliance/wit-bindgen#guests for this build of the python interpreter. You could then seamlessly call back and forth between the host and guest pythons, without even knowing that wasmtime is under the hood.

  • python-sandbox-wasm

  • I've not yet figured out the incantations I need to actually do this - in particular the limits on CPU and memory time.

    I posed this question on Mastodon recently and Jim Kring put together this demo, which gets most of the way there (albeit using an old Python 3.6 build): https://github.com/jimkring/python-sandbox-wasm

    It doesn't feel like this should be as hard to figure out as it is!

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • python-wasi

    Utilities for building CPython for the WASI platform

  • I have been following and playing with this repository: https://github.com/singlestore-labs/python-wasi/

    It builds a single Python WASM module with all dependencies included (they use VFS) and a Dockerfile to make the process easy (and actually worked first go). It does produce large files though: wasi-python3.11.wasm 110MB

  • wasmer-python

    🐍🕸 WebAssembly runtime for Python

  • PyOdide isn't currently supported outside of browsers, though that might change.

    Either way, I couldn't figure out how to do the above sequence of steps with any of the available Python WASM runtimes - they're all very under-documented at the moment, sadly. I tried all three of these:

    - https://github.com/wasmerio/wasmer-python

    - https://github.com/bytecodealliance/wasmtime-py

    - https://github.com/wasm3/pywasm3

  • pywasm3

    Python bindings for Wasm3, a fast WebAssembly interpreter and the most universal WASM runtime

  • PyOdide isn't currently supported outside of browsers, though that might change.

    Either way, I couldn't figure out how to do the above sequence of steps with any of the available Python WASM runtimes - they're all very under-documented at the moment, sadly. I tried all three of these:

    - https://github.com/wasmerio/wasmer-python

    - https://github.com/bytecodealliance/wasmtime-py

    - https://github.com/wasm3/pywasm3

  • wit-bindgen

    A language binding generator for WebAssembly interface types

  • Wasmtime's `wasmtime-py` embedding in python has support for Wasm Components: https://github.com/bytecodealliance/wasmtime-py#components (disclosure, I helped create it)

    The remaining piece of the puzzle would be to create a wit-bindgen guest generator https://github.com/bytecodealliance/wit-bindgen#guests for this build of the python interpreter. You could then seamlessly call back and forth between the host and guest pythons, without even knowing that wasmtime is under the hood.

  • nsjail

    A lightweight process isolation tool that utilizes Linux namespaces, cgroups, rlimits and seccomp-bpf syscall filters, leveraging the Kafel BPF language for enhanced security.

  • SaaSHub

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

    SaaSHub logo
  • extism

    The framework for building with WebAssembly (wasm). Easily load wasm modules, move data, call functions, and build extensible apps.

  • Oh, and here's an example (test) showing how to construct a "manifest" to control the cpu/memory limits: https://github.com/extism/extism/blob/main/python/tests/test...

    cpu is really controlled by # milliseconds until the wasm code is trapped.

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

  • Spin 2.0 – open-source tool for building and running WASM apps

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

    3 projects | dev.to | 14 Aug 2023
  • Using WASM for a plugin system in Rust? (generate code at runtime and then hot reloading it as a library)

    6 projects | /r/rust | 22 Feb 2023
  • Wasmtime Reaches 1.0: Fast, Safe and Production Ready!

    5 projects | /r/rust | 20 Sep 2022
  • Redesign Screeps in Rust

    2 projects | /r/rust | 18 Jun 2022