Is this library any good for using wasm libs in python?
See original GitHub issueI made a very minimal example:
Rust code compiled to wasm32-wasi
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn hello()->String{
String::from("Hello World!")
}
Python code to use it
>>> from wasmtime import loader
>>> import my_test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/wasmtime/loader.py", line 71, in exec_module
imported_module = importlib.import_module(module_name)
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '__wbindgen_placeholder__'
Is it possible at all to use this wasmtime-py
for calling functions out of a wasi library?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
[WASM] Unvendoring some of stdlib modules - WebAssembly
In Pyodide, we are using “unvendoring” approach: we remove some of the infrequently used stdlib modules from the core Python distribution, ...
Read more >Running Python in the Browser with WebAssembly
In this tutorial, you'll build a Python code editor in the browser using WebAssembly (WASM), via Pyodide, and CodeMirror.
Read more >Wasmer: A Python library for executing WebAssembly binaries
Looks good! Just for my understanding, what would be the advantage of working with wasm binaries instead of, let's say, C external libraries...
Read more >wasmerio/wasmer-python: WebAssembly runtime for ... - GitHub
The wasmer package brings the required API to execute WebAssembly modules. In a nutshell, wasmer compiles the WebAssembly module into compiled code, and...
Read more >Python in the browser with WebAssembly and Cables.gl
What if you could code in Python instead of JavaScript in your browser? With WebAssembly and the Pyodide framework, you now have access...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately there is not a prototype of interface types as it exists today, but we’re working on getting one off the ground in wasmtime!
This is where the interface between the host and the wasm module itself is very low-level right now, it’s akin to dealing with a C ABI but even a bit harder than that. For a buttery-smooth interface like you want you’ll want to wait for interface types in wasm, since this is the problem they’re trying to solve.