You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't found the document about how to use bindings from hosted runtime. In my case is: a function defined in Node.js, and Node.js loads the WASM written by golang, compiled by tinygo with WASI target, but in golang code, HOW to call Node.js functions defined in bindings ?
constwasi=newWASI({env: {},args: [],bindings: {hostFunc: ()=>{console.log('Call host language function')}}})
package main
import (
"fmt"
)
// this function should be defined in bindingsfunchostFunc(objstring)
funcmain() {
fmt.Println("test wasi is working")
// NOT WORKINGhostFunc()
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I didn't found the document about how to use bindings from hosted runtime. In my case is: a function defined in Node.js, and Node.js loads the WASM written by golang, compiled by tinygo with WASI target, but in golang code, HOW to call Node.js functions defined in bindings ?
Beta Was this translation helpful? Give feedback.
All reactions