The reason in question is that not that long ago, people said "you really need to have a specific reason to choose something outside of bash", and people choosing to go off the beaten path lead to zsh and fish becoming powerful and way more popular/well-supported than they were before.
Fish is a more recent addition, but I hate its `for loop` syntax, seemingly copied from BSD C Shell, which this Ion shell seems to have copied (or maybe Matlab or Julia?). Baffles me to impose a need for `end` statements in 2025. In Zsh, for a simple single command, I need only say `for i in *;echo $i` - about as concise as Python or Nim. In the minimalism aesthetic, Plan 9 rc was nicer even before POSIX even really got going (technically POSIX was the year before Plan 9 rc) for quoting rules if nothing else.
I think it's more insightful to introspect the origins of the "choosing something outside bash" rule you mentioned. I think that comes from generic "stick to POSIX" minimalism where Bash was just the most commonly installed attempt to do only (mostly) POSIX shell.. maybe with a dash of "crotchety sysadmins not wanting to install new shells for users".
Speaking of, the dash shell has been the default on Debian for a long while. So, I think really the rule has always been something "outside POSIX shell", and its origins are simply portability and all those bashisms are still kind of a PITA.
It's my impression that Apple switched to zsh because it's permissively licensed, so they could replace the now-ancient last version of bash to use GPLv2 (instead of v3). Obviously it helped that they could replace it with something even more feature-rich, but I expect they would have taken the exact same functionality under a more permissive license.
As for why you might use it on Linux, it seems like it's meant to be "friendly" like Fish, but with more emphasis on scripting rather than on interactive use. It looks like a very comfortable scripting language. Something that visually resembles Lua but also has all of the familiar shell constructs would be an excellent scripting language IMO. And that's what this seems to be.
Fish is great. NuShell is amazing. But once I start doing such data pipelining, I'd much rather open a Jupyter notebook.
FOO=bar cmd
to run cmd with the env var FOO set to bar, and that was the single biggest incompatibility I routinely stumbled across. Most commands you find in random docs tend to be that simple, and most work just as if you’d run them under Bash. But if it’s a large, complex command with if statements and for loops, etc., you’re better off pasting it into a file, then tweaking it to run under Fish or just running it directly via Bash.I think the error messages fish gives out in these cases (usually related to quotations) explain the problem pretty well.
I would probably recommend it like this: “I like using fish as my shell, if you want to try it out make sure you read the tutorial and generally understand that it’s not designed to be 100% bash/zsh compatible.”
I picked up fish as a junior level engineer as well, it wasn’t very hard to adapt.
I kind of hate to admit, but in many ways Powershell is stil king of the shell game (haha) - the fact that it's object based (with autocomplete!) and has a proper JIT, meaning it's fast enough in processing pretty much anything just with native shell scripts (certainly not true for Bash or Python!) gives it a very different feel. Afaik there are object based shells, but none are fast enough to be generally faster or as fast as the disk is, meaning you need to resort to tricks for heavy-duty processing.
Too bad Microsoft messed up the ergonomics, and using it feels like pulling teeth.
Is there some actual reason to use this? I got sold on `zsh` as it became the standard on the Mac and was packaged by all major distros, but honestly I'm still fine with just plain bash, though I miss the pretty prompts. What is one really getting out of nushell / ion / whatever new tweaked out shell comes out next week?
A: ...in many ways Powershell is stil king of the shell game [but]...
B: Have you tried nushell?
Anyway... nushell is more similar to Powershell (but AFAIK there is no JIT). My default is zsh (as you have mantioned, because of mac) but I use nushell for few things - it is pretty different from bash/zsh/ion/fish. It is more like data pipeline.
In my experience, half the CLI utils used by bash scripters do things you could do with Bash, but they're much faster on account of being written in C, but you have to suffer through learning their quirks.
An example I remember was when I needed to parse tens of gigs of JSON into a pandas dataframe (CSV on disk) - the python and bash versions ran at like 2-3MB/s, while the Powershell version did 50-100MB (which is still not great, but certainly good enough for what we did)
I don't see a single mention of nushell in their readme or mdBook which is a shame.
Ion predates Nushell by few years.
In which case, why not just go with nushell https://www.nushell.sh/
Nushell is certainly a better fit to be called modern shell but, even not considering the structured design, is much more different.
*Kinda makes sense as source repos are meant for devs; end-users should be checking manuals/sites instead. We're just used for repos' READMEs to be functionally similar to projects homepages.
I really don’t care that a new shell is written in rust. I care to see examples of how it actually would be better than bash.
But I assume it's for redox, so you can't use it on a regular linux.
I thought the reason was that "it is more secure" because "rust".
So basically, it cannot be used for anything except its own scripts.
mtillman•2mo ago
Is this true? I don't know Rust so I'm probably missing context. Obvious kudos to OP for writing a shell.
killme2008•2mo ago
We’ve been using Rust for about seven years now, and as long as you stay away from fancy unsafe tricks, you really can avoid most memory safety bugs.
ablob•2mo ago
So for battle-proved software I wouldn't say so per-se (if your goal is to replace them).
Nonetheless, if you add truly new rust-code to a new or existing codebase when it's without much of hassle with the interop it should hold.
zie•2mo ago
Any GC'd language(Python, JS, Ruby, etc) gives you the same memory safety guarantees that Rust gives you. Of course GC'd languages tend to go a fair bit slower(sometimes very drastically slower) than Rust. So really the memory safety bit of Rust is that the memory safety happens at develop and compile time, instead of at runtime, like a GC language does. So you get the speed of other "systems" languages, like C, C++, etc AND memory safety.
Philpax•2mo ago
It is not, but the language and ecosystem are generally very well-designed and encourage you to "do the right thing," as it were. Many of the APIs you'd use in your day-to-day are designed to make it much harder to hold them wrong. On balance, outside of Haskell, it's probably the implementation language that fills me with the most confidence for any given particular piece of software.
johnisgood•2mo ago
vlovich123•2mo ago
There’s some reason to believe that given how easy it is to integrate testing into the rust code base and in general the trait and class system is also a bit higher quality and it encourage better isolation and things like const by default and not allowing API that could misuse the data structure in some unsafe way. And it has a rich ecosystem that’s easy to integrate 3p dependencies so that you’re not solving the same problem repeatedly like you tend to do in c++
So there is some reason to believe Rust does actually encourage slightly higher quality code out of developers.
ok123456•2mo ago
oersted•2mo ago
ok123456•2mo ago
It's write only code, just like Perl but no where near as productive. Minor refactors become a game of Jenga.
Philpax•2mo ago
ok123456•2mo ago
Philpax•2mo ago
zdragnar•2mo ago
adastra22•2mo ago
aw1621107•2mo ago
This seems like a slight misreading of the comment you're responding to. The claim is not that reverts are "faster", whatever that would mean; the claim is that the revert rate is lower.
Also, how would skimping on reviews lead to a lower revert rate? If anything, I'd imagine the normal assumption would be precisely the opposite - that skimping on reviews should lead to a higher revert rate, which is contrary to what the Android team found.
netbioserror•2mo ago
In native-compiled languages (Nim, D, etc), the penalty for GC can be astoundingly low. With a reference counting GC, you're essentially emulating "perfect" use of C++ unique_ptr. Nim and D are very much performance-competitive with C++ in more data-oriented scenarios that don't have hard real-time constraints, and that's with D having a stop-the-world mark-and-sweep GC.
The issue then becomes compatibility with other binary interfaces, especially C and C++ libraries.
elcritch•2mo ago
Actually Nim2 and Swift both use automatic reference counting which is very similar to using C++’s SharedPointer or Rusts RC/ARC. If I couldn’t use Nim I’d go for Swift probably. Rust gives me a headache mostly. However Nim is fully open source and independent.
Though Nim2 does default to RC + Cycle collector memory management mode. You can turn off the cycle collector with mm:arc or atomic reference counting with mm:atomicArc. Perfect for most system applications or embedded!
IMHO, most large Rust project will likely use RC or ARC types or use lots of clone calls. So performance wise it’s not gonna be too different than Nim or Swift or even D really.
timeon•2mo ago
I do not think so. My personal experience is that you can go far in Rust without cloning/Rc/Arc while not opting for unsafe. It is good to have it as default and use Rc/Arc only when (and especially where) needed.
elcritch•2mo ago
Naive grepping for `&` assuming most are borrows seems (excluding &&) to be 1135 lines. Clone occurs in 62 lines for a ratio of 5.4%. Though including RC and ARC with clones and that you get about 10.30% vs `&` or borrows borrows. That's assuming a rough surrogate Rc/Arc lines to usages of Rc/Arc's.
For context doing a grep for `ref object` vs `object` in my companies Nim project and its deps gives a rate of 2.92% ref objects vs value objects. Nim will use pointers to value objects in many functions. Actually seems much lower than I'd would've guessed.
Overall 2.19% of Rust funcs in Ion using Rc/Arc vs 2.92% of my Nim project types using refs vs object types. So not unreasonable to hold they have similar usage of reference counting vs value types.
zie•2mo ago
widdershins•2mo ago
Did you mean shared_ptr? With unique_ptr there's no reference-counting overhead at all. When the reference count is atomic (as it must be in the general case), it can have a significant and measurable impact on performance.
netbioserror•2mo ago
d6e•2mo ago
adastra22•2mo ago
lelanthran•2mo ago
I thought it was just one concurrency error that was prevented. Other than data races, what other concurrency errors are prevented?
carlmr•2mo ago
Not true, you get one of the strongest and most expressive type systems out there.
One example are the mutability guarantees which are stronger than in any other language. In C++ with const you say "I'm not going to modify this". In Rust with &mut you're saying "Nobody else is going to modify this." This is 100x more powerful, because you can guarantee nobody messes with the values you borrow. That's one very common issue in efficient C++ code that is unfixable.
Sum types (enum with value) enable designing with types in a way otherwise only doable in other ML-based languages. Derive macros make it easy to use as well since you can skip the boilerplate.
Integers of different sizes need explicit casting, another common source of bugs.
Macros are evaluated as part of the AST. A lot safer than text substitution.
Further the borrow checker helps with enabling compile time checking of concurrency.
The list goes on, but nobody that has tried Rust properly can say that it only helps prevent memory safety issues. If that's your view, you just showed that you didn't even try.
handwarmers•2mo ago