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.1.0-cp310-none-win_amd64.whl (539.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl (635.9 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl (574.4 kB view details)

Uploaded CPython 3.10 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.1.0-cp39-none-win_amd64.whl (538.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl (636.1 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl (574.6 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.1.0-cp38-none-win_amd64.whl (539.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl (635.7 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp38-cp38-macosx_10_7_x86_64.whl (574.4 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.1.0-cp37-none-win_amd64.whl (539.0 kB view details)

Uploaded CPython 3.7 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl (635.7 kB view details)

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

wasmer_compiler_singlepass-1.1.0-cp37-cp37m-macosx_10_7_x86_64.whl (574.5 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: wasmer_compiler_singlepass-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b323710db2c595d649b787d841cc38f5b4d8d353390225fedb765738f23ebe6f
MD5 80840d2fbaa9cff3090f41e70fd37f45
BLAKE2b-256 398ddda1b8f637845cc47c57362fa17cd7eaadc5d4b648abba3434d69e7edda0

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.1.0-cp310-none-win_amd64.whl.

File metadata

  • Download URL: wasmer_compiler_singlepass-1.1.0-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 539.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 ec567ac17f9296f4d61cc7c9936d00a042fe5fe7a51ce0bf7581f78d70dd6e68
MD5 e2ff6357f4d9450d1c4c9ded3981960a
BLAKE2b-256 d09536801deb030fcb25c54c8e70ae9fe147a3fcff5410f76ae8cf40d0325f46

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 6a5eacd1f92f9c5e4d2c3d90ed5a99bad4a6e8934c4e1b844609c493f5e1e3b8
MD5 1034f30166a5a6a38f1a60a90b5ec934
BLAKE2b-256 4e5d6b125a26e4922a6e059d2c4ee9f034aad38411b9d9e2c923bfb08971493b

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5fd7bfc7ac64e05b0452786f8c5e876e323f1cfc2530119a2178373707cc72bb
MD5 59c3372150582f8239b88f0c0ff96bd0
BLAKE2b-256 738d16e7acc708784e2e9c8ffb6d21a88a331c85c32d54456832f6ceadea4765

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmer_compiler_singlepass-1.1.0-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 538.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 1fd0dacb11bb0f38ad1cbbcfd619dbb56bbc094fefed3f41caf4661e58118892
MD5 2dbcdebfc67dcdd4eaf2900d3af394a9
BLAKE2b-256 32e77258ad655eb094400760bd29ddaa508d037a1f3c0de10efa726ef2980bef

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 a2e6ddb828577a64f828b2494e851579ec5df06359b32592ce4b3976a902691c
MD5 f8e0e080d219d9c7bdb487e91804994d
BLAKE2b-256 9890b06da4fd5b8ab5ef9766f98d8a17827b86faee575398025a87d55493caea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 45bf078e07053544c75b1e866d262e1970f362182da92a8b5ace127e58108137
MD5 a2ad5d89c3bc5156a29efde728bab607
BLAKE2b-256 dafaa0f227a8bd67ad04214b2645ef67381fe7f40e0aa37786daafb7dc288dcf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmer_compiler_singlepass-1.1.0-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 539.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 0ed07e261ae23f2e769ec314efd8eb3d6f1907b31856c3e0631b5b8b1cac3a10
MD5 50d1a8c383b8df2e885e8482d90f515b
BLAKE2b-256 1770b0cd26915c4706b67bc7961236fbd2eb5e8c8d27ce40d240bbb3e5ba32f0

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 5d1a60dc45bfb5a15b40070a24b34ffd09d457368fd2f1349bdb81c8bbb551e8
MD5 9d802f087d2163c92460f49ea6331c73
BLAKE2b-256 62320e04e04933063fa890469c415a6045ebc31a6d85edbd794878ee30961cc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 72362384b1f0ab2a44004cf9381f5445fed004821ddb1ee49d9f61113b566478
MD5 b8ed12d21f50ffcb5c340d6997812c6d
BLAKE2b-256 76f1ebbee7f39d7ba934bec113cd78e1e5d022d4918c0e179da07d26e2dce7dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wasmer_compiler_singlepass-1.1.0-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 539.0 kB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 a6ad96bd4602c94b87a87861749c34206ae623b296bb290482c654e42692a377
MD5 58df55f989a4e0440dec54c82ddb0755
BLAKE2b-256 82a9a3940a93f4c5234ac68bf2efe45935b2d3c5f99169da66b14a34bc7a6250

See more details on using hashes here.

File details

Details for the file wasmer_compiler_singlepass-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 d240a7c3dafcf134aa95e46c50b464e24c23d04136a38bf4501ac776a7c09714
MD5 172424bf15ba11d96be400139d68eadc
BLAKE2b-256 01c48c598d2b743b2d1bbeb3a028d93886573e20bfe8a51d00a270421c9692bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_singlepass-1.1.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 dc55c7fc87742f02b6879c313a916fbfadd55037163da876fb8f8f6789a52a1b
MD5 26d4b81f2b12ac536ae64bb9f0c10953
BLAKE2b-256 f1d7461f0d0448694d086b73a914f5f98b2ada67db81d91d7d0ea26cd3fd8db6

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