`wasmer` 包的 Cranelift 编译器(用于编译 WebAssembly 模块)
项目描述
Wasmer Python,Cranelift 编译器

wasmer
是一个完整且成熟的 Python WebAssembly 运行时。wasmer_compiler_cranelift
提供 Cranelift 编译器
wasmer
,以便wasmer
能够编译 WebAssembly 模块。
存在其他编译器:
wasmer_compiler_llvm
,wasmer_compiler_singlepass
.
要获得更完整的视图,请参阅包
wasmer
本身的文档。
安装
此包必须与wasmer
包一起使用,因此:
$ pip install wasmer
$ pip install wasmer_compiler_cranelift
用法
任何引擎都wasmer.engine
可以将
wasmer_compiler_cranelift.Compiler
类作为参数:
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))
文档
浏览 https://wasmerio.github.io/wasmer-python/api/wasmer_compiler_cranelift/上的文档。
或者,运行just build compiler-cranelift
后跟just doc
以在
docs/api/wasmer_compiler_cranelift.html
.
项目详情
关
wasmer_compiler_cranelift_py310-1.0.0 -cp310-none-win_amd64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 87993e4b43ef7ca69c7fc15ed4195e7561a77883db79907c51046056f0b80604 |
|
MD5 | 362250caeec090d36df7c062b7efe7ea |
|
布莱克2-256 | 325c66a31ec4744a89ffcd1e37c3f5650daa39b5be11448d064bc7104eae5090 |
关
wasmer_compiler_cranelift_py310-1.0.0 -cp310-cp310-manylinux_2_27_x86_64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8dc55d6f6b8debf042d97502652e5048591311813f2db0e50d3b6ba47a21813a |
|
MD5 | 8be641044d496168a002f236f58625c2 |
|
布莱克2-256 | 01386ac2e38f36868c31a417ff5d02ca6dc5606774c110a99aa055859229e5f6 |
关
wasmer_compiler_cranelift_py310-1.0.0 -cp310-cp310-macosx_10_7_x86_64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | db21a81e768f3159168f7fcaf466efb09b1748d8cc821cd1062a778e11d5f5bd |
|
MD5 | 3b69c10f62c93d80c7f70c938db5a7ef |
|
布莱克2-256 | 69498ca8373aa307e21861c4b9871a688a4232d3f8a57e818f1cc8761d529a37 |