Live data from Hacker News

GitHub – nushell/nushell: A new type of shell

github.com

231–240 of 411 posts

Re: GitHub – nushell/nushell: A new type of shell

#231
post #207

Earlier quoted context omitted.

PowerShell was started by a single person, Microsoft's Jeffrey Snover. As the project progressed other designers came on board but Snover remained (and remains) as Chief Architect. The design-by-committee allegation isn't being fair to him. Part of why PowerShell may seem not quite Unix-like, is Snover didn't just look at Unix as an influence. Snover's professional background included experience with IBM OS/400's CL…

Once you start using PWSH, the design decisions are so obvious and make so much sense, that it is obvious Jeffrey Snover did have vast experience with variety of shells and languages. The idea to tie it with .NET and COM+ on windows is the best a shell has ever done, though someone noted in another thread that it is an old idea from XEROX mainframes (not sure what the name was). if you want to imagine this in terms o…

If you want that same ability from bash, it's available [0]. However, it interacts with C FFI, so it's lower level.

[0] https://github.com/taviso/ctypes.sh

Re: GitHub – nushell/nushell: A new type of shell

#232

The title is somewhat misleading and makes it seem like this is a GitHub company initiative rather than a project just hosted on GitHub. I've not seen this title format on HN before. Could it be changed?

I think the "nushell/nushell" part makes it clear which repo it is talking about.

I think just "nushell/nushell: A new type of shell" would be a clearer title.

Re: GitHub – nushell/nushell: A new type of shell

#233
post #102
post #30

Earlier quoted context omitted.

powershell for unix is ... powershell: https://docs.microsoft.com/en-us/powershell/scripting/instal...

Am I missing something cool by not looking into PowerShell for Linux? Anyone using it could chime in and share how it improves their workflow? What kind of tools does it bring to the table?

Powershell is a pretty neat scripting language, especially if you manage Windows boxes or have lots of .net stuff around.

It's not a good interactive shell environment though. The commands are way too verbose and the syntax feels clunky for keying in.

Re: GitHub – nushell/nushell: A new type of shell

#234
post #227

Earlier quoted context omitted.

I tried fish for a while. The differing syntax between fish and bash for fundamental things mean I was running all my scripts through bash anyway, and if I wanted to share them/use them elsewhere in the company it had to be bash, so I swapped back to bash.

That's not entirely weird to me. For the longest time bash was in various states of disrepair on different Unixes. I could make it segfault pretty easily. I wrote scripts that had to run across Linux, BSD, HP-UX, Solaris, and AIX at the time. So we relied on a ksh88 implementation on each. Whether it was AT&T, mksh, or pdksh, it was fine. Couldn't rely on 93isms, but basically anything POSIX was cool. I used ksh93 in…

Shellcheck is nowadays a must for writing decent shell scripts. it is like a centralized knowledge base of all those brilliant minds that did the sanity checking for you in the old days :)

Re: GitHub – nushell/nushell: A new type of shell

#236
post #102

Earlier quoted context omitted.

Am I missing something cool by not looking into PowerShell for Linux? Anyone using it could chime in and share how it improves their workflow? What kind of tools does it bring to the table?

Disclaimer: I use PowerShell on Windows, I've never tried it on Linux, but I don't see why its advantages wouldn't transfer. That being said, I think it's main advantages are: - Typed object streams, which gives you stuff like autocomplete, IDE support, and generally there's no need to muck about with sed/awk/xargs - Very fast, it's absolutely fine to read a file line by line, and parse it in a script, whereas doing…

Nice summary. It leaves me wonder, though: is the philosophy the same as in Unix world? as in, little independent tools that do one and just one thing. Would those tools also need to be modified to add compatibility with the same typing system that is used by the shell?

Or it follows the opposite mentality and the sell comes with batteries included?

I'm thinking of some arbitrary example, like downloading a JSON and parsing it to obtain some nested sub-property. In Bash world you would use the shell to execute at least something like `wget` to do the download part, and then run `jq` to parse the JSON and select the desired property. Both of `wget` and `jq` are independent programs, installed separately, with their own input & output channels, that you combine together by using the shell itself.

How would this work with PowerShell? (feel free to use some other example that might be better suited)

Re: GitHub – nushell/nushell: A new type of shell

#237
post #107

Thinking this is so cool! I was wondering if seriously buying into an alternate shell like this would be worth it in the long run. Would really love to read from people who use(d) an alternative shell, both success and failure stories. I cannot shake from my head the idea that buying into a non-standard shell will only work for personal projects in one's own workstation, but it won't fly too far for company work beca…

> I cannot shake from my head the idea that buying into a non-standard shell will only work for personal projects in one's own workstation, but it won't fly too far for company work because you'd then be introducing an implicit dependency on your special snowflake non-standard runtime. Which is something we came to accept and assume for interpreted languages (Python, Ruby, Node, etc.) but I'm not yet ready to assume for shell scripts.

Is it so bad? I run arch at home, I would never do that for a production server. I use rust at home, but it's unlikely to get introduced at my work any time soon. I use elm for solo projects, and I've never once convinced my managers to even try it (and believe me, I tried).

Context switching is pretty normal, I wouldn't let that get in the way of trying something new and interesting. Personally I find elv.sh the sanest scripting language I've tried so far, and I wouldn't trade it back in for bash, even if I'm still forced to use it at work.

Re: GitHub – nushell/nushell: A new type of shell

#238
post #82

Earlier quoted context omitted.

Can you write a bash one-liner that gets the free memory of your system? Is the awk blackmagic better than selecting an item of an object? Of course new things will be harder to write but it’s a people problem not something inherent with PS.

is the writing part really what we should focus on in scripting though? i personally would've put much more weight into the ease of reading and understanding the code. personally, i think that PS just came too late, so most people (me included) are too used to the way the unix shell works/feels. It would have to be just straight up better in all regards to displace it, but its more like a different flavor entirely. I…

I think bash is only readable because pretty much everyone is already familiar with the syntax. Given someone with no experience, they would probably have more success understanding what a Powershell script is doing.

Re: GitHub – nushell/nushell: A new type of shell

#239
post #67

I played with it recently. The interactive part is limited at the moment, but I really like the idea of having operations like sorting and filtering separate from the tools which produce the data. Having these things consistent and available everywhere is a huge cognitive win. I can finally sort and filter `ls` output without having to read the man page. :) "Querying" data feels a lot like SQL in that respect.

Were you not able to before? ls | grep foo | sort is hardly something people normally read the man page for.

Now sort by filesize

Re: GitHub – nushell/nushell: A new type of shell

#240
post #107

Thinking this is so cool! I was wondering if seriously buying into an alternate shell like this would be worth it in the long run. Would really love to read from people who use(d) an alternative shell, both success and failure stories. I cannot shake from my head the idea that buying into a non-standard shell will only work for personal projects in one's own workstation, but it won't fly too far for company work beca…

> Which is something we came to accept and assume for interpreted languages (Python, Ruby, Node, etc.)

Tangential, but:

- "Node" isn't a language, it's a JS runtime

- There's no such thing as an "interpreted language", whether something is interpreted or not is a property of the execution environment, not of the language itself

- The commonly-used runtimes for JS at least are JIT compilers, not "interpreters", and this can be true for some Python/Ruby runtimes too

Post reply on HN