Live data from Hacker News

Nushell: Introduction to a new kind of shell

dataswamp.org

121–130 of 252 posts

Re: Nushell: Introduction to a new kind of shell

#121

Earlier quoted context omitted.

I really don't want to start up a separate Linux VM just to open up a shell. (I already crossed out Cygwin / MSYS on the list because of performance issues...)

Also, I need to compile actual Windows binaries using the shell (MSVC, clang-cl), and I obviously can’t do that under a Linux VM.

MSVC's command line tools kick off just fine from shell scripts running under WSL2. Much to my surprise. I assume it doesn't run in the VM.

Re: Nushell: Introduction to a new kind of shell

#122

Earlier quoted context omitted.

> PowerShell's huge deviance from the rest of the POSIX-y world doesn't help In PowerShell (on Windows), `rm` is an alias to `Remove-Item`[0]. Therefore, rm -r -fo An extra dash, extra space, and extra letter isn't too bad by my books. Furthermore, in scripts, aliases are discouraged by PSScriptAnalyzer[1]; IDEs (PowerShell ISE, VS Code PowerShell extension) also support code completion, so: Remove-Item -Recurse -For…

why do they alias all this stuff. Remove Item is _not_ rm. It's so stupid. Like when they aliased wget and curl to some nonsense web request command and everybody complained that it didn't work. I'll never use PowerShell. Just way too many bad decisions all over the place.

> why do they alias all this stuff

The alias only exists on Windows. Did you read the linked page?

    The aliases in this table are Windows-specific. Some aliases aren't available on other platforms. This is to allow the native command to work in a PowerShell session. For example, ls isn't defined as a PowerShell alias on macOS or Linux so that the native command is run instead of Get-ChildItem.
`rm` was never an executable on a pure (aka non-MinGW, non-Cygwin, non-MSYS2, non-WSL) Windows console; the equivalents were/are `rmdir` and `del`. Microsoft's position is clear that PowerShell is meant to supersede these old commands, and hence the aliases, but again, only on Windows. I agree that Microsoft made some strange decisions to alias `curl`, etc on other platforms too in PS6, which were reversed for PS7.

These aliases are meant as stepping-stones for POSIX-first people to get their feet wet with the Windows command-line.

Re: Nushell: Introduction to a new kind of shell

#123
post #86

Earlier quoted context omitted.

What are the features that are done differently, or in other words, why would I choose Nushell over PowerShell?

Error messages are great, autocomplete works out of the box, and commands ArentCamelCaseMonstrocitiesOnlyMicrosoft --CouldLove.

> ArentCamelCaseMonstrocitiesOnlyMicrosoft --CouldLove

Personally, CamelCase makes more sense than everythinglowercasesmushedinto -onetwothreefourparametersSometimesCapitalised and --sometimesdoubledashed and -Isometimesspacedoesn'tmatter -and --sometimes - "dashlivesalone" --AND -o -- "twodasheslivealone".

Re: Nushell: Introduction to a new kind of shell

#124

Should probably be switched to the official project page rather than a subpage on an unrelated party website: https://www.nushell.sh/ It’s a lot better at introducing Nushell and feels like a proper landing page.

It doesn’t need to be switched, you can submit the project page anytime.

Re: Nushell: Introduction to a new kind of shell

#125
post #79

>This is just an example from YAML to JSON, but you can convert much more formats into other formats. >open dev/home-impermanence/tests/impermanence.yml | to json I can do it with PowerShell: $os_list = (Get-Content -Path "C:\temp\operating-systems.yml" | ConvertFrom-Yaml) Set-Content -Path "C:\temp\PowerShell_operating-systems.json" -Value ($os_list | ConvertTo-Json)

With any shell: $ brew install yq $ yq -o json .

This... yq eats yaml. And this is all I need to know (really). I don't know yaml. I don't WANT to know yaml.

Two letter command which I can remember, in the same way that I know jq. And, as a short-form jo. I would not use jo to eat json. I do think that yq is "misnamed" slightly, in that there is no yo command.

(note that I do have yq installed, but not nushell or PowerShell).

shell is glue, not oop -- json is an object notation, converted to stringyness. Which makes for oop->shell. Since "objects" are programmer-think, this should not be the primary command interface. People (not programmers) recognize this, and thus PowerShell is not used by "non-programmers". Ok, you want something above bash (sh, shell), for more programming structure? This is why the #! construct is exec() is so important. That lets you use... um awk, sh, (and should support PowerShell -- not sure). Even C (with tiny-c). I would go with javascript, myself, because it fits with json, and thus jq and jo in the eco-system.

Now, for a criticism of yq -- jq is 30K for a front-end and 350K (or so) for a library. jo is 120K, yq is (gulp) 12MB. Ok, I have the disk space. And it is GO, so ok. Compared with the other GO programs I use commonly: minio (100MB), mcli (mc, 20MB), doctl (20MB), it isn't bad at all. But, I guess that is what GO demands...

Can I teach "functional shell"? Frankly, no. I can get through simple shell in a semester.

Re: Nushell: Introduction to a new kind of shell

#126

Should probably be switched to the official project page rather than a subpage on an unrelated party website: https://www.nushell.sh/ It’s a lot better at introducing Nushell and feels like a proper landing page.

These are 2 different types of posts.

1. A new product

2. An independent party's pro/con opinions about that product

This thread is about #2. If you feel #1 has value on its own, post that.

Read both your link and the OP's. While the topic is the same, the content is markedly different.

Re: Nushell: Introduction to a new kind of shell

#127

I just ported a bunch of scripts to nushell. I hit some bugs, a couple of which are a bit sharp, but wow, the list of quirks I have to remember for nutshell are so much fewer than for bash. Constantly impressed at the errors it catches at parse time, kinda crazy sometimes. Oh my god I could cry, strings are sane to work with. I may never write a bash script again (it's okay, I use Nix so I get nushell everywhere I'm…

> strings are sane to work with

Okay, I'll bite - how does it handle filenames with spaces and newlines in them? I have a strong case of Stockholm syndrome with bash because I figured out how to deal with the first one, but I'd love a system that deals with that sanely.

Re: Nushell: Introduction to a new kind of shell

#128
Calling things “new something” is usually a bad idea. It might be new now, but it won’t stay new for long. And then it becomes a lie.

“Newcastle”, “Newport”, “The New iPad”(which was later renamed to a much more logical 3.0)

Re: Nushell: Introduction to a new kind of shell

#129

Do we need a new shell or a few utilities that help produce structured output? For example, `ls | gen_structure | limit 50 | head 5`

That's an interesting project to attempt. An issue that should be considered is that pipes can only pass plain text. So every command should import/export structured text which may impact performance and limit capabilities when compared to a shell that can pipe objects.

The structure can be done with ASCII: csv and tsv manage to pass data in plain text (the later while remaining readable)

Relational data would have the extra advantage over json-like property-based data of being both easier to present on screen (tables) and to interact with (SQL like: where + order + limit would cover most usecases)

Re: Nushell: Introduction to a new kind of shell

#130
post #72
post #69

Earlier quoted context omitted.

surely something as basic as the location of the config folder can somehow be changed to a custom path, right?

Configuring where configuration data lives can be tricky. (Chicken/egg problem.) But you can certainly create your own symlink.

Yeah, the issue is mainly if you setup a new machine with your dot files, you need to remember to setup the symlink, because you don't do that so often is so easy to forgot. Also I pointed that out because I share my dot files between Mac and Linux and that's certainly annoying to have two paths for both.
Post reply on HN