Skip to content
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

Exposing functions from Rust to WASM #148

Closed
XBagon opened this issue May 15, 2019 · 2 comments
Closed

Exposing functions from Rust to WASM #148

XBagon opened this issue May 15, 2019 · 2 comments

Comments

@XBagon
Copy link

XBagon commented May 15, 2019

I'm having a hard time figuring out how I would be able to expose a function to the VM, so I can call it from the wasm code. I found stuff like Imports and looked a bit into the code, ending up trying to write my own Resolver, but then failed to do it cause I'm really not sure how to create an Export::Function and then link it to a Rust function. The documentation is kinda confusing and the tutorials seem only to cover direct usage as a binary. I would appreciate help very much!

@sunfishcode
Copy link
Member

Indeed this is something we are planning to support well, but it isn't very advanced yet. The best example we have right now is the WASI implementation in wasmtime-wasi/src/syscalls.rs.

@alexcrichton
Copy link
Member

With the wasmtime crate this is now done with the Func API, and we're continuing to improve it over time as well!

grishasobol pushed a commit to grishasobol/wasmtime that referenced this issue Nov 29, 2021
pchickey added a commit to pchickey/wasmtime that referenced this issue May 16, 2023
mooori pushed a commit to mooori/wasmtime that referenced this issue Dec 20, 2023
Implement i32 ops through masking
dhil added a commit to frank-emrich/wasmtime that referenced this issue Apr 2, 2024
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this issue Oct 18, 2024
Provide specs for store rules and verify a subset of expansions.

Updates avanhatt#34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants