Earlier quoted context omitted.
I’m sorry to say this but this is a very uninformed comment with way too many biases without any backing. > 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 Interestingly enough, it is used for automating Windows configuration. Re last paragraph: UNIX commands are random letters that are like that due to historical reasons — if you don’t k…
> So while I am not particularly fond of Microsoft, powershell is better than bash (though frankly, what isn’t?) in every conceivable way. There are fair criticisms to be made of bash...but this isn’t a fair comment either; I use power shell a lot; I’ve written hundreds or thousands of lines of powershell glue for scripts and devops pipelines and all kinds of things. It’s not very good. It is one of those things that…
GitHub – nushell/nushell: A new type of shell
181–190 of 411 posts
Re: GitHub – nushell/nushell: A new type of shell
#182Earlier quoted context omitted.
So, instead of just typing shell commands, you type something else, but as soon as you need a shell script, you have to go back to shell commands.... Why not just cut out the middleman?
Answer to the first question: yes. Answer to the second question: because bash is a rather poor terminal shell. In my experience, the middleman you mention doesn't exist. Or, if anything, it is a very tiny man that hardly gets in the way. It's either a one-liner with a syntax change you can pick up in 5 minutes, or it falls under any combination of these: - might as well belong in a script - the complicated stuff is…
Re: GitHub – nushell/nushell: A new type of shell
#183Earlier quoted context omitted.
> Apart from the safety it provides. Sum types (and pattern matching), first-class results, ownership, good performances and a rich ecosystem turn out to be quite nice for a general purpose langage once you’ve passed the hurdle of the borrow checker, even ignoring all the zero-cost abstraction stuff. Also the really solid and safe multithreading. You might struggle a bit getting all your ducks in a row, but past that…
There must be something else, because most of what Rust brings to the table is what functional languages have been providing for ages, just with rebranded names.
Rust feels like the love-child of part of ocaml (for the sum types), part of C (very small runtime, ability to generate native code, interrop with C libs, etc..), part of npm (package manager integrated with tooling, large discoverable list of libraries), etc...
Borrow-checking seems a bit newer-ish - but I'm pretty sure there is an academic FP language that pionnered some of the research.
No-one is planning to give Rust the medal of best-ever-last-ever language any time soon.
And none of that is a "bad thing" (tm.)
Re: GitHub – nushell/nushell: A new type of shell
#184Earlier quoted context omitted.
Backwards compatibility can be a heavy burden for a programming language. C++ could be a much simpler, ergonomic language by eliminating features and idioms that are no longer convenient to use. Achieving mastery in C++ requires a lot of work. C++ projects require a coding standard. The decision space you have when working in C++ is much larger than when working with Rust due to the proliferation of language idioms.…
I just hope that Rust with 40 years of backwards compatibility feels better than C++ today.
Re: GitHub – nushell/nushell: A new type of shell
#185Earlier quoted context omitted.
We've already had languages that could replace C. Ironically Pascal was replaced by C on home systems. But Rust isn't a C replacement, it's a C++ replacement. HN talks about Rust like there was a void before it but there wasn't. I think it's great that the community have finally gotten behind a safer language and I think Rust is a worthy candidate for the community to get behind. But I'm sick of reading about Rust as…
> it's the only shell what has a page of comments commending the authors for their choice of language. There isn't "a page of comments commending the authors" here, so I have no clue what you are talking about? The main Rust discussion is in a subthread which someone specifically started by asking "why Rust", at which point you can't really fault the Rust fans for explaining why Rust.
Re: GitHub – nushell/nushell: A new type of shell
#186Earlier quoted context omitted.
Maybe we could be writing things in ADA. I don’t know, it’s a language that’s been on my radar for several years but I haven’t actually dug into it yet. That said, we need something to replace C — and Rust seems to be picking up momentum. Rust seems good enough a replacement to me, and that’s enough for me to cheer it on. I do agree that “written in rust” isn’t as big a guarantee of quality as people here assume thou…
We've already had languages that could replace C. Ironically Pascal was replaced by C on home systems. But Rust isn't a C replacement, it's a C++ replacement. HN talks about Rust like there was a void before it but there wasn't. I think it's great that the community have finally gotten behind a safer language and I think Rust is a worthy candidate for the community to get behind. But I'm sick of reading about Rust as…
Re: GitHub – nushell/nushell: A new type of shell
#187Earlier quoted context omitted.
Why do you not? No memory leaks, no security issues stemming from such. No random crashes from memory misuse, no issues debugging the issues that exist. It's like a higher level language but lower. You get to do things your way, except when your way is fundamentally unsafe. The code is then easier to debug as it actually describes what's happening and issues are mostly algorithmic, while the application gets a massiv…
Rust is perfectly happy to leak memory. Leaks are not considered unsafe. There was actually a bit of a reckoning around the 1.0 release where people widely assumed the language wouldn’t leak, and leaks were proven to be safe behaviour.
Still, I expect it to be very hard to do accidentally. In C all you need to do is have your mind blank for a moment. Which isn't that uncommon, especially if you're on crunch or something.
Re: GitHub – nushell/nushell: A new type of shell
#188This feels extremely like PowerShell, from all the examples, and even cites "draws inspiration from projects like PowerShell", so "a new type of shell" feels very disingenuous unless it has additional novel properties that aren't evident just from these. There's also no support for variables yet if the page is to be believed, which means there's 0 chance of me using this for more than 5 minutes right now. (I'm not tr…
Have you used PowerShell much? The examples in the Readme make it obvious that it's very different (in a good way).
I see minor syntax differences, for example in the comparison operators. Nothing that would it would be worth losing the .NET BCL or PowerShell's cmdlets for.
Re: GitHub – nushell/nushell: A new type of shell
#189Earlier 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?
The unix way of text streams and tools to manipulate them are too ingrained that I haven't bothered to get in detail, but I hear some people are fans.
Re: GitHub – nushell/nushell: A new type of shell
#190Earlier 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.
If you're running scripts, what difference does it make that you use fish? You're not really supposed to write scripts for fish, unless it is meant to be used be the fish shell itself. A shebang on the top of your script will invoke the script with the right executable, and whether you called it from bash, zsh or fish would make no difference.
Given that 95% of my time in a shell is running a script, a shell that doesn't do that well isn't a great fit for me.
> A shebang on the top of your script will invoke the script with the right executable,
Assuming the person who wrote it had the foresight to do so. That person isn't always me, and if I have to manually check if each script I run has a shebang, I should just default to running them in bash.