Fish – Update on the Rust port
Fish shell, a popular user-friendly alternative to bash and zsh, is being incrementally ported from C++11 to Rust with a goal of releasing an all-Rust Fish 4.0. Commenters weigh the tradeoffs: while raw performance gains over C++ may be modest or even negative at first, Rust is expected to make complex features like safe concurrency, better string handling, and long‑term maintainability easier, and may attract more contributors. The thread also contrasts Fish’s ergonomic, batteries‑included interactive experience with POSIX‑compliant shells, noting that many users are happy to keep bash/zsh for scripting while using Fish for day‑to‑day terminal work.
Overall reaction to the Rust port
- Many are impressed by the speed and ambition of a full C++→Rust port, while keeping the codebase working during development.
- Some see the move as a strong signal of project health and “modern relevance,” likely to attract more contributors.
- Others are skeptical, suspecting “chasing the new shiny” and questioning whether a full rewrite is justified versus incremental C++ upgrades.
Motivations for rewriting in Rust
- Cited reasons (summarized from linked PR/discussion comments):
- Safer and clearer string handling.
- Better support for threading and “fearless concurrency.”
- Build and tooling issues with the existing C++/CMake setup.
- Rust is expected to make complex concurrency features (e.g., more background tasks, parallel builtins, improved autosuggestions) easier and safer to evolve over time.
- Rust’s stronger guarantees and ecosystem are seen as more compelling than moving from C++11 to C++17/20, which some view as incremental only. Others strongly disagree, arguing the upgrade “pain” is overstated.
Performance expectations
- Mixed views: some expect Rust to be at least as fast, possibly faster thanks to better abstractions and easier safe concurrency.
- Core maintainers reportedly note that the finished port might be roughly the same speed or even ~20% slower in some cases.
- Several participants stress that the big win is long‑term: easier to add parallelism safely, not immediate raw speed.
Strings, Unicode, and portability
- Current fish uses
wchar_t/wide strings; the Rust port is tied to continuing that representation for C++ interop. - There is excitement about a future move to UTF‑8 internally; UTF‑16/UTF‑32 and odd Windows path semantics are seen as a “plague.”
- Concerns raised about Rust’s UTF‑8
Stringvs arbitrary byte paths; others point out Rust hasOsString/OsStrand similar types. - Cygwin/Windows support is a sticking point: Rust toolchains don’t fully support Cygwin, and Windows paths are tricky. Some argue fish never truly “worked on Windows” outside MSYS/Cygwin anyway.
Fish vs other shells (zsh/bash)
- Many praise fish for:
- Very fast startup and completion performance, even with features that require heavy plugins in zsh.
- Excellent defaults: autosuggestions, syntax highlighting, helpful completions, easy custom prompts.
- Much smaller configs compared to zsh+plugin setups.
- Downsides noted:
- Not POSIX‑compliant; users must mentally separate “interactive fish” from “bash for scripting.”
- Some ecosystem tools (e.g., nvm, gvm) can be awkward.
- Several say they still script in bash/POSIX or Python but prefer fish as the daily interactive shell.