Hacker News new | ask | show | jobs
by teki_one 55 days ago
Why?
3 comments

I'm assuming they mean because it doesn't need a garbage collector or much of a runtime at all. You can target direct to WASM and use I guess WASI, while Go brings with it a garbage collector and so on.
Wasm is a first-class target for Rust, which produces faster and smaller Wasm binaries. My understanding is that you need to use TinyGo to reasonably target Wasm with Go.

Go having a garbage collector isn't necessarily bad, since Wasm has GC, but I think Go's GC can't easily use Wasm GC because Go has interior pointers.

WASM is also a first-class target for Go (gc).

However, it has a relatively large runtime, so TinyGo is often preferred when bundle size needs to be small.

With the caveat that Go cannot use WASM GC, because it is still a MVP and it does not support internal pointers, so languages like D, Go and C# have to keep shipping their own implementations.
I think the main advantage is size. Rust doesn't need to include the runtime.