News for hackers. Stuff that matters.
Re:Running Golang on the Browser with WebAssembly and TinyGo by tyingq on Wednesday April 01, 2020 @04:32PM (#22753223)
I assume there's no GC since WASM doesn't (yet) support that, and this isn't a VM or interpreter. Is that correct?
Re:Running Golang on the Browser with WebAssembly and TinyGo by PhilippGille on Wednesday April 01, 2020 @06:48PM (#22754302)
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!

Re:Running Golang on the Browser with WebAssembly and TinyGo by justinclift on Thursday April 02, 2020 @08:02AM (#22758100)
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.

Re:Running Golang on the Browser with WebAssembly and TinyGo by pjmlp on Thursday April 02, 2020 @03:17AM (#22756900)
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.

Re:Running Golang on the Browser with WebAssembly and TinyGo by tyingq on Thursday April 02, 2020 @07:13AM (#22757839)
A little snarky, but I get your point. WASM does look more like a virtual machine than ASM to me.