by Lio · 8y ago · 0 comments
I'll be interested to find out more about interactivity with the rest of the javascript world via syscall/js.
From the release notes:
> Go programs currently compile to one WebAssembly module that includes the Go runtime for goroutine scheduling, garbage collection, maps, etc. As a result, the resulting size is at minimum around 2 MB, or 500 KB compressed.
The minimum size is a bit unfortunate, but after all it is still just experimental.
No linker will ever do that.
WASM has significantly less parse penalty than javascript. A larger bundle size than your accustomed to with pure js is not necessarily a problem.
https://blog.figma.com/webassembly-cut-figmas-load-time-by-3...
https://hacks.mozilla.org/2018/01/making-webassembly-even-fa...
Maybe they can use some DCE to get it smaller, idk. Go binaries have never been that small so I have my doubts, but hopefully!
EDIT: I see the release notes now that says 500k compressed. That's much better. I didn't realize webassembly could be compressed, is this just gzip?
This isn't a limitation we'd see with something like Rust.
(Of course that would open up all the sorts of issues that static compiles get rid of.)
You can also use C or Rust and avoid GC altogether. Rust produces very small WASMs
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.