4 ms·
Is there a "glibrust" or equivalent standard library for Rust, yet?
by na85 11y ago
Is there a "glibrust" or equivalent standard library for Rust, yet?
- thinkpad20 11y agoRust of course has a standard library[0] and it includes a libc, but (I might be wrong here) I think the libc portion is FFI into glibc or similar. I think the stuff written in rust is considerably more high-level, focusing more on data structures, concurrency, string manipulation, etc. [0]: https://doc.rust-lang.org/std/ https://doc.rust-lang.org/std/
- deleted 11y ago[deleted]
- steveklabnik 11y agoWe use glibc by default but provide MUSL builds for some platforms as well.
- na85 11y agoI guess what I'm asking is if the syscall wrappers are in rust or if rust just calls glibc wrappers.
- CyberDildonics 11y agorust relies heavily on libc as far as I know
- steveklabnik 11y agoSome of the standard library does, but the core language does not. (libcore does not, and we've resisted putting libc specific things in core)
- Manishearth 11y agoNo, not heavily. libstd depends on it some (we allow both glibc and musl libcs). libcore (the baremetal library) and the language don't need libc at all.
- fiveop 11y agoThere is the library 'libc' which is a collection of interfaces to (g)libc functions together with the necessary constants and structs [1]. There is the library 'nix-rust' [2], which aims to provide a wrapper of 'libc' in idomatic Rust. Unlike 'libc', 'nix-rust' does not have a consistent code quality and organization yet. However, Both are missing various bindings for various platforms. [1] https://github.com/rust-lang/libc https://github.com/rust-lang/libc [2] https://github.com/nix-rust/nix https://github.com/nix-rust/nix