Skip to main content

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

Project description

Wasmer logo Wasmer Python, the Cranelift compiler 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/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


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

Uploaded CPython 3.10 Windows x86-64

wasmer_compiler_cranelift-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

wasmer_compiler_cranelift-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10 macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.1.0-cp39-none-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

wasmer_compiler_cranelift-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.1.0-cp38-none-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

wasmer_compiler_cranelift-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

wasmer_compiler_cranelift-1.1.0-cp38-cp38-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

wasmer_compiler_cranelift-1.1.0-cp37-none-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.7 Windows x86-64

wasmer_compiler_cranelift-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl (1.9 MB view details)

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

wasmer_compiler_cranelift-1.1.0-cp37-cp37m-macosx_10_7_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7m macOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: wasmer_compiler_cranelift-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_cranelift-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 200fea80609cfb088457327acf66d5aa61f4c4f66b5a71133ada960b534c7355
MD5 51bc0864519a20c82f6160db2395fbbb
BLAKE2b-256 28fa26489c8f25470a3d50994aac8ebeabb2ca7f88874a15e0e77272b3a912c4

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: wasmer_compiler_cranelift-1.1.0-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • 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_cranelift-1.1.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 bdf75af9ef082e6aeb752550f694273340ece970b65099e0746db0f972760d11
MD5 2d3e4b511ec766a88b4112d169745aa9
BLAKE2b-256 a146bf489a62c2f919ffcfce4b92c9d07e0257b14a1afd4fb122a7b64632c8ec

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 405546ee864ac158a4107f374dfbb1c8d6cfb189829bdcd13050143a4bd98f28
MD5 402f0c115339506fc371b573f3453b9f
BLAKE2b-256 749b1cb2c909ef82f464afed1cd799cfcae95063fc3233c5140819e4b4ceee54

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 9869910179f39696a020edc5689f7759257ac1cce569a7a0fcf340c59788baad
MD5 2465fdb19855751515504e10a38aa9ab
BLAKE2b-256 c5cfe0ac8ec0dde10716668819eb894edddd15cece14fcb4c26ee82ed3d1f65e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: wasmer_compiler_cranelift-1.1.0-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • 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_cranelift-1.1.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 32fe38614fccc933da77ee4372904a5fa9c12b859209a2e4048a8284c4c371f2
MD5 cbcc36d37dae588c69f02b44f70fd228
BLAKE2b-256 2737ef18f10d98055dfb992ffb8eafbdf19cedaf28e10037eeaa213760f0d138

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 2a4349b1ddd727bd46bc5ede741839dcfc5153c52f064a83998c4150d5d4a85c
MD5 d97614d36231239b617dc42b1bc66b48
BLAKE2b-256 22e227122079b440e06c19596e74819fd11b613823ba666005971ad42ebf6e8a

See more details on using hashes here.

Provenance

File details

Details for the file wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9697ae082317a56776df8ff7df8c922eac38488ef38d3478fe5f0ca144c185ab
MD5 e8c85a101dcdc01327e5619502d0ebb6
BLAKE2b-256 58d459f83cc93f9197792deada522f681b399317672c3cbb7220608b0bf1f56c

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ff25fc99ebafa04a6c271d08a90d17b927930e3019a2b333c7cfb48ba32c6f71
MD5 4baa8185e7633b90cfc6cdd3085c94c4
BLAKE2b-256 ca1d3939962967d69d6bb1ac9af5a9adc5e91de4e9175db3e4519efaa3089c33

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: wasmer_compiler_cranelift-1.1.0-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • 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_cranelift-1.1.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 157d87cbd1d04adbad55b50cb4bedc28e444caf74797fd96df17390667e58699
MD5 f0f195e4af27279aa5582558d6e8c5a7
BLAKE2b-256 b2209ce82e8304f2d7aea0cc20e5edff6bbcba0db25ced227eff785fe0659f8d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 bd03db5a916ead51b442c66acad38847dfe127cf90b2019b1680f1920c4f8d06
MD5 e9eea64d9d336e3f54544302b636ca97
BLAKE2b-256 cb21de4acefca40dc2577e122387924bc8ce3c6f64d852d84b3ae0ada2c3433b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 55a524985179f6b7b88ac973e8fac5a2574d3b125a966fba75fedd5a2525e484
MD5 8c931ac6063990854c13e2cdccfa79e8
BLAKE2b-256 a87817379b136986bde52436baec888cbabe9b4978d897e1f0e59d259e999f1e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: wasmer_compiler_cranelift-1.1.0-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • 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_cranelift-1.1.0-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 447285402e366a34667a674db70458c491acd6940b797c175c0b0027f48e64bb
MD5 402ed7d1b6b250cd20ef08bc7fe62e54
BLAKE2b-256 bb37f0310144b46a62d343e497b499b0d381a05504562958bc60261173ed4e40

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 ff7dd5bd69030b63521c24583bf0f5457cd2580237340b91ce35370f72a4a1cc
MD5 6b9e87fbcbad43853fac58f0c9d4d9a5
BLAKE2b-256 31f9e8715ea33f468b756a9584e5de2a0e6e2139c0ad8b840556e5738e00f033

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for wasmer_compiler_cranelift-1.1.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 7d9c782b7721789b16e303b7e70c59df370896dd62b77e2779e3a44b4e1aa20c
MD5 8a3882c135ee6ffb4fd28c34722c0c83
BLAKE2b-256 dde2764ec90a14af189bee0b074f0a561a5465ab858325f2211dfb3a43ccd849

See more details on using hashes here.

Provenance

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