News for hackers. Stuff that matters.
Re:Introducing nushell by sk5t on Friday August 23, 2019 @10:00PM (#20784696)
So, if you're not a fan of the UNIX philosophy, maybe check out Powershell. Or take a look at WMI and DCOM in Windows. Eschew shell scripts in favor of strongly-typed programs that process strongly-typed binary formats, or XML, or whatever. The alternatives are out there.

"Worse is better" isn't for everyone.

Re:Introducing nushell by JohnBooty on Saturday August 24, 2019 @02:53AM (#20785691)
Nushell does not seem like a violation of the unix philosophy, or at least the version of it that I like best.

"Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface."

Perhaps I'm wrong, isn't nushell simply adding one more dimension?

Instead of a one-dimensional array of lines, the standard is now... a two-dimensional array of tabular data. Perhaps it is not strictly a "text stream" but this does not seem to me to be a violation of the spirit of the message.

Simple line-based text streams are clearly inadequate IMO. 99.99% of all Unix programs output multiple data fields on one line, and to do anything useful at all with them in a programmatic fashion you wind up needing to hack together some way of parsing out those multiple bits of data on every line.

    maybe check out Powershell
I left Windows right around the time PS became popular, so I never really worked with it.

It seems like overkill for most/all things I'd ever want to do. Powershell objects seem very very powerful, but they seemed like too much.

Nushell seems like a nice compromise. Avoids the overkill functionality of Powershell.

Re:Introducing nushell by pmarreck on Saturday August 24, 2019 @11:04AM (#20787501)
Semantically, a one-dimensional list/array of “things” can be trivially transposed into a series of lines with a linebreak separator, but I don’t think the same holds true for a “list of lists” (2-dimensional data) or a “list of lists of lists” (3D data) etc. At least without a standard begin-end list delimiter that allows nesting.

Just thinking about a way that perhaps an old tool can be “wrapped” to be tricked into working with 2+-dimensional data by somehow divvying up the 2+ dimension input data into concurrent 1-dimensional streams, but this seems to require a way to represent more than 1 dimension of data without breaking existing utilities (unless there was, like, a wrapper/unwrapper layer that handled this...)

Re:Introducing nushell by reilly3000 on Friday August 23, 2019 @11:11PM (#20784987)
It’s worth noting that Powershell is available on Linux. Objects are pretty cool. https://docs.microsoft.com/en-us/powershell/scripting/instal...
Re:Introducing nushell by twblalock on Saturday August 24, 2019 @01:37AM (#20785453)
It works pretty well on the Mac now, too.
Re:Introducing nushell by oblio on Saturday August 24, 2019 @05:14AM (#20786129)
"Worse is better" is not some absolute truth or philosophy and *NIX has won: Android, MacOS, WSL.

There's no real alternative for many profesionals, if they want to be employable.

Maybe we should accept this fact and try to make everyone's life easier than be stuck up and push people away.

There's no law that says that Unix tools can't be extended.

And heck, basic POSIX tools violate so many Unix principles...

Re:Introducing nushell by natermer on Saturday August 24, 2019 @06:15AM (#20786322)
When perl came along it killed the 'Unix one tool philosophy' dead as a doornail. And since then and people have just kinda ignored the smell coming off the rotting corpse.

I don't write complex scripts in shell anymore because it's insanity. But ad-hoc loops and crap like that... hell yeah. At least a few a day. Sometimes dozens.

People need to be reminded, I think, that shell isn't a programming language first. It's a user interface. And when I look at Powershell scripts and other things of that nature and think about living in Powershell day in and day out I don't see the big pay-off over something like fish.

'Is this going to make it so I can get my work done faster?'

'Is this going to be more pleasant to use as a primary interface for a OS?'

When I go into fish or zsh and use curl to grab json and 'jq' to get a idea of how to use the API in python or node...

versus running 'curl' in powershell against some random API I have never used before..

I get the distinct impression that 'This is fucking garbage' in that It would take me a lot longer to figure out how to use powershell in a useful way then the time I would save by doing so in the long run.

Re:Introducing nushell by progman on Saturday August 24, 2019 @07:48AM (#20786603)
The irony is that the very attempt to be one tool for everything caused Perl's own destruction. Perl 5 is still used by some veterans for small scripts but who wants to use Perl 6?

Unix follows the KISS principle, and that is key for success. Albert Einstein said: "Keep things as simple as possible but not too simple". In that sense Unix and Posix are well done. However, that doesn't mean that good ideas like Nushell are not welcome.

Re:Introducing nushell by ak217 on Saturday August 24, 2019 @11:32AM (#20787704)
I think the failure of Perl 6 was caused by a lack of community building and implementation leadership, not by trying to be too many things at once.
Re:Introducing nushell by 0x445442 on Saturday August 24, 2019 @10:11AM (#20787205)
Yeah, I tried using Powershell as my shell and that's when I found out Powershell is more about the scripting language than an optimized shell used for everyday use. I was confronted with this almost immediately because one of the things I rely on most in Bash is 'dirs -v', pushd and popd. I have dirs aliased to dirs -v and I usually have 15-20 paths on my stack. I'll leave implementing the same functionality in Powershell as a user exercise.
Re:Introducing nushell by oldmanhorton on Saturday August 24, 2019 @11:36AM (#20787734)
Im confused... Why doesn't Push-Location (aliased to pushd by default), Pop-Location (aliased to popd by default), and Get-Location -Stack (trivially aliasable to dirs) not work? You can even have multiple location stacks and, if you care about the registry, you can also use the same commands to handle registry navigation as well.
Re:Introducing nushell by 0x445442 on Saturday August 24, 2019 @06:39PM (#20790152)
‘dirs -v’ shows an enumerated list of directories. If I follow that up with pushd +11 I will be taken to the 11th path listed in the prior dirs command. As far as I know this isn’t implemented out of the box in PS
Re:Introducing nushell by jen20 on Saturday August 31, 2019 @07:27AM (#20845696)
An addition to `{Push,Pop}-Location` - `Get-Location -Stack` will show the current directory stack. I don't know offhand of a way to get the equivalent of `pushd +11` though.
Re:Introducing nushell by nickcox on Tuesday September 10, 2019 @05:23AM (#20926438)
Not out of the box but I wrote a module[0] that gives you `cd+ 11` (and `dirs -v`).

[0] https://github.com/nickcox/cd-extras#navigate-even-faster