4 ms·
The lifetime profile is basically nothing more than a few lints. There are systematic reasons why C++ can never get the memory safety features of Rust without b
by pcwalton 8y ago
The lifetime profile is basically nothing more than a few lints. There are systematic reasons why C++ can never get the memory safety features of Rust without breaking compatibility so much that it won't be C++ anymore.
- pjmlp 8y agoReally, I do like Rust, but you should adopt another strategy to win the hearts of C++ devs than throwing such jabs. Show them to create a secure COM component to integrate in .NET can be easier than writing it in C++/WinRT | C++/CLI, using the same VS/debugger integration while being safer, for example.
- pcwalton 8y agoC++/WinRT and C++/CLI are not memory safe. Rust is. I don't see how Visual Studio, debugger integration, COM, and .NET are relevant: one is safe and the other is not.
- pjmlp 8y agoAs stated, "you should adopt another strategy to win the hearts of C++ devs". Repeating ad infinitum in every HN thread about C++ improvements regarding safety, that the only path to enlightenment is rewriting the world from scratch, without any regard for the loss of productivity, tooling and libraries in doing so, always hand waving them as minor inconveniences, is trying to catch flies with vinegar, but I guess I am wasting my Latin as we say back home.
- pcwalton 8y agoI'm simply saying that modern C++ is not safe (and it will probably never be). If you write C++ at scale, you need to accept that you're going to ship memory safety bugs. I've said many times there is a legitimate reason to write C++. If you understand you will be shipping memory safety issues, but the advantages of C++ outweigh the memory safety issues that you will ship to production, then I can't argue with that. I've seen game developers argue as much, and that's legitimate! Maybe, for your use case, memory safety problems really don't matter (or don't matter enough to outweigh C++'s other features). But it doesn't do anyone any good to sugarcoat the fact that C++ at scale virtually always ends up with memory safety problems, and while there have been many mitigations there has been no effective solution so far.
- pjmlp 8y agoAgreed, but until Rust actually provides good coverage for many C++ uses cases, like COM/UWP on Windows for .NET apps with Visual Studio mixed debugging and GUI designers, sounding the safety trumpet without anything else to offer won't do it. Maybe it will change after the HoloLens/FF project, however today is not appealing to many Windows teams.