What makes you think so? The Rust compiler is able to instrument LLVM a lot better and provide it with a lot more info than C++ can. The borrow checker does a lot of the work there to for example keep things on the stack or do LSE or GSE and other optimizations. It isn't just about "oh, the rewrite allowed them to restructure things and optimize the algos". It is also that Rust due to its nature is able to be absolutely damn fucking sure that it can remove or optimize certain parts, whereas C++ can't in many cases.
Additionally, some people shared that they feel more comfortable making more aggressive optimizations in their Rust code because the borrow checker has their back.
Stylo was tried twice in C++ before the Rust attempt, and it never worked out, because the threading was too hard to get right. In theory you could have done it. But in theory, theory and practice are the same, but in practice, they’re different.
Oh definitely. Refactoring in Rust is a lot safer. Sometimes a lot more cumbersome, but definitely safer. Sometimes a refactor introduces a lifetime to a structure and now a loooot of places need changing, but at least it's safer. In C++, it would be less safe, but I could compile it and test the part I am trying to change or test first. It's a pro and con on either side.
But for the end product, I err on the safety side for sure.
IIRC, you yourself commented a few years ago in a thread on HN that the Rust situation was still a lot like "because of certain guarantees Rust makes we should be able to perform tons of optimizations that C++ could never do, and we haven't even gotten around to implementing most of them yet", has that situation improved a lot since?
("a few" might be off by pre-pandemic amount of years, my memory is a bit fuzzy there)
It's progressed in the sense of like, the Unsafe Code Guidelines and opsem teams are hammering down the exact semantics still, and have made a lot of progress. I'm not aware of any actual optimization work taking place off of it yet, which would make sense given that it's not all fully hammered out yet.
I also might have been handwaving towards how restrict kept having to be turned off because it was broken, meaning very few C or C++ codebases seem to use it at all, whereas virtually every Rust reference has it on. It's been back on for a while now.
Yeah I forgot the exact context of the quote too, no worries :). EDIT: it probably had something to do with aliasing and alignment (because when aren't people sighing about C/C++ when it comes to that topic?)
Thank for the general update! I might not write any Rust code myself, but I do enjoy quite a few programs written in it, so I was hoping to hear there was more progress for the sake of the developers behind those programs. But I can also imagine that these kind of things take time to figure out properly, to avoid repeating mistakes of previous languages (and that's before we even get to the task of implementing anything).
Wish the people working on these issues all the best, and looking forward (from the sidelines) to what eventually comes out of it!