10 ms·
What's the advantage of this over PowerShell?
by xnyanta 4y ago
What's the advantage of this over PowerShell?
- tosihakkeri 4y agoThis is written in Rust /s
- avgcorrection 4y agoNo, that’s not mentioned as an advantage on the website.
- k0k0r0 4y agoI assume the parent comment did not make fun of nushell advertizing this, but instead about the rust community advertizing itself all the time.
- huimang 4y agoTo be honest, they have good reason. Being written in a strongly typed, memory-safe language is a huge advantage. Obviously it's not the primary thing to look out for, but I do prefer tools that are written in it.
- zozbot234 4y ago> Being written in a strongly typed, memory-safe language is a huge advantage. Great point, C# is a strongly typed and memory-safe language if you don't use unsafe. So this really is a huge advantage for PowerShell.
- vips7L 4y agoThere are plenty of strongly typed memory safe languages. In fact I think those are the majority of popular languages.
- HervalFreire 4y agoOf course the person you're replying to is talking about languages without a garbage collector. Systems languages with zero cost abstractions.
- vips7L 4y agoBut why? There is nothing about a shell that requires zero cost abstractions or no gc. It farms all of its work out to other executables. A shell could be written in literally any language.
- triyambakam 4y agoI'm not really sure which other popular languages would be considered memory safe AND strongly typed. I know of both C and C++ which I wouldn't consider memory safe. And I know of Javascript, which is not strongly typed... so which do you mean?
- vips7L 4y agoJava, Scala, Kotlin, C#, D, Go, and TypeScript to name a few.
- intelkishan 4y agoEven Python fits the bill.
- scns 4y agoOf those only D and Go build self contained binaries (yes i know about Graal/Kotlin Native/.Net AOT). No snark intended.
- vips7L 4y agoThis is moving the goal post a bit, since the person I replied to was considering JavaScript, but I don’t really think this distinction matters. You get most programs from a package manager. I am curious though why you don’t count graal or .net aot? They are valid options to produce an aot binary and C# has been able to produce a self contained non-aot runtime for a long a time.
- operator-name 4y ago- Better errors - Native support for JSON, etc (no more ConvertFrom-* ConvertTo-*) - Less verbose - Different visualisation
- Kwpolska 4y agoPowerShell isn’t that verbose, compared to NuShell. The ls example would be (with standard PowerShell aliases): gci | where { $_.Length -gt (10 * 1024 * 1024) } | sort LastWriteTime -gt might seem weird, but it’s better than overloading >. (Also, I like the fact that PowerShell is built into Windows and has a large corporation behind it.)
- qorrect 4y agoSorry but that looks terrible.
- Kwpolska 4y agoWhat about it looks terrible? The braces are necessary, because this is a lambda.
- doodlesdev 4y agoI'd say that $_ is really weird and looks horrible. Also having to do (10 * 1024 * 1024) instead of just writing 10MB is a downgrade even compared to POSIX-compliant sh. In my other comment I've added a few examples in sh, zsh, and a better PowerShell example: gci | ? Length -gt 10MB | sort LastWriteTime
- deleted 4y ago[deleted]
- vips7L 4y agoYou don’t need the lambda. Where-Object can just take the Length property.
- ripley12 4y agoRecycling my comment from last time this came up. Some reasons I prefer Nushell over PowerShell: - less verbose syntax - better cross-platform support (PowerShell is technically cross-platform, but it has some baggage from its Windows-first history) - way faster to start up I'm biased (I'm a member of the Nushell core team), but those are all things that drew me to start contributing to Nushell. On the other hand, Nushell is certainly less mature+stable than PowerShell. And if Windows administration is your main use case, PowerShell can't really be beat.
- Karellen 4y agoNuShell is properly MIT-licensed, and is therefore Free Software. Powershell is kind of MIT-licensed, except for the parts that aren't but are still an integral part of it, so not really, and is therefore not Free Software. At least, it's not DFSG-free. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834756 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834756 https://github.com/PowerShell/PowerShell/issues/5869 https://github.com/PowerShell/PowerShell/issues/5869
- waf 4y agoJust for reference, the PowerShell version of this would be: ls | where Length -gt 1mb | sort LastWriteTime
- 0xfeeddeadbeef 4y agoHeads-up: if current directory contains other directories, this will fail. You'll need to adjust the filter: ls | where { -not $_.PSIsContainer -and $_.Length -gt 1mb } | sort LastWriteTime