Skip to main content

Python extension to run WebAssembly binaries

Project description

Wasmer logo Wasmer Python, the Singlepass compiler PyPI version Wasmer Python Documentation Wasmer PyPI downloads Wasmer Slack Channel

wasmer is a complete and mature WebAssembly runtime for Python. wasmer_compiler_singlepass provides the Singlepass compiler to wasmer, so that wasmer is able to compile WebAssembly module.

Other compilers exist:

  • wasmer_compiler_cranelift,
  • wasmer_compiler_llvm.

To get a more complete view, please see the documentation of the wasmer package itself.

Install

This package must be used with the wasmer package, thus:

$ pip install wasmer
$ pip install wasmer_compiler_singlepass

Usage

Any engines in wasmer.engine can take the wasmer_compiler_singlepass.Compiler class as argument:

from wasmer import engine, Store, Module, Instance
from wasmer_compiler_singlepass import Compiler

# Let's use the Singlepass compiler with the JIT engine…
store = Store(engine.JIT(Compiler))

# … or with the native engine!
store = Store(engine.Native(Compiler))

# And now, compile the module.
module = Module(store, open('my_program.wasm', 'rb').read())

# Now it's compiled, let's instantiate it.
instance = Instance(module)

# And get fun, for example by calling the `sum` exported function!
print(instance.exports.sum(1, 2))

Documentation

Browse the documentation at https://wasmerio.github.io/wasmer-python/api/wasmer_compiler_singlepass/.

Alternatively, run just build compiler-singlepass followed by just doc to generate the documentation inside docs/api/wasmer_compiler_singlepass.html.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

wasmer_compiler_singlepass-1.0.0-cp39-none-win_amd64.whl (566.7 kB view details)

Uploaded CPython 3.9 Windows x86-64

wasmer_compiler_singlepass-1.0.0-cp39-cp39-manylinux2010_x86_64.whl (646.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

wasmer_compiler_singlepass-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl (579.6 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.0.0-cp38-none-win_amd64.whl (566.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

wasmer_compiler_singlepass-1.0.0-cp38-cp38-manylinux2010_x86_64.whl (646.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

wasmer_compiler_singlepass-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl (579.8 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.0.0-cp37-none-win_amd64.whl (566.5 kB view details)

Uploaded CPython 3.7 Windows x86-64

wasmer_compiler_singlepass-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl (646.6 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

wasmer_compiler_singlepass-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl (579.8 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.0.0-cp36-none-win_amd64.whl (566.6 kB view details)

Uploaded CPython 3.6 Windows x86-64

wasmer_compiler_singlepass-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl (646.5 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

wasmer_compiler_singlepass-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl (579.7 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

File details

Details for the file wasmer_compiler_singlepass-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: wasmer_compiler_singlepass-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d5c22551a8a297511be9d911308a8d763c1709ecbf3bfba3942457f8389cbc5
MD5 e323b1c950fcf6e3aba42a5d43518f5b
BLAKE2b-256 9e2f49fab7f480c8e42ae5c08fa152fdf2710618cf656f1f036e01fc3a26afb3

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp39-none-win_amd64.whl.

File metadata

  • Download URL: wasmer_compiler_singlepass-1.0.0-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 566.7 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 82cd6871b440c6e0f298c3a2ac9191a58da3fadbde876744fb18db43becbd70a
MD5 3e832f4db5c2b848b126e6972260ac3f
BLAKE2b-256 8eab0cc573787df79d031fdcd1c9d68e58aa78e1007284684143e72423fbd20c

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 98dfada2b2c20422d5668a5690c6bfdd78bfda4671ad05f18e1ad2e13c9a22f9
MD5 75a3242950814c8e03f67d969d361afb
BLAKE2b-256 7257360e2dc70409a0da93579abc3639398fb398bf9b359dee5c54a63f8ba919

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 cdc9743fb5d467e9720fc6f46db82dc3405b386a00ee04c313664e1c5c7a36f0
MD5 f20ee78dcb8d9be2b809d0782296a78c
BLAKE2b-256 65223012ae15ba1c8d3764449debae1eb6ab825c4668fd27e8fd4b6d87d8e932

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp38-none-win_amd64.whl.

File metadata

  • Download URL: wasmer_compiler_singlepass-1.0.0-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 566.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 83f1672c0efebbc267b31550ca88f563ae998636e0ca5e94496973b1d577aca2
MD5 72e8a5050bc1a5788745d173c2d2dbb4
BLAKE2b-256 102f157218ee89f115e45bb7222b55187b0f3ac66a1ff9444c67858ebaa211bd

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e35209ca6a7fbed46657729f5183f80a8075c9eb853e489232134cfb2e749002
MD5 c1ce92535355181ec46559f6a0284982
BLAKE2b-256 ac3f8fa0b054ff9beda06313e498f5c46e9bb82cdaead5de2a4b1bd2dc8f736d

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5386ecf0b6b48a27889a8cdab558a573cc4c729674e169b61bbc28f37f3f4146
MD5 7f885be5f8817e7a99650019dfe25fcc
BLAKE2b-256 48a8451f847d771aa510a4f2bd7713e78aaf0e680aa77202f1c612c1afa4c808

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp37-none-win_amd64.whl.

File metadata

  • Download URL: wasmer_compiler_singlepass-1.0.0-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 566.5 kB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 87ad3284ffe449fdf500062f2ec25e4a717e8c7b12cbabdec9436b2f2fa0d6e8
MD5 dc41e2db13c1e1e34800f8ec1e1622b5
BLAKE2b-256 a4241c021b42ff504f6edda0ecceacb20e28757972b4fb3e7d4a1267093c8497

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 0fc21c8e326129b747b903121e92c98c808981d8d43fd2ea7623433eac3bb464
MD5 ed4b050b82493f8f9ed5e4e3b4641766
BLAKE2b-256 f22aa05cabe72ab3bebb3c1c83143e3f1420f21e4517dcc59c88d896a45b0bf2

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 617dda920daf9785056ae295f10045a7676a276ed153218798066a733f931150
MD5 1a85492c4e0c9e0b034aff138a28be22
BLAKE2b-256 d6f6a9febf05a562224633b85921964e400a7e95986d2bf13229e6168635e0dc

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp36-none-win_amd64.whl.

File metadata

  • Download URL: wasmer_compiler_singlepass-1.0.0-cp36-none-win_amd64.whl
  • Upload date:
  • Size: 566.6 kB
  • Tags: CPython 3.6, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 777caea943e1e28d02879a18b8a46a87dded6524da47a76a13c5da954bc7eb8a
MD5 b2ba0be26df52b966f31631c76c89e99
BLAKE2b-256 797034928a2c79d61093641791294d639571bb3453ac6870ce3753f4c3a939de

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ca793b193fcc4d44b384693e052126c9860eb484b0e09291d0449a651543291a
MD5 26941a94250495620e96db80b6ff1e95
BLAKE2b-256 57b008ffdee5e8be58e20902156514d1f7710f5d9dfba367e4d2a3dd198b457a

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_singlepass-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d37d5f8eabf6b26af5d1b9fc952f6c4a653bd4ae9dbb3ca769a0578a86cc44fc
MD5 30f3fea4129392e214ef2c979bac22f1
BLAKE2b-256 ff0001151f5874e2831bd03daf73e28aee0f328434785f130142b18b47d70ae9

See more details on using hashes here.

Provenance

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