I mean, have you ever looked at any low level code from any language that came out in the last 30 years? Its always C.
post
This is correct and fine?
It's also a c wrapper
So? It's logname, what do you expect, for them to read the bits directly from memory? If you're going to criticise this for anything, it should be that it doesn't support Windows, not that it calls out to libc.
yeah, all of this to call libc::getlogin().
I no longer use any wrappers or utils, they're just bloat. Now I just use my dousing rod to read and set bits in my RAM, way more efficient
I'm not that well versed in rust, is this literally just wrapping the C library in rust, and calling it a rust implementation of it?
No, it is not rust implementation if the library (not does it call itself that). It is a rust implementation of one of core utility programs. Here is the code it reimplements, it is similarly short, and hopefully dispels the confusion - https://github.com/coreutils/coreutils/blob/165b62de8083ed9dec9ef4e1699ed44c3c7a2b91/src/logname.c
To be fair, I doubt there's much that can be done about having to use C interfaces when interacting with Linux itself.
The fact that they're doing it MIT shows they aren't really trying to just rewrite it in rust for technical merits, there are ulterior motives
Specifically, they want to be able to use the utils without having to open-source the derivative works. Same reason why Google is developing the Zircon kernel for Fuchsia OS, by the way.
Sure this is a pretty funny screenshot, but this is a rewrite of gnuutils not a rewrite of libc.
all 22 comments