Elektrine lite

← Feed

@cockmushroom@reddthat.com

Post #3544838

2026-07-02 23:10 UTC

Generally I don’t consider myself anti rust as a technology, and/since many of my favourite tools happen to be written in it. Consequently, I don’t generally fall into the critics of c/unsafe usage. That said, for the purpose of understanding the point being raised, it’s important to understand the difference between uutils, its philosophy, and rust at large. This isn’t just an arbitrary rust project, it’s one that specifically claims to replace a C project. Is it the kind of thing I would encourage use of rust for? Absolutely not and I don’t hold any ill will to people pursing these, or similar, projects for pedagogical reasons. That’s not what uutils is or aims to be though. If the language’s system API isn’t ready for this sort of project, then I think that would be a more fruitful use of these people’s time and whatever funds the project maintainers are collecting. I’m just a bum though, so don’t mind me.

Replies (1)

  • @edinbruh@feddit.it 2026-07-03 12:53

    Well, if you want to be pedantic, I’ll entertain you a bit more. You see, C and Unix were “born” together. So sometimes, POSIX intertwines them in weird ways. In this case, getlogin is declared in unistd.h because it’s part of the Unix standard API, however the POSIX standard states that it must be implemented in libc. So the POSIX compliant way to getlogin is to call into libc, which doesn’t need to be glibc, you could use musl and avoid the GNU dependencies. If rust’s stdlib were to offer a getlogin function, the proper approach would be to still call libc. It’s like if on windows you were to call into Win32 to getuser, except on *nix it’s the same file as libc. If you want to replace the getlogin implementation, the POSIX compliant place to do it is not in coreutils but in libc, like the aforementioned musl library does. So the key here is that getlogin is not art of the c system API. It is actually part of the POSIX APIs, it is just “located” inside of libc, which by the way, does not need to be GNU if you are concerned with uutils’ philosophy.

    Open ##3556443