Why I won’t be starting my next project in Rust

I have been inspired to learn Rust and Julia lately. The idea was to use these promising languages in all of my new projects. I wanted to learn Rust because it is a safe and fast replacement for C++. I wanted to learn Julia because it is a language tailored for scientific use that might someday replace Python.

I quickly realized that I would be learning both for the wrong reason. I already know C++ and Python well, and should be starting important new projects in these languages.

One article that changed my mind was “Criticizing the Rust Language, and Why C/C++ Will Never Die” by Eax Melanhovich. Not all the points Melanhovich makes are longer valid. For instance, the speed of Rust has improved significantly over just the past months. However, he is right in that the number and quality of development tools for Rust is way lower than that of C++. And it is hard to argue with the number of vacant positions for  C++ programmers in comparison to those of Rust and Julia.

This does of course not say anything about the quality of these languages. For all I know, Rust may be (or become) a much safer, faster and elegant language than C++. But I understand that many of the benefits I would get from Rust are already available in the new C++11 and C++14 standards. And from using C++ in a modern way.

I found Rust attractive because of its promise of memory safety. It is designed in a way so that you won’t be able to shoot yourself in the foot as easily as you can in C++. However, I’m currently using pointers in C++ the old-fashioned way. I still work with raw pointers, new and delete when I should be using smart pointers. Sometimes I even use pointers when references and values would be the right choice.

I realize now that I need to start a project or two where I use only modern C++. That should hopefully teach me how to steer clear of those nagging segfaults sometime in the future. I’ll be reporting back here about my experiences and will make a list of some recommendations for others who are trying to do the same.

Published by

Svenn-Arne Dragly

I'm a physicist and programmer, writing about the stuff I figure out as I go.

3 thoughts on “Why I won’t be starting my next project in Rust”

  1. Yeah, I sometimes have the same thoughts, but I am learning Rust and Julia because life is too short to be a pragmatist with personal time. Sure, if someone is paying me, I’ll do C++, I’ll do Python, but if it’s my own time, I may as well have a little fun.

    1. I completely agree. I will definitely continue to learn both Rust and Julia and I still make smaller projects in them for fun. Anything I’m investing much time in will be in C++ for now, though. But that might change with time. I guess my point is that I will to stick with what I know when I’m doing something important. I’m a bit too easily tempted to learn a new framework or language as I embark on a large project with high ambitions, and that is something I will try to avoid.

      1. Yeah, I did a big project in Scala last year, and now I’ll probably rewrite it in Rust. Downside: perhaps a waste of time. Upside: I know a lot of Scala now, and it really sorted me out for functional programming.

Leave a Reply