-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
working with strings #503
Comments
Hello, I've never tried to use Does it help? |
Thanks for your reply! I think implementing them with ’wasm-bindgen’ is one attempt. Is there a suggested way to work with strings in python + wasmer? Or are we waiting for interface-types to be more mature? |
Ideally, you should wait on WIT to be more mature, but it won't happen before at best one year. Personally, I would just write a |
That's exactly what I was looking for, thanks!! |
Summary
I've been wondering how to handle strings in python + wasm (with wasmer). There are proposals like reference types and interface types and low-level examples manipulating memory to handle strings. As wasmer implements at least reference types, is there an easy way to e.g. pass strings to exported wasm functions?
Additional details
I was trying this out with
wasm-bindgen
and implemented the wasi example from wasmtime, but transformed the wasm module into a reactor module. This very easy function copies one given file (param1) to another location (param2).Compiling with
cargo rustc --release --target wasm32-wasi -- -Z wasi-exec-model=reactor
results in a wasm module which includes wasm-bindgen imports and exports, including memory manipulation functions:So given this simple python program to call this function, how can I interact with it so that it passes parameters correctly? Note that this program works, when the exported functions has hard coded paths instead.
The text was updated successfully, but these errors were encountered: