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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • phoronix
    Administrator
    • Jan 2007
    • 67328

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

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

    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...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite
  • lowflyer
    Senior Member
    • Aug 2013
    • 913

    #2
    It's sad to see such commonplace unspecific "reports" from the development. They say:

    some features that would have been much more annoying to add with C++,
    As a C++ developer I am very much interested in exactly which features they found easier/less annoying in rust.

    The whole thing really just looks like another attempt to bash C++.

    Comment

    • uid313
      Senior Member
      • Dec 2011
      • 6919

      #3
      Do you guys use Fish? Do you like it? What shell do you use? Me, myself I am boring and have only used Bash.

      As for Rust, overall I like it, lots of things to like like Cargo, linter, package manager, documentation generation, the Option<T> and Result<T, E> types, enums with values on the variants, the pattern matching, etc.
      Things I don't like is the slow compilation, the ugly double colon syntax, the weird and awkward module system, the shattered async ecosystem, that VS Code don't have any "test explorer" UI to easily run tests, and sometimes GTK can feel a bit like it needs boilerplate code.

      Originally posted by lowflyer View Post
      It's sad to see such commonplace unspecific "reports" from the development. They say:



      As a C++ developer I am very much interested in exactly which features they found easier/less annoying in rust.

      The whole thing really just looks like another attempt to bash C++.
      Well that comment comes from long-time C++ developers who are new to Rust. You would expect those people to be skeptical of a new language which they have no experience with and prefer to use a language they are comfortable and experienced with, but instead seem to embrace the new language and see how much better it is than their old language.

      Comment

      • TheMightyBuzzard
        Senior Member
        • Sep 2021
        • 416

        #4
        And we had fun doing it.
        For the Fish devs, given the hobbyist, tongue-in-cheek nature of the shell itself, that's probably the best reason they could offer for doing a bloody complete rewrite. It's still moderately silly but then so are they and so is Fish.

        Comment

        • Guiorgy
          Phoronix Member
          • Jul 2024
          • 51

          #5
          Originally posted by lowflyer View Post
          The whole thing really just looks like another attempt to bash C++.
          And rightfully so. But not "because it's C++", but because of all it's old design decisions and legacy debt. I'm a supporter of Herb Sutters proposal to create a new (opt-in) C++ syntax with only modern design and features.

          Comment

          • Jumbotron
            Senior Member
            • Jul 2015
            • 1246

            #6
            Originally posted by lowflyer View Post
            It's sad to see such commonplace unspecific "reports" from the development. They say:



            As a C++ developer I am very much interested in exactly which features they found easier/less annoying in rust.

            The whole thing really just looks like another attempt to bash C++.
            C++ richly deserves to be trashed. Poorly conceptualized and engineered in the beginning, made popular because everyone early on hated Java more than C++ for bringing object oriented design into the world of C, C++ is the IBM PC of programming languages whereas with the PC which was designed by IBM but operated with a CPU made by Intel which ran an OS sold by Microsoft that Microsoft bought from someone else because they couldn’t engineer their own OS in time for the rollout of the PC.

            C++, just like the x86 PC, has become a standard. That doesn’t mean that the standard is not shit.

            Comment

            • Jumbotron
              Senior Member
              • Jul 2015
              • 1246

              #7
              Originally posted by TheMightyBuzzard View Post
              For the Fish devs, given the hobbyist, tongue-in-cheek nature of the shell itself, that's probably the best reason they could offer for doing a bloody complete rewrite. It's still moderately silly but then so are they and so is Fish.
              Hobby project….how do you think Linux was created?

              Shells, all things considered, are not terribly large or complex programs. So with Fish shell being reengineered in Rust there is now an example for others to compare shells written in other languages in terms of performance, engineering, ease of maintenance, ease of feature addition or improvements.

              Now with a Rustified Fish one could, in a comp-sci class, have kind of crestomathy to analyze, compare and contrast different shells and the languages used to write them in a practical and operational sense to augment comp-sci theory.

              Comment

              • NateHubbard
                Senior Member
                • Mar 2015
                • 584

                #8
                I must be getting old. Suddenly I can't care what language something is written in as much as I feel like I'm supposed to. Nor which shell everyone else is using in whatever terminal they run. Which wayland compositor or even if they are still using an X window manager just doesn't make me want to argue with anyone. Go ahead and run KDE. I haven't since 1999 and don't want to.
                What a strange community we seem to be, where we want to tell everyone what they should be doing with their computer.
                It's no wonder people just buy a Mac.

                Comment

                • tobias
                  Phoronix Member
                  • Nov 2016
                  • 57

                  #9
                  Originally posted by lowflyer View Post
                  The whole thing really just looks like another attempt to bash C++.
                  People go through so much effort to bash C++! This particular bunch spent 14 month to port away from C++, so they can report their experiences.

                  I always find it surprising how many C++ devs assume Rust devs are out to get them and have zero idea how modern C++ works. I spent 25 years programming in what is now called contemporary C++, I love the language and what I archived with it in that time, but I absolutely do not want to ever go back to it...

                  What I find almost funny is how out of touch big parts of the C++ are. Memory safety is so much more than just smart pointers. Check out the safe C++ proposal for a MVP of what would need to change to make C++ comparable to Rust.

                  Comment

                  • skeevy420
                    Senior Member
                    • May 2017
                    • 8638

                    #10
                    Originally posted by uid313 View Post
                    Do you guys use Fish? Do you like it? What shell do you use? Me, myself I am boring and have only used Bash.
                    I've tried it out but I'm too accustomed to Zsh to want to move.

                    I changed from Bash to Zsh 16 or more years ago; way before Oh-My-Zsh and all that fun stuff. I didn't try Fish until around 8 years ago in 2016. It was like Zsh with a slightly different syntax. It was just different enough that I didn't care for it. Ironically, I find Fish scripts to be simpler and easier to read than Bash and Zsh.

                    My last time using Fish was in 2022 when I installed CachyOS. They use it as the default user shell. I tried it for a few days but kept getting annoyed and went back to Zsh with Powerlevel10K.

                    All that said, Fish is a fine shell and is what I'd probably be using if I would have been looking for a new shell in 2018 instead of when I did in 2008.

                    Comment

                    Working...
                    X