r/cpp
•
u/steveklabnik1
•
Oct 24 '24
•
1
Why Safety Profiles Failed
https://www.circle-lang.org/draft-profiles.html
180
Upvotes
View all comments
Show parent comment
4
u/srdoe Oct 27 '24 edited Oct 27 '24
You're all over these threads being wrong and ignoring what people are telling you, so I'm sure this won't make any difference, but here goes:
What migration?
As per this comment whether you feel like migrating existing code is entirely up to you. You don't have to migrate any existing code if you don't want to.
You can call the safe subset from unsafe code just fine, so you can write new code in the safe subset and plug it into existing programs.
If the new safe code has to call existing unsafe code you don't want to migrate, you can do that too if you have to, by marking that call as unsafe, which means you still benefit from safety outside those unsafe blocks.
That's without even addressing the problem you keep handwaving away: Since profiles don't have enough information to accurately tell if something is unsafe, they either have to let things slip through (i.e. they don't work, this is likely a non-starter for regulators, and this is where profiles are at right now. Profiles as they exist today in implementations are not viable.), or they have to be extremely conservative and flag lots of false positives which then have to be marked as excluded in your source.
You said previously that you think the latter is fine. If you look at Sean's post in the OP, plenty of the stdlib will need exclusions, and likely so will your own code.
That's exactly the kind of littering of the code with annotations you claim not to want, and it is migration work.
It's completely unclear that there will be less work in migrating to profiles than there would be in adopting Safe C++. And at least with Safe C++, that work would be something you do once, not something you have to do repeatedly forever as you write new code, as you would with excluding false positives with profiles.
And just to be clear: Complaining about how disruptive this is won't help. Due to regulators getting involved, this isn't simply a discussion about how to make C++ better where "do nothing" is a viable option. Neither is "Let's research this for another 10 years".
Regulators are already out there right now strongly recommending that companies look at migrating to memory safe languages. Can you be sure they won't start explicitly blocking usage of memory unsafe languages 5-10 years down the road?
If the committee makes a decision that doesn't solve the problem, such as adopting a version of profiles that lets lots of memory safety issues sail through validation, it could very seriously harm C++ usage going forward.
Most companies aren't going to be choosing a language that blocks them from government work. Why would they?
If the committe does that, they're basically betting that regulators will back down on their demands. I think betting that way is irresponsible.