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_beta2-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8880a17be695672cb56fef00f8e69840145d241e0dafe6d618807f48098e158c |
|
MD5 | d3834df637e4059d470f60a1f236f0b5 |
|
BLAKE2b-256 | f5c0dec57b93bca36c0032912beb3af21b2ef2ab905fe3bc11792d055abd5620 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 473836b0dfd94c0ef62983560f058f1dac68d117563125a9d83fd9e70fc36b16 |
|
MD5 | 8107f141f593cbdd102fe3ffe28dbc76 |
|
BLAKE2b-256 | 1037ea2db4050da4aca58a0e62336d11e62c000b00ab8fbc71d8345b5f9ca460 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86911cec98a1098fa7769ddfc2691217a1d98e40b32645b7b3c71f108ffc2ce6 |
|
MD5 | 2e9eca37ffb6cf3f53e3fa3721adca3f |
|
BLAKE2b-256 | 94dbaaa84b7d8906244d294c94ccb04adc18c5b6357c68fe74278d1d1ffcb7eb |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3add9716e55c1f70a7c4b9956147bda688d241363fd807f4e1c2762eb38a09a6 |
|
MD5 | c23ab2a336c877d24d352c06eb717c61 |
|
BLAKE2b-256 | 62b349e53686880de3377543b7075b87216a545c3c9004df18ba579c53697e7f |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101b192d9dae96f7b93fa0ea574349bb6dda93aeaf590471710c5b54406f8d78 |
|
MD5 | c291ff0df1a703f6c7cc847a28494b68 |
|
BLAKE2b-256 | 8c8289ebc0e3797f4cfc6cda39833a09f9e94eeae534ce8603ae4a254c4eca01 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9181abca2f920ee5e22b858f2e2ffb3b7b61383708abc1b2dde7ebb38c1bfd7b |
|
MD5 | 5943643bc0659fddbf47dd8130b433e7 |
|
BLAKE2b-256 | 851db28e5c4f008c1c5e196d6b0efc7eeb5941adaf631d8d32d8620085585494 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cda82a271edc4c3036e1c509452d5b35d53da1a91435d83e15e4a920408d15c |
|
MD5 | ff366a223d12f572c8fc97f2c96e35b7 |
|
BLAKE2b-256 | 79fd7ed84eb25be12b1fe1c1335e3123aa0e61abddc83954495f789030877035 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ab03296f2d92c4964367b058d94dac8a5a34c06c3960b1cb778f54172801de |
|
MD5 | 35a1c6c9568613921f3f0979c458a710 |
|
BLAKE2b-256 | 15fdcaf58678ec96e54edea781e51bcc9d28c8f36aa79ce161931a71b0375f08 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a941c0a1dabf841bd341cfbdfd6c802de76881e1eba91101f0d96f5bf08a4f11 |
|
MD5 | 97f0f873010803295ceab7c80fd50c5f |
|
BLAKE2b-256 | 6b6517d17bc5d315627f812e156d2c0fa293bd49244ae1090285fd1a8acc2a1d |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7555233099ab168a0ac7de478ad9fa7f904adeb7954ff27c4815db9c99b91355 |
|
MD5 | a131c4ffe3869cdc2d5cac20fc27f661 |
|
BLAKE2b-256 | 2ee6abec4a873a3278ffcfad540a632de5df17136eb1a15df2667a11ca546e73 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e87a4ac16213fad6ed768f0f2059083f24102b83ef5b7ded0be2d9260950a87 |
|
MD5 | 752d6b3483f115cad98bfbb14f49dd90 |
|
BLAKE2b-256 | b9075af9341a4e839c05a7c938a51a0af9cbdb2dfce30bb1fd1935cdba602237 |
Hashes for wasmer_compiler_singlepass-1.0.0_beta2-cp36-cp36m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 231de0477e20298e3de370c04379c11b1256bea2a4144b00668e1713e964f470 |
|
MD5 | 9b74c3295b4d4ed04e53fd15d0ad5d30 |
|
BLAKE2b-256 | 991680af7a67732abb74feb21bcf3d0e1b6bc6261c81662ce7c6be94ddc59a52 |