Skip to content

Instantly share code, notes, and snippets.

@ShalokShalom
Created January 26, 2025 11:14
Show Gist options
  • Save ShalokShalom/a8f12fa653fc7c89cffeffb47abd86d6 to your computer and use it in GitHub Desktop.
Save ShalokShalom/a8f12fa653fc7c89cffeffb47abd86d6 to your computer and use it in GitHub Desktop.
If CVEs in C++ code were 98% lower (2% of today) in the four key buckets -- initialization safety, type safety, bounds safety, and lifetime safety -- then we wouldn't be having this conversation. There would be no problem.
Cpp2 today has
guaranteed initialization safety (better than C# or Java),
guaranteed type safety (via safe is type queries and as casts),
bounds safety (via subscript checking, banning pointer arithmetic, and safe-by-construction iteration such as range-for) except for naked use of raw STL iterators, and
I still need to implement in cppfront the C++ Core Guidelines Lifetime safety static analysis (which I designed for Cpp2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment