This creates a wasm file. In order to use it in Wasmtime I need to compile it to the .wat format. I normally use wasm2wat but if in this case I get an error message:
error: invalid section code 12
Do you know how to solve this?
A workaround for this is open the test.wasm file in VS Code and then it automatically shows it in the wat format. If I try to call this .wat file in Wasmtime I get the following error message:
error: failed to parse wat
expected an instruction
--> <anon>:3195:48
|
3195 | call_indirect (type $t2) $T0
| ^
Do you know how to solve this?
Is there a different way to use functions written in Go as an exported function in Wasmtime? I am open for any help.
My goal is to compile a function written in Go to a WebAssembly Module and use it as an export in the Wasmtime runtime.
This is my Go code:
I compiled it with "tinygo build -o test.wasm -target wasi ./main.go" (based on the FAQ example https://github.com/wasmerio/wasmer-go and the export example from tinygo https://github.com/tinygo-org/tinygo/blob/release/src/examples/wasm/export/wasm.go)
This creates a wasm file. In order to use it in Wasmtime I need to compile it to the .wat format. I normally use wasm2wat but if in this case I get an error message:
error: invalid section code 12
Do you know how to solve this?
A workaround for this is open the test.wasm file in VS Code and then it automatically shows it in the wat format. If I try to call this .wat file in Wasmtime I get the following error message:
Do you know how to solve this?
Is there a different way to use functions written in Go as an exported function in Wasmtime? I am open for any help.