Shouldn't we do things better than Corutils? #6604
Replies: 2 comments 5 replies
-
Maybe we should, but that's what nushell is for! It's just a different kind of project. With this project, all your scripts keep working. It's not a zero-sum game. This project is actually cooperating with nushell! Because we implement things the way people usually expect, nushell can use our implementations in nice structured data. PS. Your examples mostly illustrate how |
Beta Was this translation helpful? Give feedback.
-
First, we think that the only way we will be successful with this project is to be a dropped in replacement for the GNU and other implementations. So, we have to implementation the limitations (spaces in path is a great example btw). We have been adding extensions to improve our implementation: I also would like automatic json exports. However, it would very difficult to define a clear export format for all commands. |
Beta Was this translation helpful? Give feedback.
-
ls -l |grep Jul
lists all files that are created in July but also files that have "Jul" in their file name. And it only works in languages that have the ASCII string "Jul" in the name of the 7th month of the year. So it is a buggy way of working with the shell.ls | grep
is unable to create a list of all authors of all files in the current directory.touch "x y.txt" ; ls | grep "x y" | xargs cat
does not work.ls
produces a list of file names. But the file names cannot simply selected by clicking on them. You must manually select a file name character by character with your mouse cursor.All the Coreutils are based on pure text. They don't understand any sort of data structure. That makes them very limited. Working with them requires workarounds, parsers, regular expressions, awk and loops everywhere just in order to get the data that you want. And due to all these laborious workarounds everything is fragile. Thousands of system internal scripts use human readable ASCII text for things that are only ever intended to be machine readable. But for machine readable data things like JSON or XML would work better. When Coreutils had been implemented, the authors should have asked themselves if this is the right way of working. They did not or at that time it was the right way. When reimplementing Coreutils, we should ask ourselves again if this is the right way of working.
How often have we seen for example a buggy script where the author did not take into account that names can contain spaces? We all know how complicated spaces in file names are. We are all used to avoid spaces in file names, because too many tools are buggy. Being compatible with buggy scripts is no good goal, because then in 40 years we still suffer from the spaces in file names problem. Spaces in file names seem to be one of the biggest problems in computer science.
I don't understand why you really want to reimplement something without any perspective of doing things in a better way. What should users motivate to use uutils if there are things like PowerShell or Nushell, which do things in a much more modern way? Wouldn't the effort be better invested there? And what can we expect from a new set of shell tools for a text terminal, that follows the VT100 standard from 1978?
Beta Was this translation helpful? Give feedback.
All reactions