3 ms·
Well, what's new here? Generational References, random or sequential That's an old idea. Goes back to at least the 1980s. It's a useful way to detect use-afte
by Animats 3y ago
Well, what's new here?
Generational References, random or sequential
That's an old idea. Goes back to at least the 1980s. It's a useful way to detect use-after-free at run time, but doesn't prevent it. "To get access to an object, we first check ("generation check") that the current generation number matches the remembered generation number. If not, we safely signal a segmentation fault." Um.
Rule 5: We can only read a field by taking ownership of it, by either swapping something into its place or destroying the containing struct.
Hm. This is single ownership with move semantics on steroids. There was once some enthusiasm for languages where you could only read a variable once. But that didn't go very far. On the other hand, single assignment, where you can only write once, on the other hand, is now widely accepted and useful.
I doubt that any collection of hacks on top of C++ will make it safe. Too many people, including me, have tried. To increase safety, you have to take things out. This is unpopular and breaks backwards compatibility.
- pjmlp 3y agoOne way to take things out is to have something like Sonar on the CI/CD pipeline, configured exactly to take specific patterns out, that break the PR builds and won't get greelighted for merging. Yeah, not everyone likes those of us that share development roles alongside security best practices enforcement.