A Developer is Reimplementing GNU's Core Utilities in Rust (phoronix.com) 186
A Rust-based re-implementation of GNU core utilities like cp and mv is "reaching closer to parity with the widely-used GNU upstream and becoming capable of taking on more real-world uses," reports Phoronix:
Debian developer Sylvestre Ledru [also an engineering director at Mozilla] began working on uutils during the COVID-19 pandemic and presented last week at FOSDEM 2023 on his Coreutils replacement effort. With uutils growing into increasingly good shape, it's been packaged up by many Linux distributions and is also used now by "a famous social network via the Yocto project...."
The goals with uutils are to try to create a drop-in replacement for GNU Coreutils, strive for good cross-platform support, and easy testing. Ledru's initial goals were about being able to boot Debian, running the most popular packages, building key open-source software, and all-around it's been panning out to be a great success.... [M]ore performance optimizations are to come along with other work for compatibility against the GNU tools and implementing some still missing options in different programs
The goals with uutils are to try to create a drop-in replacement for GNU Coreutils, strive for good cross-platform support, and easy testing. Ledru's initial goals were about being able to boot Debian, running the most popular packages, building key open-source software, and all-around it's been panning out to be a great success.... [M]ore performance optimizations are to come along with other work for compatibility against the GNU tools and implementing some still missing options in different programs
replacing stuff with rust code (Score:2)
should have started with systemd
Re: (Score:2)
You can do that with any of modular inits+rcs+kitchen sinks, systemd is intentionally monolithic -- you can't replace just a few pieces.
On the other hand, a lot of pieces of systemd have an abysmal code quality, and could actually be useful elsewhere if reimplemented.
Re: (Score:3)
the abysmal code quality in question WAS my point.
Re: (Score:3, Interesting)
Monolithic? You can definitely replace or re-implement pieces of Systemd if you desired. Systemd is modular as they come. You can even use as few or as many pieces as you want, and your desktop UI requires. Perhaps you're using some other definition of the word "monolithic." The hard requirements for certain modules comes from applications like Gnome, but even those requirements can be implemented with external daemons, and are on other OSes.
Re: (Score:2)
Systemd is modular as they come
How can you tell someone is lying? They use superlative words in their propaganda.
Even if you want to argue that Systemd is modular (questionable), it's definitely not as modular as they come. There are definitely more modular architectures out there.
Re: (Score:3)
Modular means there are clearly defined and documented roles for the modules, and well documented boundaries between the modules, with stable API's.
Where can I find this documentation for SystemD?
Re: (Score:3)
It isn't monolithic unless you're referring to the repo itself. There are hundreds of executables, each intended to run with least privilege. Each would be a candidate to rewrite in Rust, assuming there was a rationale for doing so.
Re: (Score:3)
There's https://github.com/KillingSpar... [github.com] already:
Will this replace systemd?
TLDR: No, rustysd is no dedicated replacement. It is an opportunity for the niches where systemd could not get it's foot down to profit (more easily) from the ecosystem around systemd.
Re: (Score:2)
Nothing stopping that happening either. Systemd contains a lot of small executables running under the principal of least privilege so there shouldn't be a reason that some of them couldn't be implemented using Rust.
Re: replacing stuff with rust code (Score:3)
voreutils (Score:5, Interesting)
I don't think Rust belongs anywhere near the core of the system yet. Instead, what about voreutils [sr.ht]?
Re: (Score:2)
why? (Score:5, Interesting)
Was there something fundamentally wrong with the core utilities that have had multiple decades of development and refinement that they need replacing? As far as I know, they are already efficient, secure, and cross-platform.
Or is this just a vanity project because they aren't in some developer's favorite language? If that's the case, why should anyone care?
Re:why? (Score:5, Interesting)
Was there something fundamentally wrong with the core utilities that have had multiple decades of development and refinement that they need replacing? As far as I know, they are already efficient, secure, and cross-platform.
Or is this just a vanity project because they aren't in some developer's favorite language? If that's the case, why should anyone care?
It's worse than just a vanity project (though that's exactly what it is) - it's also a pseudo-religion. With so much that needs to be fixed (Thunderbird and Firefox are good examples), wtf would you waste time on this if it wasn't both a vanity project mixed with rust religious zealotry?
Re:why? (Score:5, Insightful)
Upon re-reading, it's another Mozilla cluster-fuck:
Debian developer Sylvestre Ledru [also an engineering director at Mozilla]
Fix your current shit first, mkay?
Re: (Score:2)
Everyone can have a hobby,
So long as it *stays* a hobby, in this case.
Re: (Score:2)
Ah, one of _those_. No surprise, really.
Re: (Score:2)
Thou hypocrite, first cast out the beam out of thine own eye; and then shalt thou see clearly to cast out the mote out of thy brother's eye.
How about you "fix your current shit" before you talk about someone else's, mkay?
Re: (Score:3, Funny)
a pseudo-religion
That's actually quite accurate. From the title of the FOSDEM article:
Reimplementing the Coreutils in a modern language (Rust): Doing old things with modern tools
What they are doing there isn't reimplementing Coreutils. That is just the smokescreen. They are doing it to discredit C. It's all about that article title and the language in it that takes it as given that C, then, isn't a modern tool. And, of course, [airquotes]all the work[/airquotes] they are doing just lends weight. The same logic as the big lie. If they are doing all this work, then there must be something to it.
Have it it, g
Re: (Score:2)
A Mozilla dev trying to discredit another language in favour of rust? Mozilla has no credibility left to be in any position to cast shade, last I looked (The Tunderbird article earlier this week)..
Re: (Score:2)
it that takes it as given that C, then, isn't a modern tool
Next year, some CS major will develop a language to patch up all the stuff that's wrong with Rust. And then everyone can port kernels and utilities to that 'modern' language.
Re: (Score:2, Insightful)
wtf would you waste time on this if it wasn't both a vanity project mixed with rust religious zealotry?
Indeed. Also one of the central tenants of all good engineering is "if it is not broken, do not fix it". Seems this is a bloody amateur with an excessively big ego at work here. The usual for zealots, fanatics and virtue-signalling assholes everywhere.
Re:why? (Score:5, Insightful)
Indeed. Also one of the central tenants of all good engineering is "if it is not broken, do not fix it". Seems this is a bloody amateur with an excessively big ego at work here. The usual for zealots, fanatics and virtue-signalling assholes everywhere.
You've literally described Linus when he started Linux. The guy wants to do something not done before. So what? You seem so opinionated about what someone else does with their free time.
Re: (Score:2)
Re: why? (Score:2)
Re: (Score:2)
Indeed. Linus did not create Linux because he wanted to bolster his ego. He did it because he wanted a kernel to play with and then found a lot of other people wanted one too and were willing to contribute. Systemd, on the other hand....
Re: why? (Score:2)
Re: (Score:2)
Nope. And revising history will _not_ make you sound smart either.
Re: (Score:2)
Re: (Score:2)
The guy wants to do something not done before
Whaat? No, the guy wants something that costs huge to be available for him to be used however he want's. And why not everyone else then too.
History of CVEs (Score:2)
Also one of the central tenants of all good engineering is "if it is not broken, do not fix it".
CVEs in Coreutils [opencve.io] show how broken the software has been. A rewrite in a provably memory-safe language makes defects like these harder to ship.
Re: (Score:3)
rust is not memory-safe. Stop repeating crap that can be proven with a quick search on rust memory leak [rust-lang.org].
There are other techniques other than reference counting that work in other languages, including c. Reference counting is for lazy programmers who are too stupid to learn what mam taught them - if you take it, put it back where you got it from when you're finished. Applies to both stuff around the house and RAM.
Re: (Score:2)
rust is not memory-safe.
Yes it is.
Stop repeating crap that can be proven with a quick search on rust memory leak.
A leak isn't part of the definition of memory safety. So stop repeating crap that's disproven in literally the first paragraph of the page you linked to.
Reference counting is for lazy programmers who are too stupid to learn what mam taught them - if you take it, put it back where you got it from when you're finished. Applies to both stuff around the house and RAM.
Yeah we know that you, and you a
Re: (Score:2)
Rust is memory safe. You just don't know what that means. You are not qualified to comment here.
Re: (Score:2)
Re: (Score:2)
Bzzt wrong. Rust isn't a "religion", it's a modern programming language that detects and prevents many of the mistakes that C/C++ allow to enter production code without any loss of performance.
Some people recognize this to be a good thing while others seem threatened by it for some weird reason though I can't fathom why. Is it because they like broken code going to customers / end-users? Do they want extra CERT advisories? Or do they consider themselves Super Programmer who can do no ill? Are they so inflex
Re: (Score:2)
Because you believe that the solution to C's security problems is to kill it off and replace it with Rust. I'm not going to argue one way or the other about that here; but if that's the premise, then re-writing the OS and its utilities seems to make some sense since C and Unix have been joined at the hip pretty much since inception.
Re:why? (Score:5, Funny)
Because you believe that the solution to C's security problems is to kill it off and replace it with Rust.
I understand, there are serious security problems with the C core utilities. For example, someone hacked me through an internet post by telling me to run "rm -rf /". I did, and you wouldn't believe the problems it caused!
I'm happy to know that they are replacing these utilities with Rust, and that will never happen to anyone again.
Re: (Score:3)
Fortunately, someone developed a security tool called sudo. Everyone should use it to protect their computer from untrusted commands. Simply run "sudo $COMMAND" and enter your password. :)
Re: (Score:3)
Re: (Score:3)
uutils aims to work on as many platforms as possible, to be able to use the same utils on Linux, Mac, Windows and other platforms.
I though it was not really a problem these days.
Re: why? (Score:4, Interesting)
Because the number of people who are scared of C and C++ vastly outnumbers the number of people capable of using those languages to make useful programs.
And the statistics are growing less favorable by the day as people who grew up with very high level scripting languages as "coding" increases in absolute number over time.
Do that enough and you get people whose job is supposed to involve making bits that operate hardware complain that bits and bytes and registers are a social construct dreamed up by K and R that should have nothing to do with computers.
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
>Because the number of people who are scared of C and C++ vastly outnumbers the number of people capable of using those languages to make useful programs.
That's a great observation, I hadn't though about it like that till you mentioned it. Which is odd since I've spent the last thirty years in C, and expect the next 20 to be the same.
Re: (Score:2)
>Because the number of people who are scared of C and C++ vastly outnumbers the number of people capable of using those languages to make useful programs.
That's a great observation, I hadn't though about it like that till you mentioned it. Which is odd since I've spent the last thirty years in C, and expect the next 20 to be the same.
I agree. While I have standardized on Python with C modules (in case any heavy lifting is required), C will not go away, nor should it. It will just be a tool for people that know and can do more than the average pathetic "modern" coder.
Re: why? (Score:5, Insightful)
Because the number of people who are scared of C and C++ vastly outnumbers the number of people capable of using those languages to make useful programs.
You do understand you are talking about Sylvestre Ledru whose history includes developing for Debian and LLVM. I am pretty sure he is not "scared" of C and C++.
And the statistics are growing less favorable by the day as people who grew up with very high level scripting languages as "coding" increases in absolute number over time.
I am not sure of your background is in computer science but almost no one I know would call Rust a "scripting language".
Do that enough and you get people whose job is supposed to involve making bits that operate hardware complain that bits and bytes and registers are a social construct dreamed up by K and R that should have nothing to do with computers.
I read all of that to say: "I don't like change."
Re: (Score:2)
Re: (Score:2)
You seem to have lost context or never gotten it.
Re: (Score:2)
Re: (Score:2)
Because the number of people who are scared of C and C++
But that's not a bad thing. It'll keep them from getting into things that they probably shouldn't be tinkering with in the first place.
Re: why? (Score:4, Insightful)
Sadly neither Rust nor any other language will solve that problem. Most of the problems with C (and its derivatives) stem from the "code first, design never" philosophy that so many organizations adopt.
Re: (Score:2)
Bullshot. That has nothing to do with C and does about the same damage with Rust (or any other language). Have a look at all the Rust CVEs some time. It is pretty enlightening for a supposedly "secure" language and the number of CVEs is just unacceptable for a niche language.
Re: (Score:2)
Hmm. In retrospect I am not sure I understand your posting. Are you saying C is not the problem but the people using it are and that holds for any other language as well? If so, I completely agree.
Re: why? (Score:5, Interesting)
Because the number of people who are scared of C and C++ vastly outnumbers the number of people capable of using those languages to make useful programs
I, for one, am in both of those sets.
This is just like using dangerous tools such as table saws. No matter how much experience you have using the tool, if you're not still scared of it, you're eventually going to end up a statistic.
Personally, even though I've used C and C++ for decades, I hate those languages and never intend to use them again if I can help it. Why deal with the stress of trying to avoid all of the pitfalls? Having said that, for me Rust would be a last resort only needed if performance absolutely demands it. Writing Rust code is a PITA because it relentlessly forces you to do all of the things that you should have been doing with C/C++ but almost certainly aren't.
Realistically, other languages with easier-to-use memory models are plenty fast enough for most applications. The "ls" utility isn't so crucial that you'd notice any difference if you wrote it in Go, for example, especially if you understand how garbage collection works and how to avoid creating much garbage in the first place.
Re: (Score:3)
Would you advise doing carpentry without table saws and all the other dangerous tools a master carpenter uses routinely? See the problem with your argument?
Re: (Score:2)
No, you weren't able to comprehend my argument.
I was pointing out that you should not ever lose a healthy fear of dangerous tools, since the OP was insinuating that people "afraid" of C/C++ are incompetent and/or wimpy.
But if you want more analogies, carpenters use circular saws more often than table saws, because they are more convenient and arguably safer. Few carpenters argue that just because table saws are able to do some jobs that other tools can't, that everyone should *always* use them or else they'
Re: (Score:2)
But if you want more analogies, carpenters use circular saws more often than table saws, because they are more convenient and arguably safer.
Everyone I know who uses a circular saw regularly eventually cuts themselves.
Re: (Score:2)
Actually, chisels produce far more injuries than table saws, or even hand held circular saws. People are wary of the latter.
But I remember back in the early 1980s thinking nobody would be silly enough to use C for serious programming because it was like using a hand held circular saw with all the guards removed.
Re: (Score:2)
it was like using a hand held circular saw with all the guards removed.
There are plenty of people who do that, too.
In the modern world, there are actually more guards for c++ with stack guard, ASLR, etc, meaning C++ is not easy to exploit these days.
Re: (Score:2)
Hahaha, nope. Your argument is disingenuous from start to end. Of course I was never talking about a "naked" table saw and C does not resemble one these days either. You are just trying to defend an indefensible point and hence you are bending and torturing your "arguments" as far as you think you can go without being too obvious. But here is news for you: People like me can tell.
Re: (Score:2)
I was never talking about a "naked" table saw and C does not resemble one these days either.
Well, that statement proves that you know absolutely nothing about software development and should not be allowed anywhere near a computer.
Re: (Score:2)
No, you weren't able to comprehend my argument.
Interestingly I've met people like the GP, when I was a member of a local hackspace. There was a definitely pervasive mentality that you should be using a power tool if it was an option. I did stop people making a few massive messes, though one person did get quite aggressive when I attempted to prevent him from ruining something rather expensive.
Table saws give me the heebie jeebies.
So now we have Rust available, which is much like a Sawstop table saw. If I we
Re: why? (Score:2)
Because the number of people who are scared of C and C++ vastly outnumbers the number of people capable of using those languages to make useful programs.
How about people who are both? I've been programming in C and C++ for years now, and the older I get, the more fearful I become and, unless the code is a very critical path, fill it with asserts, smart pointers, stronger types, and anything else that I can use to protect myself against C's overly permissive semantics.
I don't know about Rust, but from the little I've read, it seems to do default to these asserts, but still allowing "unsafe" code to be declared and run as fast as C.
In that case, I can really
Re: why? (Score:2)
Actually the tooling in rust is really good. Easily the best of any language I've used. Installing the entire toolchain is one command, and starting a ready to compile and run project is one command (even creates the directory for you.) Practically no effort at all to get started. Then the compiler gives you error messages in plain English, even laying out exactly what's wrong with your code, and the styling lints from cargo clippy even offer in-place corrections.
Re: (Score:2)
Re: (Score:2)
The tooling is fantastic and easily one of the best things for Rust, especially coming from C/C++ where the tools are dogshit. Even if you use CMake and vcpkg / conan it doesn't hold a candle to rust & cargo.
Re: why? (Score:2)
I recall you admitting rust is the first and only language you know.
Systems language maybe, but certainly not the only language. Also I have a relatively high standard for what I consider to be for "knowing" a language. I've written programs in C and C++, but I don't claim to "know" either language. Other languages besides Rust that I "know" are C#, golang, java, PowerShell, and bash.
But the built-in building facility and packaging thingy is itself a good show of what to expect from rust: A full-service environment, arbitrarily different from what's already available, that doesn't play well with others, whatever they claim to the contrary.
Doesn't play well how? It will interop just as well as anything else. You can use makefiles if you really want to do so. You can call into other languages from rust, and you can call into rust
Re: (Score:2)
but C developers getting pissed off because somebody is creating their own implementation of the coreutils in a language other than C.
They've been doing this for years. A lot of C developers pour vitriol on anything that might displace the Holy C. It's been the same with C++ in the past as well.
Re: (Score:2)
"Doesn't play well with others".
A weird thing to say since it is straightforward to call or be called by C. I have absolutely no issue calling clib, Win32, OpenSSL from Rust and if my code was exposing endpoints it would be no problem to generate a .h file so that others could call them.
Re: (Score:2)
Frankly, the only thing deterring me from doing so are old age, lack of jobs, and rumours of shitty tooling and compatibility breakage
I can't speak to lack of jobs, as that isn't a problem for me. But, I'm quite old and switching to Rust for almost all of my new work has been the best choice for a primary computer language that I've made in my long career. Also, the tooling is great and Rust has an excellent story to tell with regards to compatibility.
Re: (Score:2)
I don't consider my fear paralyzing though. I get work done, I get work done that's impossible to get done in Python/Java/whatever's limitations (slowness, lack of libraries, non-maintainability, lack of good typing. However, I also constantly feel that there's room for improvement in the C/C++, we're far from the pinnacle.
Re: (Score:2)
Or is this just a vanity project because they aren't in some developer's favorite language? If that's the case, why should anyone care?
Sounds like a pointless vanity project to me. But ultimately it is a developer's right to work on whatever he wants - assuming it's during his own free time.
Re: (Score:2)
As far as I know, they are already efficient, secure, and cross-platform.
Without being familiar with this project myself, you stated a possible reason why in your first four words here. We've repeatedly seen vulnerabilities show up that nobody knew about for decades. Some people, in their arguments against rust in general, like to argue that rewriting something in itself almost always results in a better outcome anyways, regardless of the language, even if it's the same language. That may in itself be an argument in favor of this project given the core utils are so central to ev
Re: (Score:2)
1) Rust is actually a fun language to work with (something even well known developers like John Carmack have stated, so I'm not alone here)
That reason falls into the realm of vanity project.
2) Rust's focus on correctness helps you ensure that your chosen algorithm is sane, even if you ultimately don't use the language
Again, without evidence of rampant security holes, that reason also points to it being a vanity project for utilities that have had many many eyeballs on them already.
Re: why? (Score:2)
I've still yet to see how any of this is a bad thing. I can only see potential good things coming from this. Why is everybody complaining about it? That makes no sense at all.
Re: (Score:2)
That reason falls into the realm of vanity project.
Nope because Rust is a practical and productive environment too.
Again, without evidence of rampant security holes, that reason also points to it being a vanity project for utilities that have had many many eyeballs on them already.
I don't know the rationale for this project but you don't have to look far in the CERT DB to see vast swathes of bugs caused by C programming errors. If I were starting a new project, or essentially scrapping / rewriting from scratch and my choices were C, C++ or Rust I would more than likely choose Rust. There would have to be a damned good reason not to choose it.
As far as this project goes reasons might just be a) to see if it can be done, b
Re: (Score:2)
Vanity project of a virtue-signaller. Best to stay away, this will not match the quality or support-level of the originals.
Re:why? (Score:5, Interesting)
> As far as I know, they are already efficient, secure, and cross-platform.
I don't know - I spent the day yesterday tracing down a segfault with `enscript` - yes that gnu utility from the 90's.
I have a 2-line input file that will crash it; I wasn't bored enough to stuff some shell code in there but maybe I'll try at some point, for giggles.
Fortunately I found a fix to bounds checks that somebody figured out a decade ago (after I found the failing routine with gdb) but apparently nobody is doing commits anymore. The git source won't even build today without two small patches I worked out yesterday.
Anyway, don't assume the gnu tools are getting the basic level of attention one might assume, is my only point. I don't know how many don't have maintainers at this point. A bunch of people noped out after RMS's shenanigans.
Redundancy has its own value as well.
Re: (Score:2)
Was there something fundamentally wrong with the core utilities that have had multiple decades of development and refinement that they need replacing? As far as I know, they are already efficient, secure, and cross-platform.
Well, at least it is not re-implemented in JavaScript. Oh, wait [github.com]
Re:why? Why not? (Score:2)
Why the hate? If someone finds it an interesting challenge to rewrite coreutils in Rust, what's wrong with that? They're the one doing to coding, not you. For example, years ago, someone/some people did something similar in Perl (https://metacpan.org/release/CWEST/ppt-0.14). No-one was complaining then about Perl being a kind of religion or whatever. No-one was asking what was fundamentally wrong with coreutils so as to require it. It's a good exercise in Rust or any other language, and a good source of ill
Re: (Score:2)
I think there's too much stereotyping of millenials and zoomers. I'm a boomer (though I wasn't when I was born - someone changed the definition to include me afterwards), and the millenials and zoomers I've worked with are great. Mind you, self-selection is at work on both ends - none of us want to hang out with self-absorbed idiots, whether they're boomers, millennials, zoomers, or whatever.
Re: (Score:2)
Why? (Score:2)
Re: (Score:2)
My guess is that they could get rid of the pesky GPL license and have a more corporate-friendly license instead or whatever.
Re: (Score:2)
My guess is that they could get rid of the pesky GPL license and have a more corporate-friendly license instead or whatever.
You do know that coreutils are just separate programs, not something you'd ever want to link to? Thus making GPL's virality irrelevant?
Re: Why? (Score:2)
Safe (Score:3)
Those who do not understand Unix... (Score:2)
Re: (Score:2)
Indeed. Unfortunately, there are now so many morons in the Unix-space that these idiots do not get laughed out of the room anymore ad they would deserve.
Re: (Score:3)
I do understand Unix ... and would rather see someone reinvent VMS.
IMHO, that would have been a more interesting.
Re: (Score:2)
Re: (Score:2)
Let it blow, let it blow, let it blow (Score:2)
Oh, the Linux source code is frightful
But the C core utils are so delightful
And since Rust fanboys have no place to go
Let it blow, let it blow
The goal is quite clear at the end of the page... (Score:2, Informative)
The goal is quite clear at the end of the page, and it's one of replacing the GNU GPL (sort of like a constitution) with a license that allows the commons to be reduced.
"uutils is licensed under the MIT License - see the LICENSE file for details
GNU Coreutils is licensed under the GPL 3.0 or later."
Actually Rust-based would be the larger commons (Score:4, Insightful)
The goal is quite clear at the end of the page, and it's one of replacing the GNU GPL (sort of like a constitution) with a license that allows the commons to be reduced.
"uutils is licensed under the MIT License - see the LICENSE file for details GNU Coreutils is licensed under the GPL 3.0 or later."
Actually it allows for a larger commons as commercial users are not excluded. You are free to argue why a smaller commons is more virtuous(*), but you are not allowed to misrepresent a smaller commons as the larger commons.
FOSS > CopyLeft
(*) "More virtuous" is a matter of debate, of dogma. I'm not interested in debating your religion, I just want *nix.
Re: (Score:2)
Actually it allows for a larger commons as commercial users are not excluded.
90s microsoft called and they want their bullshit back.