-
Notifications
You must be signed in to change notification settings - Fork 726
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
How to call a native webassembly file in c/c++ source code? #1130
Comments
You'll probably want to look at https://github.com/WebAssembly/wasm-c-api. There has been work making various wasm engines support this API (not much on wabt though). |
What I want to achieve is the cross-call between c++ and wasm. This must depend on the wasm interpreter. I think it may be some help in wabt. |
Yes, this is possible in wabt, see test-interp.cc for example. But this uses wabt's own internal interface. The wasm-c-api has (what we hope to be) a standard interface for doing this: https://github.com/WebAssembly/wasm-c-api/blob/master/include/wasm.hh#L634-L652 |
I created #1158 to request the C-API be implemented here. |
OK, we can close this issue in favor of that one. |
In the JavaScript, you can use the
WebAssembly.instantiate
function to load a WASM file and use the various methods provided by the WASM file. I want to know if there is such a way in C++ that I can use WASM files directly.The text was updated successfully, but these errors were encountered: