Something something history is a flat circle

https://lemmy.world/post/33274870

Relevant comment

I don’t use Rust much, but I agree with the thrust of the article. However, I do think that the borrowchecker is the only reason Rust actually caught on. In my opinion, it’s really hard for a new language to succeed unless you can point to something and say “You literally can’t do this in your language”

Without something like that, I think it just would have been impossible for Rust to gain enough momentum, and also attract the sort of people that made its culture what it is.

Otherwise, IMO Rust would have ended up just like D, a language that few people have ever used, but most people who have heard of it will say “apparently it’s a better safer C++, but I’m not going to switch because I can technically do all that stuff in C++”

I don't use Rust much, but I agree with the thrust of the article. However, I do... | Hacker News

I kinda disagree. The reason rust caught on is because it is much safer than C++ while having the same or even better performance. And in some contexts, being garbage collected means bad performance.

Before rust you could either have a fast language (C/C++) or a memory safe language (any other language. That is, languages with garbage collector). But if you required memory safety and peak performance, there wasn’t any option.

Yes, the reason that rust is both memory safe and fast is because it has a borrow checker. But the borrow checker is the means, not the end.

The “better” performance is due to the built-in multi-threading support, and that functional programming makes it relatively safer to pull off. Otherwise single-threaded Rust is very hard to optimize.

Rust has monomorphisation like C++ and every function has the aliasing guarantees of restrict, a keyword rarely seen in C code bases use and C++ doesn’t even support.
This means you can get more optimisations while writing in an intuitive style, where C/C++ requires some changes to the code.

On the other hand rustc has some hiccups with argument passing and rvo. One could argue that that’s just the compiler while the aliasing problems are part of the language in the C/C++ case, but while there is only one rust compiler its performance is the languages performance.

For most use cases they are about equally fast.