Python extension to run WebAssembly binaries
Project description
Wasmer Python, the Singlepass compiler
wasmer
is a complete and mature WebAssembly runtime for
Python. wasmer_compiler_singlepass
provides the Singlepass compiler
to wasmer
, so that wasmer
is able to compile WebAssembly module.
Other compilers exist:
wasmer_compiler_cranelift
,wasmer_compiler_llvm
.
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_singlepass
Usage
Any engines in wasmer.engine
can take the
wasmer_compiler_singlepass.Compiler
class as argument:
from wasmer import engine, Store, Module, Instance
from wasmer_compiler_singlepass import Compiler
# Let's use the Singlepass 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_singlepass/.
Alternatively, run just build compiler-singlepass
followed by just doc
to generate the documentation inside
docs/api/wasmer_compiler_singlepass.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_singlepass-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5c22551a8a297511be9d911308a8d763c1709ecbf3bfba3942457f8389cbc5 |
|
MD5 | e323b1c950fcf6e3aba42a5d43518f5b |
|
BLAKE2b-256 | 9e2f49fab7f480c8e42ae5c08fa152fdf2710618cf656f1f036e01fc3a26afb3 |
Hashes for wasmer_compiler_singlepass-1.0.0-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82cd6871b440c6e0f298c3a2ac9191a58da3fadbde876744fb18db43becbd70a |
|
MD5 | 3e832f4db5c2b848b126e6972260ac3f |
|
BLAKE2b-256 | 8eab0cc573787df79d031fdcd1c9d68e58aa78e1007284684143e72423fbd20c |
Hashes for wasmer_compiler_singlepass-1.0.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98dfada2b2c20422d5668a5690c6bfdd78bfda4671ad05f18e1ad2e13c9a22f9 |
|
MD5 | 75a3242950814c8e03f67d969d361afb |
|
BLAKE2b-256 | 7257360e2dc70409a0da93579abc3639398fb398bf9b359dee5c54a63f8ba919 |
Hashes for wasmer_compiler_singlepass-1.0.0-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdc9743fb5d467e9720fc6f46db82dc3405b386a00ee04c313664e1c5c7a36f0 |
|
MD5 | f20ee78dcb8d9be2b809d0782296a78c |
|
BLAKE2b-256 | 65223012ae15ba1c8d3764449debae1eb6ab825c4668fd27e8fd4b6d87d8e932 |
Hashes for wasmer_compiler_singlepass-1.0.0-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f1672c0efebbc267b31550ca88f563ae998636e0ca5e94496973b1d577aca2 |
|
MD5 | 72e8a5050bc1a5788745d173c2d2dbb4 |
|
BLAKE2b-256 | 102f157218ee89f115e45bb7222b55187b0f3ac66a1ff9444c67858ebaa211bd |
Hashes for wasmer_compiler_singlepass-1.0.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e35209ca6a7fbed46657729f5183f80a8075c9eb853e489232134cfb2e749002 |
|
MD5 | c1ce92535355181ec46559f6a0284982 |
|
BLAKE2b-256 | ac3f8fa0b054ff9beda06313e498f5c46e9bb82cdaead5de2a4b1bd2dc8f736d |
Hashes for wasmer_compiler_singlepass-1.0.0-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5386ecf0b6b48a27889a8cdab558a573cc4c729674e169b61bbc28f37f3f4146 |
|
MD5 | 7f885be5f8817e7a99650019dfe25fcc |
|
BLAKE2b-256 | 48a8451f847d771aa510a4f2bd7713e78aaf0e680aa77202f1c612c1afa4c808 |
Hashes for wasmer_compiler_singlepass-1.0.0-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87ad3284ffe449fdf500062f2ec25e4a717e8c7b12cbabdec9436b2f2fa0d6e8 |
|
MD5 | dc41e2db13c1e1e34800f8ec1e1622b5 |
|
BLAKE2b-256 | a4241c021b42ff504f6edda0ecceacb20e28757972b4fb3e7d4a1267093c8497 |
Hashes for wasmer_compiler_singlepass-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fc21c8e326129b747b903121e92c98c808981d8d43fd2ea7623433eac3bb464 |
|
MD5 | ed4b050b82493f8f9ed5e4e3b4641766 |
|
BLAKE2b-256 | f22aa05cabe72ab3bebb3c1c83143e3f1420f21e4517dcc59c88d896a45b0bf2 |
Hashes for wasmer_compiler_singlepass-1.0.0-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617dda920daf9785056ae295f10045a7676a276ed153218798066a733f931150 |
|
MD5 | 1a85492c4e0c9e0b034aff138a28be22 |
|
BLAKE2b-256 | d6f6a9febf05a562224633b85921964e400a7e95986d2bf13229e6168635e0dc |
Hashes for wasmer_compiler_singlepass-1.0.0-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 777caea943e1e28d02879a18b8a46a87dded6524da47a76a13c5da954bc7eb8a |
|
MD5 | b2ba0be26df52b966f31631c76c89e99 |
|
BLAKE2b-256 | 797034928a2c79d61093641791294d639571bb3453ac6870ce3753f4c3a939de |
Hashes for wasmer_compiler_singlepass-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca793b193fcc4d44b384693e052126c9860eb484b0e09291d0449a651543291a |
|
MD5 | 26941a94250495620e96db80b6ff1e95 |
|
BLAKE2b-256 | 57b008ffdee5e8be58e20902156514d1f7710f5d9dfba367e4d2a3dd198b457a |
Hashes for wasmer_compiler_singlepass-1.0.0-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d37d5f8eabf6b26af5d1b9fc952f6c4a653bd4ae9dbb3ca769a0578a86cc44fc |
|
MD5 | 30f3fea4129392e214ef2c979bac22f1 |
|
BLAKE2b-256 | ff0001151f5874e2831bd03daf73e28aee0f328434785f130142b18b47d70ae9 |