A WebAssembly compiler for Python
Project description
wasmfunc
wasmfunc is a Python to WebAssembly Compiler built for converting a typed subset of python code to a compiled Wasm binary.
Installation
pip install wasmfunc
How to use
Annotate your python function with Wasm types
# fib.py
@wasmfunc()
def fib_recursive(n: i32) -> i32:
if n <= 1:
return n
else:
return fib_recursive(n - 1) + fib_recursive(n - 2)
Then compile with
wasmfunc fib.py
# Or python -m wasmfunc fib.py
For more examples see examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wasmfunc-0.0.1rc1.tar.gz
(25.1 kB
view hashes)
Built Distribution
Close
Hashes for wasmfunc-0.0.1rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da5cc84872b549d7592ef8492843538e14ec246cf3fb566309945774b779a5ed |
|
MD5 | 5d58368d2d199145d3e468ab7941a932 |
|
BLAKE2b-256 | 5cb08f61e44fa0784ae1deeb5c83b772dda598fd173a32f54c737baaa58d74d0 |