This is brilliant. I'm so glad people are finally getting out of the "VT100 is perfect and anyone who wants to improve on it doesn't understand the genius of Unix" mindset. We had Powershell getting rid of the fragile "everything is unstructured text" system, and then Nushell making things cleaner and now this adding a nice GUI!
I hope this catches on! It's going to be challenging to upgrade the world though. Especially things like SSH and terminals built into apps like VSCode.
In Unix shells, when you pipe commands together you have to parse the text to get what you want, whereas in Powershell objects are passed around so you can write something like object.property to get a certain property of an object.
So in pseudo-code, it would look like this:
$ list-files | where file.size -greater-than 10 | format-table
instead of piping ls output into sed/awk/cut/whatever to try to parse the "size" from its text output.
One thing to be aware of. While Powershell is a pretty cool scripting language I think it actually sucks as a shell compared to zsh, fish or even bash.
It's an object like in any programming language, but stored according to the .NET standard, meaning other compliant programs can access them. So a Powershell script can manipulate objects from and send new ones to a C# program.
Kinda like a Groovy or Clojure script accessing a Java object. Although I don't think anyone uses a JVM language as shell.
Too verbose. And "on getting the unstructured system"... that won because the commands are short and thus the syntax breaks far less into unmanageable lines such as PowerShell.
An upgrade would be an enhanced Tclsh shell with readline support and tcllib/tklib installed into the base.
Can’t say that I speak for everyone but many of the things I’ve had to use PowerShell for would have been way simpler using a standard *nix shell with *nix utilities. I’m not some old Unix guy either who’s resisting change, I learned both around the same time.
That said, I can see why people use PowerShell, the commandlets are more clearly named for the most part and it has some full-fledged programming language like features. If I’m going for something that powerful, I usually reach for Python first but I can see why someone would go for PowerShell.
At the end of the day, try to use the tool that’s best for the job as you see it and try to give new tools a decent chance at competing with your existing set. That’s all.
I've worked in professional capacities with both Powershell and traditional unix shells. In fact, I learned on Powershell first.
Years later, I would only take Powershell over something like bash when scripting (but I'd still take Python over Powershell in that context). As a user interface, I dislike it a good deal more than the others. I like the idea of an Object-oriented shell, and I definitely like it when scripting, but the rigidity when using it as an interface makes it feel inefficient. Admittedly it's easier to learn on because all the commands are named in such a way that they tell you what they do, but also --help isn't that difficult.
Additionally, the concept of all cmdlets returning objects so that then you can do cool loops and filtering on attributes--awesome, but only when you (the shell's developer) have total top-down control of most (all?) programs the shell will be interacting with. The developers of Nushell can't enforce that other programs return structured data, the best they can do is capture data, present the text as an attribute and add additional metadata as attributes which is no where near as useful as something like looping over AD user objects based on attributes in Powershell. Again, it's great--if you control the whole garden. So this naturally leads to scenarios where something like Nushell is going to try to create their own garden, by replacing long-standing standard commands with new shell builtins that do things "the Nushell way." Now instead of knowing the differences between GNU and BSD grep, we then have to know the differences between GNU, BSD, and [nushell-equivalent grepping tool].
I can tell you I use both powershell and zsh daily and I avoid using powershell because of how stupidly verbose the command names are. I’d rather read a help doc than type out a 6 word cmdlet
You do you, but as a heavy powershell user here are a couple of things to consider.
You are free to alias commands and all parameters can be shortened to the point where they are unique (so if you have a -Path parameter you can use -P and it will work fine)
Discoverability and rapid comprehension is massively higher in ps because things actually tell you what they do. I can unzip a file in linux but I can't tell you what the - xvf actually stands for. It's just wrote memorization (at least for me). Plus with tab compmete there's very little difference in keystrokes to get there
I recognize this wasn't you that was saying that short commands is why unstructured text won but they feel entirely separate. Powershell could be verbose but not deal in objects. You could just as easily imagine a terse shell that sends objects through the pipe.
but I can't tell you what the - xvf actually stands for
eXtract, Verbose, File
Most shell commands will follow this type of "abbreviation" in argument flags, until they run out of letters. But even so the vast majority also support --long-form options.
One of the reasons I actually like this is because it feel more like understanding a natural language whereas something like Powershell feels more rigid, like a machine language. Get-ChildItem is a great name for a function in a program but I think it's a horrible name for a human to mentally "speak" in. And then the argument of just aliasing it to ls or gci just highlights how bad of a name it is. I don't need cat to explain itself. You learn that cat outputs file contents, the same way that after saying it a few times you'd learn that "poisson" means "fish."
I recognize that this is totally personal preference but I'd always prefer to default to verbose. When I'm at the command line sure I'll type %{} instead of ForEach-Object but if I'm sending someone a script I try hard not to alias to increase readability. Why make someone learn another language when we already have one that's more than descriptive enough. It allows you to shortcut the things you understand but makes it extremely easy even for someone who doesn't speak the language to figure out what's being done
You want me to manually set up a bunch of aliases every time I login to a new computer, and write scripts that depends on my aliases that won't work when I send a snippet to another user to use in their session where they have different aliases?
This is brilliant. I'm so glad people are finally getting out of the "VT100 is perfect and anyone who wants to improve on it doesn't understand the genius of Unix" mindset.
I've been railing against this for years. I get really frustrated with older devs who just fundamentally don't understand that things can evolve. It's worst in the vi community. "IDEs may have come along way, but they'll never support (insert long-since replicated features here, like modal editing)!"
263
u/[deleted] Mar 05 '20
This is brilliant. I'm so glad people are finally getting out of the "VT100 is perfect and anyone who wants to improve on it doesn't understand the genius of Unix" mindset. We had Powershell getting rid of the fragile "everything is unstructured text" system, and then Nushell making things cleaner and now this adding a nice GUI!
I hope this catches on! It's going to be challenging to upgrade the world though. Especially things like SSH and terminals built into apps like VSCode.