top | item 37925966

(no title)

DixieDev | 2 years ago

Nushell is quite nice. Tables are nice to work with and look at, and the cross-platform support is top notch. It feels like what Powershell would have been, had it been designed by people who have actually used a command-line before. The main issues I have are bugs. Most recently, I find that it can't properly handle files with square brackets in the name, which isn't really all that uncommon.

I wouldn't recommend it for day-to-day, production usage just yet, but definitely worth keeping an eye on if you're not a huge fan of the typical stringly-typed shells.

discuss

order

sixbrx|2 years ago

One advantage or Powershell though is that in it you can put something into the pipeline from anywhere in your code, even within imperative code like in the middle a loop, just by mentioning a bare value at nearly any spot. And traditional shells are the same way (though they only support byte streams output), where you can send stuff to stdout/err at any point.

But in nu, it's more like you're just dealing with collections as in most programming languages. If your collection isn't amenable to being generated by a simple expression like a map or fold, then you have to create a collection, prep the collection to be what you want it to be, then you return it.

In that sense it's really different from both Powershell and traditional shells, and more like just using a traditional programming language. So in Nu I miss being able to just "yield" a value from anywhere without staging into a temporary collection first.

hudclark|2 years ago

> if your collection isn't amenable to being generated by a simple expression like a map or fold, then you have to create a collection, prep the collection to be what you want it to be, then you return it.

This release added the ability to "yield" values via a generator fashion. It's called `unfold`, but will be renamed to `generate` in the next release: https://www.nushell.sh/commands/docs/unfold.html.

majkinetor|2 years ago

> It feels like what Powershell would have been, had it been designed by people who have actually used a command-line before.

It is designed by such people. Not sure why PowerShell tables and cross-platform support is not top notch \_(ツ)_/

Effort is salutable, but let's be realistic, Nushell is 10+ years from PowerShell.

bbkane|2 years ago

Maybe in some areas, but in terms of day to day usage, I prefer nushell

goku12|2 years ago

> if you're not a huge fan of the typical stringly-typed shells.

What aspect of the other shells qualify them as 'stringly-typed'? Shells seem quite happy piping raw binary data, and there are commands that can deal with binary streams (like wc). The shell also doesn't seem to do anything with the data, unless specifically asked to do so (eval, backticks, etc). (genuinely ignorant and curious).

Kinrany|2 years ago

"Stringly typed" is usually used as a derogatory term for the alternative to strong typing, which often looks like manipulating raw strings when higher level code would have either better error handling or less boilerplate.

In this sense, dealing with raw bytes is worse.

There is no reason we can't use CLIs that provide higher level operations, but there's just not enough standardization.

lynx23|2 years ago

I think they are refering to the fact that variables are always strings. You can write stuff like i=0;i=$(( i + 1 ) which looks like you are dealing with integers, but in reality, the shell only deals with strings.

kaba0|2 years ago

You know those status bars in dwm and similar window managers? Those are usually generated from a pipeline outputting a line every few seconds or so.

To make it display something as trivial as the frequency of your CPU, the network speed, etc, you have to randomly parse some ad-hoc, program-dependent format that may be locale-dependent! If these could speak a proper language, one could just take the value of this field/object/element and be done with it.