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
-2
u/germandiago Oct 26 '24 edited Oct 26 '24
Seems like a valid point, I was here thinking of solutions and could not find an immediate one at least.
With fat iterators that know its container (run-time) in debug mode would be a solution.
I admit I did not find a solution to this, since beg, end form a range but those params have nothing to do with each other. That function should be, then, banned as unsafe in this case.
Ok, let's talk about color intensity: it would not be better to "color-annotate" and reuse safety analysis to the maximum amount existing code? Or just forget about, I do not know, easily billions of lines of code? I think I would have a preference for the former solution if it is possible: you say it is not, because some annotations bother you, banning unsafe functions bothers you, but it does not bother you that people have to rewrite code in another dialect for just getting an analysis...? I think here the cost/benefit should heavily favor the former, even with some annotations, as long as old code stays analyzable (read: analyzable, not safety-compliant). You say it is impossible. Ok, I get your point. You have an informed decision, definitely. But I think that then banning the most problematic areas is a second strategy that it is still valid. That cuts off the analyzable as safe surface, true. But it is too much to win to let it go...
I am aware of that. The strategy would be to look for alternatives, not to try to analyze pairs of iterators, right? Ban those. It is an unsafe abstraction.
These two depend a lot on how much annotation you need because going full split-world directly will make you pay the price of non-analyzable older code...
Thanks, the links are very informative. Learning some more now.