Hacker News new | ask | show | jobs
by Lio 2894 days ago
Would it be possible to make use of the built in JavaScript garbage collector (I'm assuming not) and/or separate to the Go runtime into some kind of shared linked lib so that at least you only pay the download cost once?

(Of course that would open up all the sorts of issues that static compiles get rid of.)

3 comments

The JS garbage collector would be unlikely to work for Go since Go allows pointers into the middle of an object and JS doesn't.
“Make use of the JS GC” is a feature planned for, but not yet accepted or implemented in webassembly.
yes but Go doesn't plan to do that, they feel their GC is better.

You can also use C or Rust and avoid GC altogether. Rust produces very small WASMs

Yeah it does seem an unlikely fit for go.

I imagine that go to wasm would likely be used for situations where size won't matter too much and will be an acceptable trade off for familiarity or code reuse.