3 ms·
Rust does the same.
by xvilka 1y ago
Rust does the same.
- hu3 1y agoYea and at least Go provides a giant Google engineering tier quality standard library so reinventing the wheel here doesn't hurt so much productivity. Meanwhile Rust requires a pile of variable quality community driven crates to do basic things.
- bigyabai 1y agoBoth languages have enormous cargo-culting issues when you try to do anything that isn't fizzbuzz. The bigger difference that I'd expect people to identify is that Rust generates freestanding binaries where Go software requires a carefully-set runtime. There are pros and cons to each approach.
- hu3 1y agoNone of them generate true freestanding executables by default. Both Go and Rust require glibc. And Go's runtime is built-in by default. Unlike Java so there's nothing to "carefully set".
- bigyabai 1y agoBy that definition, I cannot name a single high-level programming language that generates freestanding binaries.
- hu3 1y agoMany of them can, including Rust and Go. Just not with default arguments. You need to pass linking arguments. This is not done by default to reduce binary sizes.
- XorNot 1y agoBy default no for Go, but it's much easier to get their then Rust. In Go you run this to build: CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' . I do not actually know how you get this done in Rust (you do something with musl and a bunch of other stuff).
- bithavoc 1y agoRust can cross-compile, yes, but is not as seamless. For example, Rust can not cross-compile Windows binaries from Linux without external support like MinGW. Go can cross-compile from Linux to Windows, Darwin and FreeBSD without requiring any external tooling.