wasmtime-py
wasmtime-py | python-sandbox-wasm | |
---|---|---|
3 | 3 | |
366 | 20 | |
3.3% | - | |
7.6 | 4.0 | |
5 days ago | 3 months ago | |
Python | Python | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wasmtime-py
- another 4x to 5x speed up in calling #WASM #WebAssembly from python is on the horizon
-
WebAssembly: Adding Python Support to WASM Language Runtimes
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
-
WebAssembly: Adding Python Support to WASM Language Runtimes
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!
- New Project: Call Untrusted Python Code from Python inside a Web Assembly “Sandbox”
What are some alternatives?
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.
python-wasi - Utilities for building CPython for the WASI platform
pywasm3 - Python bindings for Wasm3, a fast WebAssembly interpreter and the most universal WASM runtime
wit-bindgen - A language binding generator for WebAssembly interface types
empack - Tools to pack a conda / mamba environment into a JS & WASM bundle
extism - The framework for building with WebAssembly (wasm). Easily load wasm modules, move data, call functions, and build extensible apps.
wasmer-python - 🐍🕸 WebAssembly runtime for Python