wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

wasmtime: Allow Import of External Definitions

Open theduke opened this issue 3 years ago • 0 comments

Unless I'm missing something, it currently does not seem possible for one wit_bindgen_wasmtime::export/import!() macro to use definitions produced by another export!/import! macro.

My use case is allowing crates to use core definitions provided by another crate.

It could look something like:

outer.wit:

use {...} from core

...
wit_bindgen_rust::import!({
  paths: ["outer.wit"],
  external: [ "core" ],
});

This would prevent all the core definintions from core.wit to be generated, but instead expect a core Rust module to be in scope.

theduke avatar Apr 09 '22 09:04 theduke