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

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.




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

Search: