Live data from Hacker News

GitHub – nushell/nushell: A new type of shell

github.com

251–260 of 411 posts

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

#251

Earlier quoted context omitted.

I haven’t seen a shell script in ages that was missing the shebang. Is this common in some places? I’ve started to write dash scripts because that seems to be reasonably posix and bash on macOS is ancient.

I don’t think I’ve ever seen a script written without the shebang. Btw, you can get around the ancient bash in macOS by installing a more modern bash and invoking with /usr/bin/env bash as your shebang. Not sure if that’s a great idea, mind you, but if you’re already writing scripts in something non-portable, it’s an option.

Yeah thing $T _might_ (but probably won’t) happen, so the idea is automatically terrible.

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

#253
post #236

Earlier quoted context omitted.

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…

[deleted]

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

#255

This looks pretty awesome. Wonder if it could be used with a command rather than as a new shell. Tangent: How is this at the top of the front page with a dozen upvotes and no comments? Maybe these upvotes all occurred at once?

I will sometimes upvote something without comment if I found it interesting, don't really have anything useful to say myself, but would be interesting in seeing what other people have to say.

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

#256
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?

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.

I disagree. Yes, the syntax is verbose so that you get sensical names instead of things like 'awk' and 'grep', but that isn't a big deal because a) tab complete[0], and b) user-definable aliases.

[0] tab complete works on cmdlets, switches, and variables.

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

#257

Earlier quoted context omitted.

PowerShell from Microsoft is looking too alien on Unix. Just looking at the syntax I already feel uncomfortable. It's hard for me to criticize it because I haven't used it, but it looks like it was designed by a committee and overdesigned. I.e. it wasn't created from the need, like someone at Microsoft wanted to automate his work and created PS to solve his problem. It looks like some boss decided: "They have shells,…

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…

The only thing I can think of in PowerShell that definitely seems to be "design by committee" is the whole ScriptExecutionPolicy nonsense.

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

#258
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…

Wait, are you seriously trying to tell me that bash is more readable than PowerShell? Excuse me, but what alternate timeline did you accidentally stumble in from?

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

#259
post #184
post #119

Earlier quoted context omitted.

I just hope that Rust with 40 years of backwards compatibility feels better than C++ today.

40 years is a long time, so the experience will almost certainly degrade a fair bit. The notion of editions in rust makes allowances for breaking changes while still keeping backwards compatibility, I'm very curious to see whether the problems that solves outweigh the complexity in the compiler.

I am not convinced that editions are much better than language version switches.

They only work in the ideal case that whole dependencies are available as source code, the same compiler is used for the whole compilation process and for light syntactic changes.

In fact for IntoIterator, a small fix to the editions was made, https://blog.rust-lang.org/2021/05/11/edition-2021.html

With 40 years of history, several Rust compilers in production, corporations shipping binary crates, expect the editions to be as effective as ISO/ECMA language editions.

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

#260

I wonder if this could be accomplished in a more general way with a fourth standard file descriptor for structured data. stdjson basically.

I had this thought half a year ago. Anything not to have to parse text make me happy. Though i guess learning to parse command output helps you learn how to parse other text down the line.
Post reply on HN