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
21
u/ts826848 Oct 25 '24
The claim is that there is! The conflict is that profiles claim to be able to deliver lifetime safety to large swaths of existing C++ code with minimal annotation burden (P3465R0, emphasis added):
Critics take the position that the analysis proposed here doesn't work and that it can't work - in other words, implementing the lifetime proposal as-is results in an analysis that isn't guaranteed to reject incorrect code and may reject correct code. While the latter is inevitable to some extent, it's the false negatives that are the biggest potential problem and the reason the lifetime profile could be considered potentially untrustworthy.
I'm not sure I agree. If model A can soundly prove spatial and temporal safety and model B can soundly prove spatial safety and unsoundly claims to address temporal safety, then model A is obviously safer than model B with respect to temporal safety.
If you only limit consideration to behaviors that both models A and B can soundly prove (in this example, spatial safety), then the statement is true but it's also a circular argument: "All models are equally safe if you only consider behaviors they can all prove safe" - well obviously, but that's not really a useful statement to make.
Now, if model B claims that it only proves spatial safety and does not address temporal safety, then maybe you can argue that models A and B are both safe, just that one can handle more code than the other. But that's not what the main complaints appear to be about.
Models need to say up front whether they can verify something. It's one thing to say "here's what we can prove safe and here's what we can't", because that clearly delineates the boundaries of the model and can allow the programmer to reason about when they need to be more careful. It's a completely different thing to say "here's what we can prove safe" and to be wrong.