Anyone working on a implementation of libr?

Hi everyone.

I've been hacking with Rust for a bit now (still very green) and I'm finding that over and over I end up violating safety because I'm always interacting with some C library or libc. I understand there are crates which attempt to safely wrap these libraries, but you'll never beat Rust on safety. Has anyone started a 'libr' to replace libc?

You might be interested in that one thing that one time

1 Like

Ah cool. I'll follow the progress on his library. That said it would be nice if someone would try this endeavour without copying libc or musl directly. It would be nice to see a library built and designed around the semantics of Rust and Rust's built in types.

Hm, I think std fits the bill perfectly :slight_smile:

It's not so great if you are trying to write an OS or embedded software. Doesn't Rust std depend on libc?

If you are developing OS then you likely don't want to use libc (or it's analogue), because it includes a ton of stuff which isn't applicable in the kernel context. However, there is core library for such cases, which is lower level then libc.

Doesn't Rust std depend on libc?

Yep, it depends on libc (and for some systems this is inevitable because the libc is the only interface to the OS), but it's possible to statically link everything.