Skip to main content

Python extension to run WebAssembly binaries

Project description

Wasmer logo Wasmer Python 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/.

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

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_beta1-cp39-cp39-macosx_10_7_x86_64.whl (563.3 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

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

Uploaded CPython 3.8 macOS 10.7+ x86-64

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

Uploaded CPython 3.7m macOS 10.7+ x86-64

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

Uploaded CPython 3.6m macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.0.0_beta1-cp35-cp35m-macosx_10_7_x86_64.whl (563.5 kB view details)

Uploaded CPython 3.5m macOS 10.7+ x86-64

File details

Details for the file wasmer_compiler_singlepass-1.0.0_beta1-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3ca15b3731975e447113506c3d46d7a49149950143cf40cdde3451e3bd85f60e
MD5 701d01757fc7c4585ecc872588858682
BLAKE2b-256 993c773bafaf53e7a8b91eaa7a71c7c6a17fec04b7f30670ba62573967a3db9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 7518dce87450cfa56489d134fc0ab8dafdff013fe648c4537bebb3483ee2de14
MD5 620ed55999a5c6bc7382fb240fa0095e
BLAKE2b-256 c0215573e61cb9e4f026221aa046e698bc0e2e919e34fe5c00526d4089e16613

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.0.0_beta1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 055edee5d88a0f085b6333d8666801d8185d7fd43bb77aabe45127decc2d2eb1
MD5 9d65a2969ed4f65fc764253516805015
BLAKE2b-256 5c392a52661113ab2044902791c1400464a0fe859a63998f511d2e2054cf86e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9043903ffdd6291ad596c8d4fe3ac2770e4fcae5d21ab63770f28d7659da14ea
MD5 6e3059fafb95024e38fe960b43783015
BLAKE2b-256 9294d5e1aebdfc57d322fda652238fe585f0b2a4c93ccaf241463d67daee3060

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.0.0_beta1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f217cc4ae5a9e88c583ca6a0b346b58ddb73b359605ebd7efcc6f6011449efa0
MD5 2b61ad7e7cc27d120d213c1e453f76f3
BLAKE2b-256 414c9f274bbd947459f1811669e51e8ddd2aec908aa951eb3dac467a1c080752

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 1e097a2a7bb503291b81ee5ea90c18f0665c160ddfd940e544b7849ab747603b
MD5 2a5a2973ece262e5c70cbbcd33f64749
BLAKE2b-256 39d3df0269be51ff1eec71ef070caa2c6948a2d9a961bcce835e1030a2bdebab

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.0.0_beta1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c83af732ee2a05479c9e9c9570da4cdb20baa87c8e602e1e4b28601ef64861f3
MD5 b6194e1cdea65ab592a0874d511b7dfd
BLAKE2b-256 dde6229b674a33cd6e8a5f053c0905c038471f9b26730e62a7c0334ace7c95d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 6b82b96c328dd36b612637fb2c0e1edcf2dea75dc74192aa480b8282d974fc63
MD5 b3a0db1ee317c2f2abe3d6dfef6155de
BLAKE2b-256 37bfc1995e2f4627d7dafa10efb57186b8e439015731308142ba7c333e6ae584

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.0.0_beta1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0c38849c9038568c204fef0453e5906bd7be9e78db1766fe855d89d32d78e450
MD5 e8d1feb6b3573550a839543181322339
BLAKE2b-256 99ccf91c8d294cf9b7953fc0114a3949e59e4a3f6d1debad24ef1e7e8e7a969d

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.0.0_beta1-cp35-cp35m-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.0.0_beta1-cp35-cp35m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 6451f4c236627406d89355ac15e3553d02e462a4d0f085c3cde751ccd026651e
MD5 667399ee7505e09edb976c4781c9bf96
BLAKE2b-256 ac9abc80e725c34843b1ca276a2942872416095f3915b8ddaafa1ae2b008b44b

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