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.1a2.tar.gz
(25.1 kB
view hashes)
Built Distribution
wasmfunc-0.0.1a2-py3-none-any.whl
(24.8 kB
view hashes)
Close
Hashes for wasmfunc-0.0.1a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d167c17bfa8a97cd8e36c52280ab720345f0a1af1691805adbd18ae2f21e5c2d |
|
MD5 | 27f36d858ca933ccaf413dfe6f698a7e |
|
BLAKE2b-256 | 1f82f3ceba3d3cb8ed1d3018fab53e5a2add6a1c8758957b6977a6c55da26f04 |