I remember some people expressing how annoyed they were with people reimplementing standard command line tools in Rust. But here is the reality of such reimplementations: hachyderm.io/@cliffle/11332081…
It isn’t just the memory safety. The reimplementations typically turn out much simpler, partly because of a more high-level language and partly because of usable dependency management.
If you have 20 times less code to maintain, you can do a lot more with it. Adding “nice to haves” like output coloring in C requires considerable effort, improving usability of these tools in Rust on the other hand is a no-brainer. That’s e.g. why duf and dust can present the output better than df and du.
And there are performance wins at almost zero cost. That’s partly due to relying on well-optimized libraries instead of own reimplementations (yes, dependency management again). But taking advantage of multi-threading and modern CPU features seems much easier in Rust as well.
cliffle (@cliffle@hachyderm.io)
There's a handy command line tool, fdupes, for scanning a filesystem for duplicate files and optionally removing them. It's about 6kloc of C. That seemed like kind of a fun little toy problem for this evening, so I wrote a little work-alike in Rust.Hachyderm.io



brabitom
in reply to Gina • • •