Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Nushell 0.85 (nushell.sh)
39 points by milliams on Sept 19, 2023 | hide | past | favorite | 15 comments


Anybody have a good breakdown of the philosophical/implementation differences between nushell and oil?

After using PowerShell at a job recently I'm interested in dipping my toe into using these kinds of projects, but my websearch skills seems like they're getting worse these days, haven't found a good comparison yet.


Nushell seems like it's really its own thing. It works with commands that output tabular data (and provides tabular versions of the most popular commands) and then provides functions to query that data. It's more of a query language in your shell than a regular old shell language.


pwsh can be installed on *nix nowadays...

I use nushell as my daily driver but I've tried a few "alt" shells over the years, from fish to xonsh and now nushell.

oil is really two different languages, OSH and YSH. OSH is basically aimed at replacing bash with little to no code changes, just less idiosyncrasies in the interpreter. If you like the idea of using shell scripts for building/controlling critical components but hate the idea of using ([db]?a)?sh then osh is probably a good option. I have not personally used YSH as a daily driver shell.

xonsh is aimed at people who like Python so much that they want to have a Python-esque shell and it's quite nice, although sometimes it's not exactly obvious when you should switch to raw Python eval mode when it comes to the nitty-gritty (or should you just write a Python script at that point?).

fish is really nice, specifically aimed at interactive use. Includes a lot of features out of the box. If you're looking to try any interactive shell, I recommend starting with fish. I've come very close to switching back to fish during my adventures with both xonsh and nushell. Subprocess support is.. As far as I know, still quite lacking. There are workarounds for 90% of use-cases of subprocesses, though.

nushell could probably be described as heavily PowerShell inspired, but written in rust. The syntax has changed several times, it's quite experimental. One of the most annoying things about nushell is that it has built-ins that override things like ls, rm, etc. and you have to use ^ls ^rm etc. to break-out of that behaviour (or get used to the "nu" way). I believe the main reason for this is because nu pipelines aren't just working on streams of text. See https://www.nushell.sh/book/pipelines.html#behind-the-scenes for better explanation.

If you used PowerShell and simply enjoyed using PowerShell specifically, then you can also install pwsh on *nix. Perhaps the main downside is that most tutorials, modules etc. are written with Windows in mind, but as a shell it works perfectly fine.


Thanks, that's a great breakdown. I'm not too worried about libraries, as I try to avoid importing code willy nilly, but have you used pwsh extensively on nix? How powerful is the object/data model when it doesn't have access to COM/.NET/etc? Does it create integrations/reimplementations for distinctly nix things like device files? Or will I basically be writing a lot of compatibility layers to get raw text into structured data?


My use of non-Windows PowerShell is mainly used to sanity checking scripts that are destined to run on Windows boxes, where I want to quickly check the semantics of certain OS agnostics behaviour without firing up a remote desktop to a Windows VM.

Running things like:

Get-Item -Path ./ | ConvertTo-Json

$my_bytes = @(Get-Content -AsByteStream -TotalCount 16 /dev/urandom)

work exactly as you'd expect them to on *nix. I don't have procfs on my system but I imagine that would work just the same as interacting with any other file.

PSDrive works the same as you would expect, including things like reading/manipulating ENV via the "Env:" PSDrive.

I can't think of anything off the top of my head that you can do in Bash that you couldn't do in PowerShell.


Nushell seems more like a clean break. (And I say good riddance.)


Related:

Nushell and Uutils - https://news.ycombinator.com/item?id=37560121 - Sept 2023 (17 comments)

The case for Nushell - https://news.ycombinator.com/item?id=37313733 - Aug 2023 (141 comments)

NuShell: A New Type of Shell - https://news.ycombinator.com/item?id=36313694 - June 2023 (15 comments)

Writing Shell Scripts in Nushell - https://news.ycombinator.com/item?id=36084564 - May 2023 (2 comments)

Nushell.sh ls | where size > 10mb | sort-by modified - https://news.ycombinator.com/item?id=35124056 - March 2023 (203 comments)

Nushell: Introduction to a new kind of shell - https://news.ycombinator.com/item?id=33419944 - Nov 2022 (247 comments)

Nushell 0.60 Released - https://news.ycombinator.com/item?id=30772042 - March 2022 (40 comments)

Nushell: A New Kind of Shell - https://news.ycombinator.com/item?id=30718349 - March 2022 (8 comments)

GitHub – nushell/nushell: A new type of shell - https://news.ycombinator.com/item?id=27525031 - June 2021 (398 comments)

Nushell: A New Type of Shell - https://news.ycombinator.com/item?id=26712741 - April 2021 (2 comments)

One Year of Nushell - https://news.ycombinator.com/item?id=24259914 - Aug 2020 (47 comments)

Nushell – A New Type of Shell - https://news.ycombinator.com/item?id=22880320 - April 2020 (37 comments)

Introducing nushell - https://news.ycombinator.com/item?id=20783006 - Aug 2019 (369 comments)


It seems that Nushell is following the ZeroVer versioning scheme[0].

[0] https://0ver.org/


I know it's still kind of early days for nushell but recently, nushell has broken env/config format a couple of times.

If you use this as your main shell, that's annoying and frustrating. I know it's "ZeroVer" but I'd rather they at least warn first "this syntax will be unsupported in the next version" or something.

A shell can be like a second home, you don't want to upgrade your home only to find that a meteor has immediately crashed through the roof.


Maybe some of these parody site authors should contemplate whether SemVer is a good versioning scheme, given the empirical reality.


nushell seems to be breaking some APIs in each release from what I've seen, so it is quite unstable and is using semver appropriately.


They still do breaking changes, so it's probably for the best.


Why is there no Debian or Ubuntu package or ppa listed? Will homebrew work on Ubuntu?

Maybe trendy people stopped using Ubuntu and Debian already? If so what do they use now?


I wouldn't recommend trying nu unless you're willing to live on the bleeding edge, but if you're already on the bleeding edge, I would recommend using rustup to install rust and cargo to install nu (then you can use cargo-update to keep nu up to date).

https://crates.io/crates/nu

https://lib.rs/crates/cargo-update


> Will homebrew work on Ubuntu?

Yes, brew works well on any x86 Linux distro (doesn't support ARM yet, sadly).

> Why is there no Debian or Ubuntu package or ppa listed?

Packaging for every distro is a lot of work, and the Nu core team has had other priorities. I think we'd like to have Debian-specific packages eventually but that will probably require some work by a motivated contributor. In the meantime we publish binaries, and it's fairly easy to build from scratch or use Homebrew.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: