It's not like it's the only high-performance memory safe language. It wasn't the first. It's not the highest performance. What am I missing?
It's not like it's the only high-performance memory safe language. It wasn't the first. It's not the highest performance. What am I missing?
2. It's posed as an alternative to C/C++ which have many historical problems. It's very easy to construct a strawman to show Rust is so much better than those ancient languages. ("here's this trivial buffer overflow bug Rust could have prevented!")
3. It's low-level enough that people feel 1337 for using it but not low-level enough to actually require low-level skills to use it. This is why you can see how in many cases, the "solution" to the borrow checker is just cloning everything - because they have zero idea about how to make performant programs.
4. It doesn't have many established libraries/frameworks compared to other languages, so "I wrote X but Rust" is a viable thing. In other languages, this wouldn't stand because there are already established libraries so interest in new ones is not as high + there are certain quality standards you have to meet.
5. It has certain high-profile features which are easy to explain why they are better - option types and slices for example. These Rustaceans are usually not exposed to functional programming before - so they start to embrace simple forms of functional programming. It makes Rust programs look fairly different compared to similar languages, which is another differentiator. It's easy to showcase the advantages of these features in code snippets, which makes it easy to evangelise.
Two years ago I was casually learning Rust by night while by day I was extending a scheduler I had previously written in C. I kept wishing I could switch, because I kept having to handcraft in C things I would have gotten for nearly free in Rust.
Now, we're designing the Rust replacement for that C program, and it is taking all my will power not to start coding it: that job falls to someone else, and I am wistful about it. Not because I am going to miss the C code, but because it would just be so much fun to do in Rust.
It is certainly true that you have a lot of things you can easily have at your fingertips with cargo in Rust, which you might need to first identify or even handcraft (if you have no existing framework to rely on) in C. On the other hand, I am not sure this is a good thing. I am a bit skeptical about the cargo / NPM style of package management.
I see no contradiction when you realize that no one has ever been proficient enough in C to write code that is free from UB… The problem with C is that cannot realistically be written by humans, so pretty much any language (except C++ …) is going to be “easier than C”.
One tiny example of many here is the Linux kernel.
I can very easily imagine doing the same things with Rust, with small amount of exceptions (that the core team is working on even now).
And yes Rust learned from the mistakes of the languages before it. Is that a bad thing?
Rust is legitimately special: being memory safe without any kind of garbage collection (I include ref-counting here). That's what enables its deployment in stuff like QEMU or the Linux kernel.
Another thing, it’s obvious people who designed Rust liked functional programming, so Rust attracts FP programmers. In the online communities, functional programmers are known for over-the-top evangelism for decades now.
Besides, cargo cult is simply the wrong concept to point out here.