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.

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_cranelift-1.0.0_alpha3-cp38-none-win_amd64.whl (917.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp38-cp38-macosx_10_7_x86_64.whl (894.3 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp37-none-win_amd64.whl (917.7 kB view details)

Uploaded CPython 3.7 Windows x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp37-cp37m-macosx_10_7_x86_64.whl (894.3 kB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp36-none-win_amd64.whl (917.9 kB view details)

Uploaded CPython 3.6 Windows x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp36-cp36m-macosx_10_7_x86_64.whl (894.4 kB view details)

Uploaded CPython 3.6m macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp35-none-win_amd64.whl (917.7 kB view details)

Uploaded CPython 3.5 Windows x86-64

wasmer_compiler_cranelift-1.0.0_alpha3-cp35-cp35m-macosx_10_7_x86_64.whl (894.1 kB view details)

Uploaded CPython 3.5m macOS 10.7+ x86-64

File details

Details for the file wasmer_compiler_cranelift-1.0.0_alpha3-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 06792eee7db1dcc42acef97546756c3049f2d2b8e009bcdb0dc04b83452c8ffe
MD5 4c9ea6b179b8ff627c7ee212b5cb4026
BLAKE2b-256 a0368acafe4798f7e0ba9575a89ea750ad72b67b98ddfbcc4094eced96f9f4fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 88b58dff1b9a5291d7840cb9a1e71c3be63b39da7935053c27bd4679b41f441b
MD5 9d8572e8061b76eae4ffc595f35f32b6
BLAKE2b-256 d2f8bec3883ee71dc483d84f4c04b907caa1b5744ea5ac4b7d67ebe7dadb02b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 0acc88b9eb3ae5a6dfb01841c1569b21ab5d9a471b3c50bfe87436da06073218
MD5 f719115d0ba9902e18610fc0f6a7f142
BLAKE2b-256 07eb4f08e3caed325aaeb6ede417d8f8a2a5cbcf551cc5432411a659850c0f98

See more details on using hashes here.

File details

Details for the file wasmer_compiler_cranelift-1.0.0_alpha3-cp37-none-win_amd64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 a36b791d1ac3385973485764958b11cc1f50a4a378d7be2e84f31d67c345a921
MD5 4bf7f3c7345f944b1c9989df27d36d77
BLAKE2b-256 39c105e9a13678786c8d870356b00f51f2bec9a5161e158526d60fa8d1f0c8a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fc83fdc6c9cbcc6ffe259eff54ce3c0ec858fa73924f9e5a96f98f262a5f4105
MD5 1b904c21bf578bf33755b14fb06bc6af
BLAKE2b-256 8c0129263cef983ed613bdec528660adf83cbcfcb9331c4608c6f177cf772e33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d7df3f3ab4d118ca1a7cf4321df2a7af38403a640f4ddbff55f918e4c0d4f35c
MD5 eda7083960f6e57ba12e5fd0634bfdd0
BLAKE2b-256 b876ac24b0bd53f684901a7cff82571208b6bd00773d0d300b869cedf20ffe56

See more details on using hashes here.

File details

Details for the file wasmer_compiler_cranelift-1.0.0_alpha3-cp36-none-win_amd64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp36-none-win_amd64.whl
Algorithm Hash digest
SHA256 b2df4133dbc7dace9c124453fbf551def28b8a5f8ba78c011996e67bca4de173
MD5 9b0986c0e84962185c34b9aec6b7a829
BLAKE2b-256 689bd08a1272f4ed25f2683032072d43e2a40fc5d538cf6d2022c9be19dd2e33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e9fb0edad9bb217912c6ae6cc3b490b7fba9df7baeb20e15a51ef9737e85b843
MD5 f1f324962e7fb0b8089545252aa1b2ef
BLAKE2b-256 a83385af21f40688bc9eec0eb41ae4863c9acf1cdf9cd6ef56270e3faf5c496c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 b19ceb7c32fac81077db7c44daa6a41f1ad820f249037bb61809cad4120ba966
MD5 4a5466b14111d2add6ea00ff532b9bb6
BLAKE2b-256 cf151527a2dbb1438d24a970ba7163df3302a6908eade16e75c902b661994ce7

See more details on using hashes here.

File details

Details for the file wasmer_compiler_cranelift-1.0.0_alpha3-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 590cf35b8d6990077138c4ce644551f799a3d4d42fd3ea6d268e782b8ebd0063
MD5 c0377b3158560d3c4f878811bb71a1be
BLAKE2b-256 1db04ebfb62774f8fa2b922a88133072d3626c3eba9e3a296875e82d4414a6aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1c094ae81ebb1d446ffbe8a79fffed15c8470cbbce087c436bcd2e1598918d98
MD5 b9c4ae0c1d672f11b25e92f797804195
BLAKE2b-256 d41710079664e8d65c90f710fd03a42a9620a111d2bcf3e91fdfd47aef556301

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.0.0_alpha3-cp35-cp35m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 52f7ec96923f3ef77c0db4ca610b7d71693cf0cfcadbcd338a9f138cd5a329db
MD5 612e04857024d3fff60d75dab655947c
BLAKE2b-256 073d4cb2860628dc9e618ee92c890d172c54a106a0688b61749fe2944f5aeca3

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