Skip to main content

The Cranelift compiler for the `wasmer` package (to compile WebAssembly module)

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_cranelift provides the Cranelift compiler to wasmer, so that wasmer is able to compile WebAssembly module.

Other compilers exist:

  • wasmer_compiler_llvm,
  • wasmer_compiler_singlepass.

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_cranelift

Usage

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

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

# Let's use the Cranelift 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-cranelift followed by just doc to generate the documentation inside docs/api/wasmer_compiler_cranelift.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_cranelift-1.0.0_beta1-cp39-cp39-macosx_10_7_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_beta1-cp38-cp38-macosx_10_7_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_beta1-cp37-cp37m-macosx_10_7_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_beta1-cp36-cp36m-macosx_10_7_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_beta1-cp35-cp35m-macosx_10_7_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.5m macOS 10.7+ x86-64

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d6d069ace5133b3fc84679609acd96a1a0df390ee56281bbefc17325ac318914
MD5 f05aa549f0fb739b7c33d2dc3c0fea91
BLAKE2b-256 67e4d6b3afc1191dab0aafd2eda05f87660a71ae9ccdc4aff9836cdbbe9e6888

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f685391eb94fd2a4ce3bb7ddb032b66f25ecce66c9f724263ea07fb350d17b59
MD5 4d710bb7f4e6b8d253f03a4c28438c47
BLAKE2b-256 631e16b2801ed3add4edba15a253b8e82929fa2581c22bd4c0dc49e131556d76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5443c5188a2b8bcb3dc53685f9a5d035fb51dc57974ecf34d31ccf43886b7903
MD5 43ddd1be4d82ab6fda712e0757691fbb
BLAKE2b-256 c3a9e5fb27ef3b700e8c2193c9dcd5be387c64eb92b8e47b627da64747bfb017

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 75107013ee3535cb7416a2aa62c0e3342e2bc944b5524abc41b1e684f45492c7
MD5 9dcf7431b428481199593ae64adcdf51
BLAKE2b-256 ff9a24fc5fde9614819eba92c42e242b486f5dde5b2aabee1b13eaf823521c86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e6b527f8354673746b8fd0028a349f5719eb202c6178544855665271a0a9dfdd
MD5 2477b20bc22a1c91a02747f56c1b9713
BLAKE2b-256 6b6958531053a1257473700d207964f9aaedc4ae59cd237619a70a74305901fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8655a83159a995e1f030163e56f053dee3e6d84964252b1c929e3cbd621ccd96
MD5 562324b20103c99f4f6f531ff4b8b311
BLAKE2b-256 d09392134f4fa3ebc223e49b20087750c746b665a51fc7ee1c2ee8f01d5a5dd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e186539b9a217ff099dbfc59e8410a1f9f6e31e06f90163750ef5614a96effda
MD5 cfaf65ebff6e95377bc18dbbbbf5e467
BLAKE2b-256 bccfe8b0f3958eaad760f18742150082b6b357a194b02fced0092306b3f6ed22

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 00c5ee8bf613e8d337e4512bd0be325c0d6f23cf0ac00891c0b4d30bd3717951
MD5 756145792e77afc47e18fc9fdfcbb56e
BLAKE2b-256 c326fe6d16296a977b7f908f2536fb5cceb5b1e96c61f195427659aff68d1970

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 40a873071a20c20a18aa6988ae3e11c2d36751bd3d0d99e5b7165bf3433aeba5
MD5 dfb5ea274d0dc49164381ed82a88fa85
BLAKE2b-256 d2ed851457fb6de9efb41b426db9db5d364a70b97f53154a2c072e0c801b1517

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_beta1-cp35-cp35m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 20bb5a288981ad224553271923b1bb42781ec8facc776662d36628d185ab017a
MD5 f8d294d3008f6efc5bb3828bff865750
BLAKE2b-256 5fb7f8d645e760649c3c52171e891b9666ee5f0dc9757ea6b83e913ddbc3d035

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