跳转到主要内容

Python扩展,用于运行WebAssembly二进制文件

项目描述

Wasmer标志 Wasmer Python,单遍编译器 PyPI版本 Wasmer Python 文档 Wasmer PyPI 下载 Wasmer Slack频道

wasmer 是一个完整且成熟的 Python WebAssembly 运行时。 wasmer_compiler_singlepasswasmer 提供了 Singlepass 编译器,从而使 wasmer 能够编译 WebAssembly 模块。

存在其他编译器

  • wasmer_compiler_cranelift,
  • wasmer_compiler_llvm.

要获得更完整的视图,请参阅 wasmer 包本身的文档

安装

此包必须与 wasmer 包一起使用,因此

$ pip install wasmer
$ pip install wasmer_compiler_singlepass

用法

wasmer.engine 中的任何引擎都可以将 wasmer_compiler_singlepass.Compiler 类作为参数

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))

文档

请浏览位于 https://wasmerio.github.io/wasmer-python/api/wasmer_compiler_singlepass/ 的文档。

或者,运行 just build compiler-singlepass 后跟 just doc 以在 docs/api/wasmer_compiler_singlepass.html 内部生成文档。

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

此版本没有可用的源代码分发文件。请参阅有关 生成分发存档 的教程。

构建分发

wasmer_compiler_singlepass-1.1.0-py3-none-any.whl (1.9 kB 查看散列)

上传时间 Python 3

wasmer_compiler_singlepass-1.1.0-cp310-none-win_amd64.whl (539.0 kB 查看散列)

上传时间 CPython 3.10 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl (635.9 kB 查看散列)

上传时间 CPython 3.10 manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl (574.4 kB 查看散列)

上传时间 CPython 3.10 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.1.0-cp39-none-win_amd64.whl (538.9 kB 查看散列)

上传时间 CPython 3.9 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl (636.1 kB 查看散列)

上传于 CPython 3.9 manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl (574.6 kB 查看哈希)

上传于 CPython 3.9 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.1.0-cp38-none-win_amd64.whl (539.0 kB 查看哈希)

上传于 CPython 3.8 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp38-cp38-manylinux_2_24_x86_64.whl (635.7 kB 查看哈希)

上传于 CPython 3.8 manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp38-cp38-macosx_10_7_x86_64.whl (574.4 kB 查看哈希)

上传于 CPython 3.8 macOS 10.7+ x86-64

wasmer_compiler_singlepass-1.1.0-cp37-none-win_amd64.whl (539.0 kB 查看哈希)

上传于 CPython 3.7 Windows x86-64

wasmer_compiler_singlepass-1.1.0-cp37-cp37m-manylinux_2_24_x86_64.whl (635.7 kB 查看哈希)

上传于 CPython 3.7m manylinux: glibc 2.24+ x86-64

wasmer_compiler_singlepass-1.1.0-cp37-cp37m-macosx_10_7_x86_64.whl (574.5 kB 查看哈希)

上传于 CPython 3.7m macOS 10.7+ x86-64

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面