From ca851dc03647287db5836fbb3e1c5ac1ca2e6fc8 Mon Sep 17 00:00:00 2001 From: ShalokShalom Date: Wed, 2 Apr 2025 23:10:49 +0200 Subject: [PATCH] Add benefits This adds an overview for the cpp2 benefits. I really liked one of Herb's comment on Reddit, as it provided a very nice overview about the benefits of this project. This commit adds that comment in slightly different form, and I hope it can lead to a better understanding of the benefits of Cpp2. I feel like the current README misses a short, condensed overview, for what cpp2 already achieves today. In some talks with existing cpp developers, I found that their subjective interpretation of the state of the language, is FAR behind the reality. Signed-off-by: ShalokShalom --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index bdeea0564..99e37b040 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,18 @@ Copyright (c) Herb Sutter • See [License](LICENSE) Cppfront is a compiler from an experimental C++ 'syntax 2' (Cpp2) to today's 'syntax 1' (Cpp1), to prove out some concepts, share some ideas, and prototype features that can also be proposed for evolving today's C++. +Cpp2 today has + +- *guaranteed initialization safety* (stronger than in 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, and + +- *lifetime safety static analysis.* + +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 -- we could all sleep better. + ## Documentation: [available here](https://hsutter.github.io/cppfront/) ## What's different about this project?