5 ms·
Ion: Modern System Shell in Rust
- mtillman 11mo ago"It is written entirely in Rust, which greatly increases the overall quality and security of the shell." Is this true? I don't know Rust so I'm probably missing context. Obvious kudos to OP for writing a shell.
- killme2008 11mo agoYeah, that’s true — Microsoft’s report (https://www.microsoft.com/en-us/msrc/blog/2019/07/why-rust-for-safe-systems-programming https://www.microsoft.com/en-us/msrc/blog/2019/07/why-rust-f...) says the same thing, and Google’s recent post on Rust in Android (https://security.googleblog.com/2025/11/rust-in-android-move-fast-fix-things.html https://security.googleblog.com/2025/11/rust-in-android-move...) backs it up too. 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 11mo agoIt's true for new projects. For rewrites (such as a shell) it can mean a lot of regressions. The rust-replacements for coreutils are a good negative example. The new programs do not reach feature-parity, added regressions, and in some cases also had security vulnerabilities. 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 11mo agoYou get memory safety. That's about it for Security. Quality is in the eye of the beholder. maybe it's quality code? Maybe it's junk, who knows. Rust isn't magic that forces code to be quality code or anything. That said, the code in the Redox system is generally good, so it's probably fine, but that's not because it's written in Rust, it's because of the developers. 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 11mo ago> Rust isn't magic that forces code to be quality code or anything. 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 11mo agoI do not think that using dependencies like it is npm is "doing the right thing".
- vlovich123 11mo agoWhile I generally agree, the latest Android report suggests that rust developers get fewer reverts and code reviews are faster. This could mean that better developers tend to adopt rust or it could mean that rust really is a language where quality is easier to attain. 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 11mo agoOr there are "reverts and code reviews are faster" because no one wants to actually read through the perl-level line-noise type annotations, and just lgtm.
- oersted 11mo agoWhat type annotations? In Rust almost all the types are inferred outside of function and struct declarations. In terms of type verbosity (in the code) it is roughly on the same level as TypeScript and Python.
- deleted 11mo ago[deleted]
- handwarmers 11mo agoNot necessarily. "Quality" and "Security" can be tricky subjects when it comes to a shell. Rust itself is pretty great, but its HN community is made of cringe and zealotry - don't let them dissuade you from trying the language :P
- raggi 11mo agoI love how one of the screenshots appears to be using the ion window manager, I guess they're very aware of the name collision :D
- timeon 11mo agoWhy is this link to mirror instead of actual repo?
- interstice 11mo agoGithub vs Gitlab I guess?
- d3Xt3r 11mo agoIn case you guys missed it: the popular fish shell is also now written in Rust. :) https://github.com/fish-shell/fish-shell/releases/tag/4.0.0 https://github.com/fish-shell/fish-shell/releases/tag/4.0.0
- dangus 11mo agoBeat me to it. A lot of the value in choosing a specific shell lies in its popularity, so I think you really need to have a specific reason to choose something outside of bash/zsh/fish.
- eindiran 11mo ago> you really need to have a specific reason to choose something outside of bash/zsh/fish 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.
- jayknight 11mo agoBeing adventurous can be part of your reason.
- deleted 11mo ago[deleted]
- cb321 11mo ago"Popularity" probably has more to do with Apple moving to Zsh than anything else. Zsh has been more powerful than Bash for literally the entirety of the existence of both. It surely was back in like 1993 when I first looked at them. The "emacs of shells" might not be the worst summary. 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.
- sigmonsays 11mo ago" It is still quite a ways from becoming stabilized, but we are getting very close " haha
- torginus 11mo agoI might be ignorant, but it looks to me like a slightly Rust-ified Bash, not sure if there's any standout features here - if there are could somebody point those out? 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.
- Philpax 11mo agoHave you tried nushell?
- mikestorrent 11mo agoI see a bunch of folks recommending this, but I have to wonder where this game ends. Always one more new tweak to the local environment. Just one more dotfile, bro, I promise this time your environment will be perfect. Just one more little supply-chain-attack vulnerable component running with the same access as you, the user. But look, you can save 20 microseconds on your shell history search or whatever! 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?
- timeon 11mo agoHow is this related to discussion: 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.
- JadoJodo 11mo agoI feel like an opportunity was missed by one letteR.
- citizenpaul 11mo agoIts worth mentioning that this seems to be purpose made to work with an entire custom rust OS Redox-OS. I didn't know that at first glance since I never heard of it. It also answered my question of whats wrong with NuShell?
- deleted 11mo ago[deleted]
- martin-t 11mo agoHave they considered nushell though? It works on both POSIX-like OSes and Windows so it's not platform specific. I'd like to know if it wasn't ready in time (then why not work together instead of starting a new shell, pun not intended) or if there are some technical reasons. I don't see a single mention of nushell in their readme or mdBook which is a shame.
- forgotpwd16 11mo ago>if it wasn't ready in time Ion predates Nushell by few years.
- speed_spread 11mo agoToo bad README doesn't show sample commands, discuss design or list differences from existing shells. So... it's just a shell, in Rust? Like fish, but still WIP? And only for redox-os? In which case, why not just go with nushell https://www.nushell.sh/ https://www.nushell.sh/
- forgotpwd16 11mo agoWell, there're samples... in the screenshots. For user info* gotta check the linked manual, which also has a comparison page to POSIX shell[0]. It's basically a slightly different, no doubt improved, POSIX shell. On one hand it's easier to transition to. On other hand it's incompatible enough to create headaches. (And the big competitor is Bash/Zsh not sh.) Considering there're packages for Ubuntu, it is not Redox-only. 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. [0]: https://doc.redox-os.org/ion-manual/migrating.html https://doc.redox-os.org/ion-manual/migrating.html
- ruined 11mo agoeveryone suggesting features and making comparisons: think ash not zsh
- laserbeam 11mo agoI’d like to see a real shell script written in ion very early in the readme or manual. Something that wgets a tarbal, extracts some part if the filename, checks cpu usage, draws a simple progress bar to the terminal, checks a folder for old files, some script that implements prompt completions for some cli tool… 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.
- ibotty 11mo agohttps://gitlab.redox-os.org/redox-os/ion/-/blob/master/examples/window-config.ion https://gitlab.redox-os.org/redox-os/ion/-/blob/master/examp... But I assume it's for redox, so you can't use it on a regular linux.
- hulitu 11mo ago> Why Not POSIX? > If Ion had to follow POSIX specifications, it wouldn't be half the shell that it is today, and there'd be no solid reason to use Ion over any other existing shell, given that it'd basically be the same as every other POSIX shell. I thought the reason was that "it is more secure" because "rust". So basically, it cannot be used for anything except its own scripts.