Skip to content

Fish Shell to Ditch C++ for a Rust Port; Plans to be Available for Servers

Fish shell plans make the transition to Rust to improve things and make it available for servers.

fish shell icon with rust logo on the background

The Fish shell is one of the lesser-known Linux shells that offers a smart, user-friendly command line shell for UNIX-like operating systems.

It is popular among Linux users because of its features and 90s-era look and feel.

Related Read 📖

Beyond Bash: 9 Lesser-Known Linux Shells and Their Capabilities
You probably already know about the popular shells like bash and zsh. Let us explore some interesting and unique shells.

Interestingly, a few weeks ago, the current maintainer of the Fish shell project 'ridiculousfish' initiated a pull request that mentioned:

I think we should transition to Rust and aim to have it done by the next major release.

He mentioned that this transition is a port, rather than a complete rewrite, and will feature translated C++ modules in Rust form.

Fish shell was picked up by 'ridiculousfish' after the original author 'Axel Liljencrantz' dropped it, and gave him the green signal to have his fork as the official successor project.

To prove that this can work, he ported a few modules to Rust and made them available in a crate that lives under and links to the C++ code.

They have also requested completion scripts from people familiar with such tools and to test them with their git repo.

Why the transition?👨‍💻

The C++ base that fish shell is built upon has been causing plenty of problems. Any required changes take unnecessarily long to implement.

While they initially moved to C++11 in 2016 and are still on it, now it is a pain to upgrade anything coded with such an old language; it even outweighs the possibility of upgrading to C++14/17.

Furthermore, with a recent comment by a maintainer, ditching C++ will allow them to:

  • Make fish available on servers that run old LTS distros
  • Making it easy to build and run

Then there are the general concerns with C++; such as issues with header files, memory safety, undefined behavior, compiler errors, and more.

The developers mention:

The gist of it is that C++ has caused us quite some grief, and we're done with it, and so, we have decided to leave it and everything related to it behind.

This is where the popular memory-safe language Rust comes in.

It can help them with the long-standing threading issues with Fish shell, and they already have people on the team who know how to work with it.

Now, with the announcement, they are also expecting better community contributions with this, as Rust has been very popular in recent times with “a bunch of buzz and mindshare that other languages lack” they said.

Hoping this goes well 🙏

A user, 'mqudsi' had a few legitimate concerns that they shared in a comment on the original pull request.

They worry that rushing any part of this undertaking could be detrimental to the survival of this project.

With concerns regarding the compatibility of fish on older hardware limiting its full potential, Rust being too high-level for fish, and so on.

Only time will tell how the developers handle such concerns.

When to expect?: The next major release of fish will be featuring the Rust port with many awaited improvements. We are not aware of the schedule for its planned release.

💬 What do you think of this? Will the switch to Rust be able to improve Fish Shell?

More from It's FOSS...