I explored using the standard Go toolchain for wasm recently but got stuck since there’s no go:wasmexport. In other words, the Go program expects to be the main entry point. It’s not easy to distribute a Go library as wasm to be called by JS. I guess this makes sense for edge computing/lambda environments but not in the browser.
From what I recall, TinyGo probably would have worked since it has some additional, non-standard enhancements.
I’ve used Go WASM in the browser. You don’t really need an export mechanism because you can just assign stuff to the JS window object. I guess if you had a lot of different WASM running at once you might clobber the window, but it’s not a problem yet, since so far it’s weird to run more than one thing.
I explored using the standard Go toolchain for wasm recently but got stuck since there’s no
go:wasmexport
. In other words, the Go program expects to be the main entry point. It’s not easy to distribute a Go library as wasm to be called by JS. I guess this makes sense for edge computing/lambda environments but not in the browser.From what I recall, TinyGo probably would have worked since it has some additional, non-standard enhancements.
I’ve used Go WASM in the browser. You don’t really need an export mechanism because you can just assign stuff to the JS window object. I guess if you had a lot of different WASM running at once you might clobber the window, but it’s not a problem yet, since so far it’s weird to run more than one thing.