3 ms·
Increasing the glibc and Linux kernel requirements
- hulitu 4y agoIf rust is better than C, why does it requires glibc ?
- steveklabnik 4y agoRust’s standard library uses libc on platforms where appropriate. For example, on Linux, glibc would be the default there. If you’re not in that context, then there is no requirement.
- hulitu 4y agoBut why ? would't that make rust unsafe ( by calling a libc function ) ?
- steveklabnik 4y ago> But why? libc is a useful abstraction. While on Linux, system calls are stable, on many other systems, they are not, and libc is the only way to make system calls. It's simpler to uniformly use libc than to make an exception for Linux. That said, there's been some discussion about moving to direct calls on Linux, but that hasn't changed yet. > would't that make rust unsafe ( by calling a libc function ) ? All programming languages need to interact with the operating system to function. If calling libc is inherently unsafe, then every single programming language ever is unsafe. What Rust does is not expose libc directly as safe functions. There are wrappers that ensure that you can't cause memory unsafety. There are also unsafe direct bindings you can use if you'd like.
- torstenvl 4y agoImagine if C or Forth had a minimum glibc or kernel version requirement. I think the too-cozy relationship between the stewardship of Rust as a language and the stewardship of the reference implementation is seriously holding Rust back. Minimum requirements for the tool chain effectively mean minimum requirements for the language, and if the minimum requirements for the language are anything beyond bare metal then it isn't ready for prime time as a systems language.
- steveklabnik 4y agoThese requirements only apply to running rustc, or rust programs using libstd. Same as a C compiler or any C program that links to libc. Many many people (including myself) use Rust on bare metal, no libc involved for required.