3 ms·
Rust does support a surprisingly deep set of platforms, but it achieves this by baking platform-specific knowledge into Rust itself. See for example how it find
by ridiculous_fish 5y ago
Rust does support a surprisingly deep set of platforms, but it achieves this by baking platform-specific knowledge into Rust itself. See for example how it finds errno, it's just a big list of special cases. It is pleasant to not need the configure scripts, but a downside is that no new platform can participate without first patching Rust.
https://doc.rust-lang.org/src/std/sys/unix/os.rs.html#38 https://doc.rust-lang.org/src/std/sys/unix/os.rs.html#38
- steveklabnik 5y ago(Into the standard library, not into Rust itself. Anyone can write this, you don't need to patch Rust first just to call some functions.)
- nicoburns 5y agoI believe you can write your own completely separate standard library if you want to (much like each platform typically has it's own libc). It's just that it's easier to manage the first-party supported platforms as one codebase.