Skip to main content

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 compile fib.py
# Or python -m wasmfunc compile fib.py

For more examples see examples.

Project details


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.1.tar.gz (25.4 kB view hashes)

Uploaded Source

Built Distribution

wasmfunc-0.0.1-py3-none-any.whl (24.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page