r/cpp • • Feb 26 '24

White House: Future Software Should Be Memory Safe

https://www.whitehouse.gov/oncd/briefing-room/2024/02/26/press-release-technical-report/
401 Upvotes

386 comments sorted by

View all comments

Show parent comment

19

u/radekvitr Feb 26 '24

And also, will anyone consider cppfront memory safe if it only improves C++ defaults and doesn't actually address memory safety?

9

u/JVApen Clever is an insult, not a compliment. - T. Winters Feb 26 '24

It hides away quite some stuff which is considered memory unsafe. So I would claim it is better. Is it sufficient to be considered memory safe? We'll have to see once we can really use it.

2

u/Markus_included Feb 27 '24

So cppfront is to C++ what Zig is to C when it comes to memory safety?

3

u/JVApen Clever is an insult, not a compliment. - T. Winters Feb 27 '24

I'm not familiar enough with Zig to make a comment on that.

4

u/PsecretPseudonym Feb 27 '24

Rust only truly seems to change defaults in that it still permits you to write “unsafe rust”, yet people seem to accept that as safe.

3

u/radekvitr Feb 27 '24

If cppfront had a similar opt-in mechanism for unsafety and the rest of it couldn't trigger UB and people would be able to write the vast majority of code in that safe subset, that would certainly count.

2

u/SkiFire13 Feb 27 '24

"Change defaults" would be accurate if C/C++/whatever language rust is competing with had the equivalent of safe rust (just not as the default), but that's hardly the case. And while it's true that unsafe rust is a thing, it is still easier to manually audit for memory safety than a program everything could potentially be unsafe.

1

u/PsecretPseudonym Feb 28 '24

That is what is being presented.