Hacker News new | ask | show | jobs
Running Golang on the Browser with WebAssembly and TinyGo (marianogappa.github.io)
40 points by maloga 2263 days ago
2 comments

I assume there's no GC since WASM doesn't (yet) support that, and this isn't a VM or interpreter. Is that correct?
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!

TinyGo's wasm output absolutely does include it's own garbage collector, though it's only been in the last few point releases. eg maybe um.. 6-9 months or so (rough guess)

It can be turned off, but by default it's included.

From rough memory, it's based upon or uses the same principles as the MicroPython one. Akye (primary TinyGo author) was experienced with MicroPython before starting the TinyGo project.

Disclaimer - I've made very minor contributions to the TinyGo project, but haven't really touched it in a few months.

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.

A little snarky, but I get your point. WASM does look more like a virtual machine than ASM to me.
Very interesting read. I appreciated how it was written, showing all the steps and how to overcome them.