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.
Metadata
Release files for wasmer-compiler-cranelift-py310 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| wasmer_compiler_cranelift_py310-1.0.0-cp310-none-win_amd64.whl | CPython 3.10 | none | Windows x86-64 | Details |
| wasmer_compiler_cranelift_py310-1.0.0-cp310-cp310-manylinux_2_27_x86_64.whl | CPython 3.10 | CPython 3.10 | Linux glibc 2.27+ x86-64 | Details |
| wasmer_compiler_cranelift_py310-1.0.0-cp310-cp310-macosx_10_7_x86_64.whl | CPython 3.10 | CPython 3.10 | macOS 10.7+ x86-64 | Details |
Total release size: 4.4 MB
Release files / wasmer_compiler_cranelift_py310-1.0.0-cp310-none-win_amd64.whl
| Download URL | wasmer_compiler_cranelift_py310-1.0.0-cp310-none-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
87993e4b43ef7ca69c7fc15ed4195e7561a77883db79907c51046056f0b80604
|
|
BLAKE2b-256 checksum How to use checksums |
325c66a31ec4744a89ffcd1e37c3f5650daa39b5be11448d064bc7104eae5090
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4
|
Release files / wasmer_compiler_cranelift_py310-1.0.0-cp310-cp310-manylinux_2_27_x86_64.whl
| Download URL | wasmer_compiler_cranelift_py310-1.0.0-cp310-cp310-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 |
|
SHA-256 checksum How to use checksums |
8dc55d6f6b8debf042d97502652e5048591311813f2db0e50d3b6ba47a21813a
|
|
BLAKE2b-256 checksum How to use checksums |
01386ac2e38f36868c31a417ff5d02ca6dc5606774c110a99aa055859229e5f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4
|
Release files / wasmer_compiler_cranelift_py310-1.0.0-cp310-cp310-macosx_10_7_x86_64.whl
| Download URL | wasmer_compiler_cranelift_py310-1.0.0-cp310-cp310-macosx_10_7_x86_64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.10 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
db21a81e768f3159168f7fcaf466efb09b1748d8cc821cd1062a778e11d5f5bd
|
|
BLAKE2b-256 checksum How to use checksums |
69498ca8373aa307e21861c4b9871a688a4232d3f8a57e818f1cc8761d529a37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4
|