top | item 47063772

(no title)

usrnm | 11 days ago

> I don't see why I would want to use libc

To make your code portable? Linux-only software is even worse than Windows-only

discuss

order

koakuma-chan|11 days ago

Let me narrow down the scope here. I am a Rust developer, developing software that will run on my Linux server. Why would I want to use libc? Why does Rust standard library use libc? Zig, for example, doesn't.

usrnm|11 days ago

If you write your software only for yourself, do whatever you want, of course. If you want to share it with other people, artificially limiting it without a very good reason will make it less useful and popular.

wtetzner|11 days ago

> Why does Rust standard library use libc?

Because that's the stable public interface provided by pretty much every OS except Linux. On Linux, if you don't want to depend on the OS-supplied libc, you can use musl.