Skip to content

Allen-Cherian/go-fn-wrap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demonstrating Go function call from wasm.

cd gowasm go run main.go

Rust code

extern "C" { fn hello(); fn goodbye(); }

#[no_mangle] pub extern "C" fn run() { unsafe { hello(); goodbye(); } }

Here it expects two functions passed from the execution environment. GO SCRIPT has this helloItem := wasmtime.WrapFunc(store, func () {}) goodbyeItem := wasmtime.WrapFunc(store, func () {}) instance, err := wasmtime.NewInstance(store, module, []wasmtime.AsExtern{helloItem, goodbyeItem})

To build cargo / rust with updates cargo build --target wasm32-wasi

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 86.2%
  • Rust 13.8%