3 ms·
> Not everything will be rewritten in Rust. Yeah, but it's also not going to be rewritten in safe C++.
by wyager 2y ago
> Not everything will be rewritten in Rust.
Yeah, but it's also not going to be rewritten in safe C++.
- alilleybrinker 2y agoThere’s likely some amount of code which would not be rewritten into Rust but which would be rewritten into safe C++. Migrating to a whole new language is a much bigger lift than updating the compiler you’re already using and then modifying code to use things the newer compiler supports. Projects do the latter all the time.
- pavon 2y agoWhy not? C++ has evolved over the years, and every C++ project I have worked on, we've adopted new features that make the language safer or clearer as they are supported by the compilers we target. It doesn't get applied to the entire codebase overnight, but all new code uses these features, refactors adopt them as much as possible, and classes of bugs found by static code scanning cause them to be adopted sprinkled through the rest of the code. Our C++ software is more stable than it has ever been because of it. Meanwhile, throwing everything away and rewriting it from scratch in another language has never been an option for any of those projects. Furthermore, even when there has been interest and buy-in to incrementally move to Rust in principle, in practice most of the time we evaluate using Rust for new features, the amount of existing code it must touch and the difficulty integrating Rust and C++ meant that we usually ended up using C++ instead. If features of Circle C++ were standardized, or at least stabilized with wider support, we would certainly start adopting them as well.
- ameliaquining 2y agoWhat I'm really hoping is that https://github.com/google/crubit https://github.com/google/crubit eventually gets good enough to facilitate incremental migration of brownfield C++ codebases to Rust. That seems like it would address this concern.
- safercplusplus 2y agoYou might consider experimenting with the scpptool-enforced safe subset of C++ (my project). It should be even less disruptive. [1] https://github.com/duneroadrunner/scpptool https://github.com/duneroadrunner/scpptool
- safercplusplus 2y agoIn theory it could be auto-converted to a safe subset of C++ [1]. In theory it could be done at build-time, like the sanitizers. [1] https://github.com/duneroadrunner/SaferCPlusPlus-AutoTranslation2 https://github.com/duneroadrunner/SaferCPlusPlus-AutoTransla...
- gpderetta 2y agoThe point is that it doesn't need to. According to google, making sure that new code is safe is good enough.