grain
grain copied to clipboard
feat(compiler)!: `foreign` module syntax
Closes #1052 with modified syntax as discussed in Discord
module A
// use as a submodule
foreign module Namespace binds "namespace" {
foreign value myFn binds "my_fn": WasmI32 => WasmI32
}
// use as a toplevel module
foreign module Namespace binds "namespace"
foreign value myFn binds "my_fn": WasmI32 => WasmI32