wasm3 / wasm3-rs

Rust wrapper for Wasm3, the fastest WebAssembly interpreter
MIT License
160 stars 44 forks source link

Update Wasm3, make use of exciting new API #24

Closed vshymanskyy closed 2 years ago

vshymanskyy commented 3 years ago

With latest Wasm3 (v0.5.0), new API is available which fixes many things in the public API:

I think all this can greatly help your bindings implementation. @Veykril please let me know it you need any other public API, or have any ideas!

This is already implemented in Python bindings, you can use it as a reference: https://github.com/wasm3/wasm3/blob/master/platforms/python/m3module.c

jimpo commented 2 years ago

I have prototyped this as I was running into issues with the old version of Wasm3 currently supported by this crate. I use only the types and functions exposed in wasm3.h and m3_api_wasi.h (if the wasi feature is enabled). However, this crate makes heavy use of internal structs, and so not all exposed functionality is available using only the public API. In particular, I had to remove this functions:

So we could either add to the wasm3 API to keep these or remove them from the Rust API. I'd be happy to open a PR with my changes, which has bindings to the v0.5.0 release.