Python extension to run WebAssembly binaries
Project description
Wasmer Python, the LLVM compiler
wasmer
is a complete and mature WebAssembly runtime for
Python. wasmer_compiler_llvm
provides the LLVM compiler to wasmer
,
so that wasmer
is able to compile WebAssembly module.
Other compilers exist:
wasmer_compiler_cranelift
,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_llvm
Usage
Any engines in wasmer.engine
can take the
wasmer_compiler_llvm.Compiler
class as argument:
from wasmer import engine, Store, Module, Instance
from wasmer_compiler_llvm import Compiler
# Let's use the LLVM 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_llvm/.
Alternatively, run just build compiler-llvm
followed by just doc
to generate the documentation inside
docs/api/wasmer_compiler_llvm.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_llvm-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a6fafbae39018b878b872396f54700db08d8870ff3e30b41a6cf0fa3c01e41d |
|
MD5 | da8f65b354c3ce21d2e995b122bafc5a |
|
BLAKE2b-256 | 870aa008490efef932959adbdf0a31c387fdb66484021dc15582fefb3d590026 |
Hashes for wasmer_compiler_llvm-1.0.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d3325308855c3f3df2fc12403ddf33f5e0a8d51277c61ca96527fb57c5be401 |
|
MD5 | 26846ce15bbaa54a1ad101b862698a0a |
|
BLAKE2b-256 | e14a38c698786811555d11ad9054c8263b976f893d40ab8970041d8a1e71ba76 |
Hashes for wasmer_compiler_llvm-1.0.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38b0d2fedde121fdd240ea436305b32dff7a8915d10bbb8417fd1fba71dde215 |
|
MD5 | 0505a3ca1dd94cb281efd683fa44ba3f |
|
BLAKE2b-256 | e7529b22779f92b2b19cb5386fad216911506239cb7a4d2e501961251479b5f9 |
Hashes for wasmer_compiler_llvm-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 465c345e3d977c25d94c73b2485d4185ef30a819447fe6a5bcf2b74d01ac26c2 |
|
MD5 | 2da432be5c47452a2f6a0257346aeba4 |
|
BLAKE2b-256 | 6c1331a005c7e6211a6502706dad7a7ade4a81dc95a70c2d110ba21429ab08f0 |
Hashes for wasmer_compiler_llvm-1.0.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccc192f2c98ff7cdd8df820ca53fb1f2122fdb868288e8ffb0c1ba19cfa9655e |
|
MD5 | d3c9a2426275729ce193b72d238b381c |
|
BLAKE2b-256 | 76f822cde1df9ab69d7511c154a0b4aa89f78cbe0f5368de57783e610bd90ff3 |
Hashes for wasmer_compiler_llvm-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab046a7e0e1698773eb3b9b643f929b5b0c489d999337fa71e376cc6a51af33 |
|
MD5 | 2c827c3987eef69fb1ebed00213b3e20 |
|
BLAKE2b-256 | 7132202daaeac24142010e7c2c6756a882575a1087985c25c7a852e82eb6010e |
Hashes for wasmer_compiler_llvm-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7485e83a6416ac7908eb8fe011eec42336d544417fa17912b5690fdc36b66acf |
|
MD5 | c3072f112242c0a90b6cb2519499727d |
|
BLAKE2b-256 | 771599496fa42960afb9bbd29341fad5af2099b7d2863770233c5f68ed168553 |
Hashes for wasmer_compiler_llvm-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c7cf50430942dd465cedb5c1f9815e6aad22aaeb210924f2838aef88595bdd2 |
|
MD5 | 7fb21b4172b056be859788956c1afe3e |
|
BLAKE2b-256 | 9e494ccca0ce155c1239fee1fa6a2e73aeaf0c5dc498cdcbbd434cf2ea3c1bab |
Hashes for wasmer_compiler_llvm-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3cbf6c873309993a17f2caad66311ba3eb0a46571cba6a98ab1bcd3e9b36e5c |
|
MD5 | 41003a506d8ccbf74ea01ceb7b0b7f0e |
|
BLAKE2b-256 | 6c89aa998198df8a747dd6140fcb0209687db08757be9828cde03d73829e6ccb |
Hashes for wasmer_compiler_llvm-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 367a686655021cf19e026f5a2822a4d212d9d673dc3178213da087d98dc2e018 |
|
MD5 | 2ed3ea266185f0ebcd3a68bb93741f75 |
|
BLAKE2b-256 | 48024453325dd62d8750fc71a43bf3ca420de1d36c09ef22ec679d7014bfd153 |