top | item 22748093

Running Golang on the Browser with WebAssembly and TinyGo

40 points| maloga | 6 years ago |marianogappa.github.io

6 comments

order

tyingq|6 years ago

I assume there's no GC since WASM doesn't (yet) support that, and this isn't a VM or interpreter. Is that correct?

PhilippGille|6 years ago

Wasm doesn't have its own GC, but just like Go binaries for other compilation targets include a runtime with GC, the Wasm binary includes that as well I think. That's regarding Go in general.

The post is using TinyGo, which explicitly mentions it uses a GC and doesn't exclude the Wasm target (which otherwise is sometimes mentioned if there's something it does differently): https://tinygo.org/lang-support/#garbage-collection

Please correct me if I'm wrong!

pjmlp|6 years ago

My Intel CPU also doesn't have a GC.

Any language targeting current WASM just brings their own GC implementation for the ride as well.

pjmlp|6 years ago

Very interesting read. I appreciated how it was written, showing all the steps and how to overcome them.