Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gate)!: wasmtime support (#669)
#### Motivation and context Enable support for [wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) and facilitate readiness for the upcoming specs. #### Migration notes `#[wasmedge_bindgen]` are replaced by wit bindings. In the old version we were restricted to`#[wasmedge_bindgen]`, which was only available in Rust and unique to WasmEdge. ```rust #[wasmedge_bindgen] fn add(a: u32, b: u32) -> u32 { a + b } ``` In the new implementation, wasm modules written in any language that uses the `wit` interface are now natively supported within `typegate`. ```wit // wit/example.wit package example:host; world host { export add: func(a: u32, b: u32) -> u32; } ``` An implementation (eg. in Rust) may look like this.. ```rust // src/lib.rs wit_bindgen::generate!({ world: "host" }); struct MyLib; impl Guest for MyLib { fn add(a: u32, b: u32) -> u32 { a + b } } export!(MyLib); ``` ### Checklist - [x] The change come with new or modified tests - [x] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --------- Co-authored-by: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com>
- Loading branch information