Blog post: https://fishshell.com/blog/rustport/
…
Now that we’ve released the beta of fish 4.0, containing 0% C++ and almost 100% pure Rust, let’s look back to see what we’ve learned, what went well, what could have gone better and what we can do now.
We’re writing this so others can learn from our experience, but it is our experience and not an exhaustive study. We hope that you’ll be able to follow along even if you have never written any rust, but experience with a roughly C+±shaped language should help.
…
Why are we doing this again?
We’ve experienced some pain with C++. In short:
- tools and compiler/platform differences
- ergonomics and (thread) safety
- community
Preach.
make install
is the biggest source of “works on my machine” ever. (obviously exaggerating). You could point me at 99% of all C++ projects that have dependencies and it./configure && make install
wouldn’t work on any of my machines. “Oh of course you need to install the dependencies, justsudo apt get
” let me stop you right there, I don’t have debian. And with that you’re on your own with C/C++ projects.Everything else in that chapter plays a big part in my departure from C++. ~30 years of existence and they have barely learned from their missteps.
We’ve succeeded. This was a gigantic project and we made it. The sheer scale of this is perhaps best expressed in numbers:
- 1155 files changed, 110247 insertions(+), 88941 deletions(-) (excluding translations)
- 2604 commits by over 200 authors
- 498 issues
- Almost 2 years of work
- 57K Lines of C++ to 75K Lines of Rust 5 (plus 400 lines of C 6)
- C++–
Wow. What an amazing job 👏
You could point me at 99% of all C++ projects that have dependencies and it
./configure && make install
wouldn’t work on any of my machines.That’s why configure takes 100 arguments, so you can tell it where every single dependency is. I don’t miss those days.
In case anyone else was wondering what “Rust 5” and “C 6” were, the numbers are footnotes in the blog post.
Crab shell?
Crash
Taking bets on the number of useful contributors about to tank.
From their blog post:
Finally, subjectively, C++ isn’t drawing in the crowds. We have never had a lot of C++ contributors. Over the 11 years fish used C++, only 17 people have at least 10 commits to the C++ code. We also don’t know a lot of people who would love to work on a C++ codebase in their free time.
Hard to tank when you don’t have many to begin with. Rust is far nicer to new users to contribute to then old C++ code. Which can be seen in their github - in the last 24 months 16 people have contributed more then 10 commits. Which is during the conversion period - I dont expect that many of those to be C++ contributions. So rust does not seem to have hurt their contributions at all and in fact looks to have helped.
Perhaps it depends on what people are used to. I use C++ regularly and I find rust syntax much too painful to look at.
Syntax is in a large part what people are used to. Which is trivial to change by just using the thing for a while and getting used to the different syntax. But syntax is only part of a language. The tooling, documentation, error messages, and general feed back are all IMO much nicer in rust than C++. It is also easier to people new to programming or used to other languages to get into than C++ is, even including the syntax into that.
C++ was one of the first languages I learnt - and now after not using it for years I cannot stand its syntax.
You may be right, I don’t have enough experience talking to new programmers in order to comment on that part specifically, but I do think a sizeable portion of existing C++ devs who don’t want to use rust exist, and this may now be a problem moving forward, especially if the C++ committee keeps dragging their feet and never adopt any new safety extensions.
Personally I think the swift syntax is much more familiar and friendly to existing C++ devs, but its popularity does not seem anywhere near rust’s level for some reason, but maybe now that a truly cross-platform version has been released, it might gain some traction… maybe.
but I do think a sizeable portion of existing C++ devs who don’t want to use rust exist
That may be true. But out of that pool of people it seemed that very very few wanted to work on the fish project. So it was not helping them much at all. The is a vastly larger pool of people that don’t want to learn C++ and some of those may be willing to pick up rust. It would not take much for that to out number the number of C++ devs that want to work on fish that also don’t want to learn rust. Given there are not a huge amount of contributors that regularly contribute to it according to their announcement blog post.
Rust was painful to look at until I started using it for more than 6 or so months
I’ll take the other side!