Hacker News new | ask | show | jobs
by bacondude3 2069 days ago
I don't know much about Rust. Can it be compiled into a standalone binary? C programs typically rely on header files and are not standalone, and Rust is (basically) C but with safeguards around memory, right?
1 comments

Yes it can when you use musl instead of glibc
Thanks! Where can I read more about that? I looked at musl's website, but didn't see any mention of standalone binaries on the page comparing it to glibc. [0]

[0]: https://wiki.musl-libc.org/functional-differences-from-glibc...

This is more of a Rust quirk[1] than a glibc/musl thing. Glibc can be used statically (though it's not really recommended -- hence why Rust doesn't support it and requires you to use musl instead).

[1]: https://doc.rust-lang.org/edition-guide/rust-2018/platform-a...