The Cranelift compiler for the `wasmer` package (to compile WebAssembly module)
Project description
Wasmer Python, the Cranelift compiler
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/wasmer_compiler_cranelift/.
Alternatively, run just build compiler-cranelift
followed by just doc
to generate the documentation inside
docs/api/wasmer_compiler_cranelift.html
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba0541e79ddf4fd4bfa93d507141b1f3fe51458e33ef6b0ca5be0da6bef4e0d8 |
|
MD5 | c1a96c1dfb9ba3ad385fe1afa549cc4a |
|
BLAKE2b-256 | 6c1e85df9cd00ff92af9f457eca611fbe59b9914c72f52b449f60ccf623e0030 |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ceef0e1c3f0cb9178077237e1007122324f0d841450b6cd0ee1df96438ed4da7 |
|
MD5 | 16cf7572f49efa18932f503f52dad8ed |
|
BLAKE2b-256 | f496307b9f4d1f1925e6658af809cf5f75b8df00ac54494b8a65618b3258d513 |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 749285060ccfb9ed27d9df71467e2e139d4f2b039126c5f15fbbbbb664138969 |
|
MD5 | 5fa0466f3743347b784b386760f49e99 |
|
BLAKE2b-256 | 71088edbb57fd510197f3fdc1cfca67fc3c79787c5c4407d05d1c77831620032 |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 465e50852041febdace6c0b86642295dc6b3e800aee658629504b7461d0d3726 |
|
MD5 | 11bfdab702671bc7b9a741b843ad8769 |
|
BLAKE2b-256 | b76d9523a43888a42b6a3101db7156ce14415a239b9d006c95c8fb672dd47bcd |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41c46c68468f9620cf9d7a93d093535dc06a831b6587437eb1e51c6bbea10c1b |
|
MD5 | a18d29bb8686650d8c15e2fba224d33b |
|
BLAKE2b-256 | 54e54bec581dd3b7c6d5a78eefda1e8dad8fde66592fa43f51862ae41a4b2bdf |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba15cec80aea1fa57a588c6d1c5102a1a779b486e1ce64aef50808fcc52e944 |
|
MD5 | 4ccbd15055057831e257c0a46a1b34ff |
|
BLAKE2b-256 | c09668983d87d9f20119f4d82b98f8956bbcb4522f7b9a24d8e3d2998773303d |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29c379d0543b0b5e7b32b11e743d7ad123d8de782e72e0658050b484101ac6a0 |
|
MD5 | 1005bea03e204cba668f872891e99032 |
|
BLAKE2b-256 | 48c671133bcc70ac7904b5f0ffe319795dc9ff4973ba177b887edad7f85dc3c9 |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01469aee216669dc5cfc6b28adfbc3a030b0aeb081992aa06416766b12f1ae0f |
|
MD5 | 4b2c441d780e2ec9fa6bda5923955923 |
|
BLAKE2b-256 | f5dfb10c1fe51806cbaeacb48c9458afbc66ad047ef01873b6e9dfd40d59bebf |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07f574c176ab27081958dfd4a5c033f11bccd2d8e66599d9b326a4ed05da1b9e |
|
MD5 | 7fcefc4307b88244dc2fd0cbfd20ee98 |
|
BLAKE2b-256 | fbdceb090d9e2dfbc6e04a4586e707b49223e417e9cbb1a9ca4aa1605463be2d |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ed97e892b50f8b0b3692ab3af98c819b49e31b6980b71aa33e5868173ec26d |
|
MD5 | ad5ca210bfd821d79d4d4e4f3c36c3e1 |
|
BLAKE2b-256 | 1f7e9bb9111e51ebdd64362666ba732cfa1f0d91faf5e260ffb8436cac7b0415 |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5626fb32659f30bd6ca250c8b4f72638b6866fa575f31dc979614d63f4f55844 |
|
MD5 | 86db851832e7f08c016e2deb73fc97d0 |
|
BLAKE2b-256 | 3b149289c1cc02e5644ec605c5a90da08e9bfca29ac1c9d80fcf3d1e4bd2586b |
Hashes for wasmer_compiler_cranelift-1.0.0_beta2-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47f73345fa8818cea58c23aeb109db89b72f072dd94986cc300f6c1a294541b1 |
|
MD5 | 1c0c46073d7a7eae42d9cbb4fbe53127 |
|
BLAKE2b-256 | af620c509de8ace1f5b9251c69ea0b3bb544643e05f36ac98a5bba9721ff7d15 |