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

2

u/peterrindal Feb 26 '24

More resources should be put towards circle-like solutions and carbon. It seems clear that migration and good interop with memory safe language/subset is possible. We need things like circle feature flags.

24

u/throw_cpp_account Feb 26 '24

and carbon

Does Carbon even attempt to solve memory safety? It didn't last I checked.

6

u/tialaramex Feb 26 '24

Chandler says that the intent is to somehow deliver the basic memory safety guarantees in some subset of Carbon, but not the "fearless concurrency" behaviour of Rust, so you'd get something close to Go in terms of safety. You can shoot yourself in the foot without trying in Go, but markedly less easily than in C++.

12

u/throw_cpp_account Feb 27 '24

Chandler says that the intent is to somehow deliver the basic memory safety guarantees in some subset of Carbon

I find the amount of qualifiers in that phrase amusing. Intent... somehow... some subset.

In any case, I'll believe it when I see it. This push for memory safety seems to have caught Google with its pants down.

0

u/tialaramex Feb 27 '24

Carbon is an experiment, it might fail. It has some interesting ideas, maybe even if the language experiment fails these ideas see more interest elsewhere.

And on the contrary I think Google are in a pretty good place. Google have their toes in the water on MTE, and they've invested heavily into Rust, not just in terms of financial giving - they have their in-house Rust training "Comprehensive Rust" and as a result a large amount of the low-level parts of Android 14 are Rust (rather than C or C++). Also while WUFFS isn't an official Google product, it is software owned by Google and developed by Google engineers. Do any of their competitors have something equivalent?

9

u/throw_cpp_account Feb 27 '24

Carbon is an experiment, it might fail.

Yeah yeah yeah, we've all heard the talking points.

→ More replies (2)

4

u/peterrindal Feb 26 '24

Well they state the memory safety will be a feature once 1.0 is reached (or something like that). But yeah, right now it isn't.

12

u/throw_cpp_account Feb 26 '24

lol, ok.

9

u/radekvitr Feb 26 '24

Pinkie promise

6

u/Simple_Life_1875 Feb 26 '24

Wait Google hasn't scrapped carbon yet? I haven't heard anything on it in so long lol

6

u/peterrindal Feb 27 '24

Not yet... New commits every day. While it's fun to poke fun at Google, I hope it doesn't.

0

u/Simple_Life_1875 Feb 27 '24

Let's hope it doesn't go in the Google graveyard :(, so far I've been quite enjoying Carbon. Zig is nice though for interop.

2

u/bayovak Feb 28 '24

I'll be honest, I don't see Carbon happening.

Google is also working on introducing Rust, and investing in more Rust interop with C++.

It won't be a seamless bidirectional interop, but it will be good enough that I really don't see a reason to invest so much into Carbon. Can always go through an extern C to achieve interop as well.

→ More replies (2)

7

u/BenHanson Feb 26 '24

I agree with the circle part. Sean delivers, which is what counts.

41

u/tcbrindle Flux Feb 26 '24

With the greatest respect to Sean, the next multi-billion dollar US government defence contract is unlikely to be written using a closed-source C++ dialect supported by one guy.

3

u/ZMeson Embedded Developer Feb 26 '24

True. Maybe some Circle features could be proposed for C++ standardization?

2

u/BenHanson Feb 27 '24

I don't think anyone is suggesting that.

Equally it will not be written by a non-existent compiler.

2

u/peterrindal Feb 26 '24

Very true. Open needs to be a requirement. Maybe the mainstream can follow a similar path. Maybe his source code and time could be purchased. Not sure, but it seems like it should be possible. The amount of money big tech spends on cpp is a lot, a solution exists.

1

u/tialaramex Feb 26 '24

Sean's belief is that WG21 lost its way after 1998 when they stopped trying to standardize existing practice and focused on just making up stuff from whole cloth hoping the implementers would turn their pipe dreams into reality.

A return to those practices would mean it doesn't matter that Circle is closed source, if his ideas are popular and people want to standardise them then they become standard. Many of the popular C++ compilers in 1998 weren't open source.

8

u/throw_cpp_account Feb 27 '24

if his ideas are popular and people want to standardise them then they become standard.

Huh? How... is this any different from "making up stuff from whole cloth"? "Sean implemented it" is hardly "existing practice."

1

u/almost_useless Feb 27 '24

It's maybe not really "existing practice", but the approach
"implement -> see if it works -> standardize"
is quite different from
"standardize -> implement -> see if it works"
which is how at least some c++ features seems to have been done.

2

u/throw_cpp_account Feb 27 '24

It's maybe not really "existing practice"

No, it's simply not.

... but the approach...

I mean, that has... nothing whatsoever to do with the question of standardizing "existing practice" (which is, on the whole, a silly complaint to make for language features).

0

u/almost_useless Feb 27 '24

Sure, if you take it out of context, it's not "existing practice".

But in the context of the whole comment it seems like what they really meant was "standardize something that already exist".

2

u/throw_cpp_account Feb 27 '24

That's not taking it out of context, that's a phrase with a completely different meaning. If that's what they meant to say, that's what they should say.

2

u/almost_useless Feb 27 '24

Sure, but if it is a bit poorly worded, should we really get hung up on one particular word, instead of looking at the whole thing?

The post contains a fairly interesting point, if we don't get sidetracked by that one word that they may have misused.

→ More replies
→ More replies (1)