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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file wasmfunc-0.0.1.tar.gz.

File metadata

  • Download URL: wasmfunc-0.0.1.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for wasmfunc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 03f23f889c33abdb3ad64c10b9c8786467d429d5f809134bda1c9f19f7c08298
MD5 4429ebaae0e2364868161ba7c72caa3e
BLAKE2b-256 ea21ef69dd781f3c11f465227451364e6598d64a90e3d380df5646e7cd59b0a8

See more details on using hashes here.

File details

Details for the file wasmfunc-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: wasmfunc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for wasmfunc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b20288df7d92b1761e7d44d3269d88c622931db6d45a8ffa43a77ebd7378dc52
MD5 0ac2b8e14ccce8c801bd487b11228736
BLAKE2b-256 358f8debc2fa16db41f2f1de5d1f2c075d5bbb4d0ad30ca2d0d271c689f4a003

See more details on using hashes here.

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