News for hackers. Stuff that matters.
Re:WASI Support in Go by rockwotj on Wednesday September 13, 2023 @04:24PM (#37501273)
FWIW we simulate exports by instead having `main` call an imported function that blocks until it's ready to return with the needed data.

So instead of:

`host -> call foo on guest -> return to host`

`host -> call guest main -> call foo on host -> host returns when ready -> guest calls foo when done`

FWIW the scheduler (so goroutines) don't work in go if you're not calling from an main, so anytime you call a custom export then try to use a goroutine you'll get panics.

10x size is about the blowup we see as well. It's also likely to be slower (some of the Tinygo authors said ~20% slowdown compared to tinygo) probably due to the simpler/smaller runtime and LLVM being better at optimizing.

Re:WASI Support in Go by Seb-C on Wednesday September 13, 2023 @10:43PM (#37504326)
The only time I tried wasm in Go, the wasm compiled by the native Go was so slow that the equivalent Javascript was faster. Tinygo produced decent performance however.