Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Rust does the same.


Rust 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.


Yea 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.


Both 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.


None 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".


By 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).


By that definition, I cannot name a single high-level programming language that generates freestanding binaries.


Many 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.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: