Fish Shell Outlines Their Successes & Challenges Going From C++ To Rust

Written by Michael Larabel in Programming on 29 December 2024 at 06:53 AM EST. 151 Comments
PROGRAMMING
Earlier this month the Fish Shell 4.0 went into beta with the C++ code ported to Rust. Now with most of the Fish Shell code transitioned to Rust, the project put out a blog post this weekend outlining the successes and challenges they have encountered in porting their large C++ codebase to Rust.

The Fish Shell developers noted some of the C++ pains they had encountered leading them more to exploring other languages were around tooling and compiler/platform differences, ergonomics and thread safety, and the development community. One example was Fish having prototyped a true multi-threaded execution in C++ and that being painful for this open-source shell.

As for going with the Rust programming language, they admit, "Rust is cool. It’s fun." They also pride Rust for its tooling, easy tooling setup, great ergonomics, better dependency management, and the send and sync abilities of Rust make it very nice for threading.

Fish on CachyOS


The developers do acknowledge some challenges with Rust such as how it handles portability, the tooling sometimes failing to consider other targets, and some localization issues. Some gripes with Cargo were also pointed out that while it's great for building things, it's rather simplistic for installing them and thus Fish is still relying on CMake

The Fish blog post concludes with:
"The port wasn’t without challenges, and it did not all go entirely as planned. But overall, it went pretty dang well. We’re now left with a codebase that we like a lot more, that has already gained some features that would have been much more annoying to add with C++, with more on the way, and we did it while creating a separate 3.7 release that also included some cool stuff.

And we had fun doing it."
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week