Python extension to run WebAssembly binaries
Project description
Wasmer Python
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/.
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_beta1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1db9758b6437e45d04abcafc440fe83824dcefd21c57a01e724043ad5b28034 |
|
MD5 | 84084770211a197cc399dd8f717ffbae |
|
BLAKE2b-256 | f8793ab157ca02d39b81debf1f02b2e3d7055a1cbaf02e2f92f46276b71d9daa |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdd85f75e9d5afcfbd7fb204ba817d757216951d4f2cd208bb822c6c6fa2c507 |
|
MD5 | 612b9054aa06832c57ad7657f11c9616 |
|
BLAKE2b-256 | 0ad295366f5ae74d3bd6930f548d0090d1d43a90eb8518b999728c0d79f9f3e7 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e318b001724562ea115e3b279deeaec69ce5723c97413bd094605838abdb57be |
|
MD5 | e4c86ff1575363ea0f198b8752225f88 |
|
BLAKE2b-256 | aa57bddd1a2544fe9278189eb13a2b9e41381887f753aba0bfaddf45ad298cc5 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d873215d3f853a5d6bef16345dadd8ae54e04fc58cdc10e4886181a4dba5c738 |
|
MD5 | 75118c173a01899a4aac813c5f7e4630 |
|
BLAKE2b-256 | 0a2d17d6a01596b95c435f40a512aa81a1d53ed3edf0fa13477da250e547e5a2 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b635a92a7061bc61f6f441f330375b9e6bd150d81bf215d5a4113f42ed084a95 |
|
MD5 | 5b2ff06bf32632cea2c235e2234b2ace |
|
BLAKE2b-256 | 27c108e491246c82faca11264a2f42bacb53f73801b34e24d6bf83d47ba95003 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4990e2e79fc9a7418fab85df94d9cc9afdf44429cfdf59d3e070215cfb8da530 |
|
MD5 | f4920fecbd82a33f3a49d8dca97852f8 |
|
BLAKE2b-256 | 2d6edd595621b881f45040b04166b403de0b6a434842cb2718bd976a59593023 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc89ec8b1ef4efb978e2b5c053f748d40aa8e00a321252e4003fd86be515c894 |
|
MD5 | 3dd02b86e88a1cf67da44aafe6df16e3 |
|
BLAKE2b-256 | 6426bd00e690e219d6a6c1813d991ef7d09ce56068365d4e1aa96681b3e05ba5 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f71d89b7b1b22836f77a62c861ae3a3d95c73c923a9df24f9e05837f9a704e2 |
|
MD5 | 1122b814ca7e1c1fe600f55a67c69f27 |
|
BLAKE2b-256 | b442814012080a8febeb7f62491eb227ecbffb6961e7c9584eced85d885b4f9d |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe792ac966043ee1f2005e8020f7f124551baf9ece2a4f2858a28e23cb85f90f |
|
MD5 | 34a0ef083970b72d184c5a74b506acfa |
|
BLAKE2b-256 | f6cc0bf3cf5b1eb6bc9cc03764cee67c0c39295358c509dafbf4a579ce4c07f1 |
Hashes for wasmer_compiler_llvm-1.0.0_beta1-cp35-cp35m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3beb7af14a12f58bff7ea731e31fff7a29ed9f61d6b6fec7da3257927209f35 |
|
MD5 | 3f1853d2b608d8abe08c0ef10a765198 |
|
BLAKE2b-256 | 6d1953468192a2a020375cd602ffb8b8fe07ccf1a558f66c07c410853b1d0627 |