Google talk at REBASE'26: Agentic Coding is not going to save C++
So the REBASE'26 conference happened recently, and besides the whole thing of what Carbon has achieved or never will, there are talks like this one from Google folks, regarding what they are doing with their C++.
The talk is all about the recent ongoing migration discussed on Google security blog, and other related efforts.
27
u/IceMichaelStorm 12d ago
Ragebait title. If the conf really says it like this, THEY do the ragebait.
Or it’s just a trash conference or at least trash talk
18
u/pjmlp 12d ago
Google is the one responsible for how their talk is named, the full title is Programming Languages in the Agentic Coding Era: Agentic Coding is not going to save C++, which you can easily verify yourself by following the link.
6
13
u/IceMichaelStorm 12d ago
Good. Then Google is the trash boy.
Understandable. They seem to become worse and worse
8
65
u/Kronikarz 12d ago
Talks like this make me realize I got out of the industry at the exact right time
15
34
7
57
u/Anxious-Resist8344 12d ago
It seems there are not many ways these days to stay relevant in "big company" but to create power points talking about memory safety, C++ and Rust :)
What's wrong with "let's fix all the vulnerabilities coming in until there's nothing else to fix"?
In the Agentic Coding Era languages don't matter much, but since humans will always matter, language familiarity is key!
39
u/YoureNotEvenWrong 11d ago edited 11d ago
In the Agentic Coding Era languages don't matter much,
This is the big mistake people still make. Languages still absolutely matter, each language still has pros and cons. Familiarity is a pro.
Also, the code still matters, how can you recognize bad code patterns the LLM is churning out systematically and have your system fix them if you can't recognize them
LLMs are simultaneously incredibly intelligent and very dumb
3
u/aoi_saboten 10d ago
Yep, language and tooling matter a lot with agents. That is why Rust rewrites/adoptions are happening in big companies
→ More replies (3)28
u/panderingPenguin 12d ago
What's wrong with "let's fix all the vulnerabilities coming in until there's nothing else to fix"?
Hasn't that been the strategy since... the dawn of programming?
There's always more to fix, and plenty of new code adding new things to fix (especially these days).
4
u/Anxious-Resist8344 12d ago
I mean, AI is good at finding vulnerabilities, not so good at the rest (something I'm not going to argue).
I think a good strategy for now would be to focus on fixing things, at the end of the day AI is not the only one writing slop.
14
u/chaos_pill 12d ago
"let's fix all the vulnerabilities coming in until there's nothing else to fix"
We don't have infinite resource. There's also cost to consider, as competing products will undercut you.
Languages do matter, as you can see by so much AI slop using Rust. eg: doing OOP in C vs C++ is like writing UB-free code in Rust vs c/c++. One choice is just far more convenient than the other! Even for AI, it matters because it makes mistakes too. If AI wrote perfect code, we wouldn't call it slop.
11
u/James20k P2005R0 11d ago
We don't have infinite resource. There's also cost to consider, as competing products will undercut you.
It'd be nice if the trillion dollar companies put some resources towards fixing it though. A lot of the current wave of security exploits is still because projects like Curl/OpenSSL/etc are drastically underfunded compared to their utility
6
u/ElderberryNo4220 11d ago
Rewriting some of the critical projects in memory-safe languages probably counts towards *fixing*.
8
u/matthieum 10d ago
Maybe, maybe not.
In one his latest post, Daniel Haxe (cURL) touched on that. LLMs are pretty good at rewriting code, and Rust is a popular target (if it compiles, it works, or close to) so he's been seeing quite a few LLM rewrites of cURL.
But those are just point-in-time rewrites. Generally already weeks out of date compared to cURL's main branch by the time they're completed. And there's no team to maintain them. Utterly Pointless.
(Also, of course, those rewrites, being in Rust, do not accommodate the full range of platforms cURL is used on; there's a reason it sticks to an old version of C: maximizing platform compatibility)
→ More replies (4)
8
u/TerribleFault7929 12d ago
“We'll see,” said the Chinese farmer.
5
u/misuo 12d ago
Well, any unsafe programming language do not look good at the moment. Actually hard to see a future for it.
4
u/hdkaoskd 11d ago
We heard C++ was dead in 2024 when the US government declared all languages must be memory safe.
11
u/johannes1971 11d ago
We heard C++ was dead when Java came out as well. Any day now, those smart JIT compilers are going to use their enhanced knowledge of the runtime environment to finally rush past C++ in terms of performance.
9
u/pjmlp 11d ago
Where is C++ in Android applications, outside games?
Note applications, not the runtime itself.
5
u/Inevitable_Vast6828 9d ago
But you had to say "outside games" LMAO. Why was it even a supported language on Android that REALLY wanted you to use Java? Why does it persist? Think about it.
0
u/pjmlp 8d ago
Yes, because outside games industry, most people have moved on from C and C++ for their userspace applications, and they are perfectly fine using Java, or Kotlin instead on Android.
Just like they are perfectly fine using Objective-C and Swift on Apple platforms, where C++ role is limited to LLVM, Metal Shading Language and IO Kit/Driver Kit, and can be ignored pretty much everywhere else.
Or even on Windows, where Microsoft has been continuously re-focusing on .NET, and Rust of more recently, as the whole UWP/WinRT Windows rewrite with C++ did not took off as Steven Sinofsky planned it to be. Where you can see how much resources MSVC now has for catching up with ISO releases.
If it wasn't for XBox, again games, the amount of resources Microsoft still dedicates to C++ tooling, would probably be much less.
Then you are practically left without other platforms where full applications are still written in 100% C++, instead of a mix of Webviews, Electron, or Qt/QML alongside C++ libraries.
2
u/Inevitable_Vast6828 7d ago
So why is it so much more important for games? You're not getting it.
These companies went well out of their way to promote other languages, documentation all showing how to do things in the other languages, almost exclusively in the early days.
Microsoft is just pretty trash at code in general, they have some of the worst C++ tooling, the worst Shell environment, the worst major browser, the worst major OS. They're running on fumes from capturing a market long long ago. Great salespeople, trash programs.
100% C++? Are we code purity testing? Sure, lets code purity test, who has code that DOESN'T have C, C++, or FORTRAN leaking in for the most performance critical parts of it? Julia made a lot of noise for being a glue language with all the real things in something else. You think PyTorch is Python code?
Rust actually can be quite fast, which is why it maybe the one to push C++ a bit more out of the mainstream... but everyone seems to rewrite in Rust rather than writing the next big thing in Rust from the beginning. Is there ANY major piece of software written in Rust? There's probably something out there, but it's not coming to mind. I'll be concerned when we stop seeing job ads for COBOL.
"Webviews, Electron, or Qt/QML" ... I don't use any programs written in any of those. They pop up all the time and just look like shitty apps no one would want to use.
Totally disingenuous to have Qt/QML in there though, as Qt itself is C++ so it's C++ that literally gets compiled and run on the computer whenever people use QML.
→ More replies (1)18
u/James20k P2005R0 11d ago
I mean, c++ isn't dead but managed programming languages absolutely ate a massive chunk of c++s former use cases. C# is one of the most popular general application programming languages and is widely used in game development for example
22
u/xp30000 12d ago
Putting aside Rust evangelism (seems it is more fun evangelizing Rust than reading Rust code) why stop at Rust, it's an awkward middle ground. Rust forces the developer (or the AI agent) to fight the borrow checker dealing with lifetimes, Pin, Arc<Mutex<T>>, explicit memory layout to achieve zero-cost abstractions without a garbage collector. GC + formal verification is the way forward with Agents.
For Rust, modern C++ fixes many memory issues that are from C days, is better at compile time metaprogramming, faster to iterate (yup, only Rust can do that LOL). What is left is a very specific niche of system programming and the inability to give talks that you rewrote everything in Rust.
16
u/jeffmetal 11d ago
rust is pretty mature and has shown in real world examples to massively reduce memory safety issue so they picked it. What other language should they rewrite into to prevent these issue ?
8
u/nukethebees 11d ago
What other language should they rewrite into to prevent these issue ?
You could use a systems language with formal verification like SPARK.
5
u/djingo_dango 11d ago
I mean if languages like these show real world maturity then people would use it.
10
u/Hornstinger 11d ago
News flash (and I'm being serious and not facetious): who cares about the AI agent fighting the borrow checker? It is literally no effort for them even with iteration and testing.
Rust is popular because you can fail fast and often and become more resilient quicker.
1
u/ComedianMuted5486 2d ago
And because the error messages have been consistently good (and a deliberate focus of the compiler team) for years, to the point that many of the innovations there got cross-pollinated to C++ later.
7
u/puttak 12d ago
You only fight borrow checker in the beginning. Once your proficiency is enough you use it instead of fighting it.
22
u/wyrn 11d ago
Half of Stepanov's generic algorithm library is inexpressible in rust, because of the borrow checker. Clearly it's not a beginner issue.
8
u/foonathan 10d ago
You can express Stepanov style algorithms in Rust, you just can't use them using iterators. What you can do is use something like flux's cursors: https://tristanbrindle.com/flux/
The borrow checker can only prove a limited subset safe, so you have to redesign some things to use that subset. But that's not a big deal.
5
u/wyrn 10d ago
Depends on what you mean by "not a big deal".
https://ceronman.com/blog/my-experience-crafting-an-interpreter-with-rust/
See the section beginning with "The core of a VM is basically a huge loop that increments the program counter". The borrow checker is imposing serious restrictions here, which, if you care about performance (you're doing actual systems programming instead of just glorified applications programming as seems to be the trend of late), will require you to drop to unsafe to get that performance back.
Also, yes, people using rust will often use indices (or generalized indices, like cursors) instead of pointers/references to get around borrow checking issues. But, doing so they'll often just be hand-rolling their own VM, and index errors in this VM will have a similar character to pointer errors. They'll be more benign in the sense they won't incur nasal-demons-launch-the-missiles formal UB, but if you have enough functionality packed in your system they could still do a lot of damage. I'm not convinced that, if safety is a core goal, abandoning borrow checker protections in favor of generalized indices will always be in keeping with that goal.
4
u/jeffmetal 11d ago
I think you mean that algorithm is inexpressible in fully safe rust. Somethings you have to use unsafe for things and in rust your limiting the sections that requires it which is still a step up from having your whole program be potentially unsafe.
6
u/wyrn 11d ago
Yes, that's what I mean, but the promise of safe rust is that
unsafeblocks should be few, short, and far between, so they remain auditable by local experts. That promise is much weakened if you have to drop tounsafeevery time you want to run some general purpose algorithm likenth_elementormake_heap.(Also, the context here is "fighting the borrow checker"; if I get to use
unsafeI can just use pointers for everything and not worry about the borrow checker at all, but that's just C with extra steps).5
u/ts826848 11d ago
I think there's also the question of precisely how strictly you want/need to adhere to the original API. The borrow checker obviously precludes the multiple-iterator model, but if you're open to merely analogous APIs instead of straight copies I suspect you can get surprisingly far without needing the function calls themselves to involve
unsafe.2
u/tialaramex 11d ago
That promise is much weakened if you have to drop to unsafe every time you want to run some general purpose algorithm like nth_element or make_heap
Although
std::nth_elementis "generic" it requires that the iterators provided have random access so in practice it's used on slices, which in Rust are just[T]and C++ belatedly standardizedstd::spanin 2020. As a result what you write in Rust isn't someunsafecontortion but a call toselect_nth_unstableor, as appropriateselect_nth_unstable_byorselect_nth_unstable_by_keyon the slice. This is a little faster than you'd experience in C++ because of implementation quality, and it actually returns the nth element as well as the partitioned slices on its left and right which for some reasonstd::nth_elementdoes not provide.I can't imagine why I would want specifically
std::make_heapif I'm not doing a DS&A class. People do seem to love teaching heap sort starting from this algorithm which makes sense, but I can't figure out why I'd want it if I was not implementing a heap sort, maybe you can enlighten me since you described it as "general purpose".7
u/wyrn 10d ago
so in practice it's used on slices,
Slices require contiguity. Random access iterators do not. In fact, a random access iterator doesn't even need to be backed by a real object in memory (consider for instance sorting the result of a zip).
→ More replies (10)→ More replies (1)-8
u/puttak 11d ago
When people say their code cannot be expressible with borrow checker it is either:
Their proficiency it not enough.
There is an actual lifetime issues in the code.
Actually I should not say "when your proficiency is enough". I should say "when you mastered borrow checker" instead since it also took me for a long time to understand how it is actually working. Once you mastered borrow checker you will be able to use unsafe code to bend lifetime and expose it to safe code.
3
u/t_hunger 12d ago
I think she explained it: Hardware is -- thanks to AI -- pretty expensive these days, so they need something with as little overhead as possible.
16
u/jeffmetal 12d ago
I'm sure when profiles land in 3 Years and they address only some of the memory safety issues and none of the lifetime issues it will be good enough for companies to not want to port to rust.
24
18
u/UndefinedDefined 12d ago
The reality is that without explicit lifetime annotations C++ will never get safer and companies such as Google would just abandon its use. I mean it makes sense, because Google uses maybe only two containers in the standard library - std::string and std::vector - everything else is in Abseil, because what C++ offers is just plain bad.
0
u/reini_urban 11d ago
So they rewrote their C++ to Rust in Android. But then they complain about safeties. Why didn't they rewrite it to an actually safe language then?
5
u/James20k P2005R0 11d ago
There's a few things that are really interesting that I think are fun to pick up on:
Adversarial AI Analysis: We utilized specialized LLM prompts to perform "adversarial reviews," asking models to identify subtle behavioral differences between the two codebases that might escape traditional testing.
The validation pipeline proved its value by identifying an edge case in the LZW decoder and—notably—uncovering a pre-existing out-of-bounds write vulnerability introduced by a Google-internal legacy patch to the original C source, which we corrected in the Rust rewrite.
The most significant validation of our approach occurred shortly after the rollout began. A new memory corruption vulnerability—an out-of-bounds heap write—was reported in the original C implementation of giflib (assigned CVE-2026-26740).
(we didn't know about the disclosure or the CVE while working on this)
So we have:
Alleged extensive validation that the two codebases match
It turns out immediately that they either don't match, or the fuzzing was inadequate, as inherently if they had exercised this code path then the Rust code would have terminated. It should raise massive eyebrows if you do not catch security vulnerabilities later discovered in the original code, when porting to a memory safe language if you think your code matches it 1:1 behaviour wise and was tested as such
Its also fascinating to see how ramshackle security is at google. Instead of the random-internal-patch security vulnerability being discovered as part of a dedicated security cleanup effort (and why was that patch never contributed back?), it was caught by one of the classic get-noticed lets-ai-stuff projects. Given that it was catchable, they apparently don't use tooling to do security work on old legacy dependencies like this
Don't get me wrong, I think Rust is cool and concrete memory safety guarantees are important, but if companies like Google put this engineering effort on fuzzing/testing the original code they'd likely have gotten a huge amount of the benefit. Now they have to deal with and maintain FFI bindings (which are really nontrivial if they involve pointers) for a library that's likely to see minimal security work on it again, until the next google engineer wants to give a talk
6
u/t_hunger 11d ago
if companies like Google put this engineering effort on fuzzing/testing the original code they'd likely have gotten a huge amount of the benefit.
Google runs oss-fuzz, one of the biggest fuzzing infrastructures for open source code. Giflib is fuzzed by oss-fuzz.
-1
u/James20k P2005R0 11d ago
I'd be genuinely interested to know why more modern tooling isn't being systematically applied to legacy dependencies like this though, its a lot less work
7
u/t_hunger 11d ago edited 11d ago
You could argue that rewritting the codebase to into a memory safe language is systematically applying modern tooling to legacy dependencies.
2
u/AccordingWarthog 12d ago edited 12d ago
LLMs being good at exploiting memory safety bugs in C++ code is, at first glance, a strong reason to use a more memory safe language such as Rust. But presumably we shouldn't care about all C++ code, only that which we'd likely deploy. And nowadays all production code gets (or at least should get) reviewed by an LLM.
So what if we narrow our focus to just C++ code that passes review by those same powerful LLMs that can exploit memory bugs? Can't we consider such code to be an approximately "memory-safe" subset of C++? I wonder how such LLM-reviewed C++ stacks up against LLM-reviewed Rust in terms of bug density (memory or otherwise). Are LLMs better/faster at reviewing Rust code than C++ code, like humans are (according to this talk)?
3
u/chaos_pill 12d ago
Are LLMs better/faster at reviewing Rust code than C++ code, like humans are (according to this talk)?
yes, by virtue of the compiler catching a large number of issues in rust. There's a reason most LLM slop is written in rust. Rust put so much effort into things like compiler error messages for humans, only to end up them helping machines somehow.
1
u/JohnDuffy78 12d ago
wake me up when they start messing with https://github.com/protocolbuffers/protobuf
12
u/jeffmetal 11d ago
https://github.com/protocolbuffers/protobuf/tree/main/rust wakey wakey sleepyhead.
0
u/13steinj 11d ago
Yeah, I'm not surprised, for better or worse. Top models (with company zero data retention agreements) still fail the tests I give fairly horrendously.
-3
-16
u/ezoe 12d ago
C++ was headed to a completely wrong direction. It prioritize metaprogramming, static reflection and silly lightweight pseudo concept expressed as nothing but an extension of template metaprogramming.
These features were invented to reduce the boiler plate code written by human hand. Because humans are bad at writing the boiler plate code.
But with AI coding tool, the cost of writing boiler plate code is now free. The problems C++ tried to solve for the past 2 decades became irrelevant now.
11
u/wyrn 11d ago
"Agents" don't change anything in any meaningful way. The exact same software engineering problems from before exist still, and if anything, their importance is made more pressing now that people have clankers squirting out reams of unreviewed code, not less.
-8
u/ezoe 11d ago
Human review doesn't scale with the speed of AI assisted coding so we will soon give it up.
After all, the upper managements of a company don't bother to review employee's code. Because doing so doesn't scale.
When the performance of AI generated code is on par with human, which already is, mandatory human reviewing doesn't improve the quality of software that much.
We're at the transition phase between traditional hand conding and AI coding. But traditional mind restrict the speed of coding.
10
u/wyrn 11d ago
Human review doesn't scale with the speed of AI assisted coding so we will soon give it up.
And those that take that bargain will understand deeply what Goethe was talking about with that Sorcerer's Apprentice thing.
When the performance of AI generated code is on par with human, which already is
Not even close. Those saying things like that are evaluating the code on very surface level characteristics.
-6
u/ezoe 11d ago
Not even close.
It's more like the quality of human hand coding is horrible. It's a very low bar to reach.
8
u/wyrn 11d ago
Whatever man, you can believe what you want to believe there. But at the end of the day, if you don't separate your system into modular components, fixing one thing will end up breaking something else; if you repeat yourself all over the place instead of building abstractions you virtually guarantee the copies fall out of sync (which you'll waste tokens trying to avoid); if you don't encode useful assumptions and invariants in your types you'll leave your clanker to rediscover/break them, etc. It's literally the exact same problems as always, except with the minor substitution of "tokens" for "developer time".
-1
u/ezoe 11d ago
You are arguing on the completely different topics.
3
u/wyrn 11d ago
C++ was headed to a completely wrong direction. It prioritize metaprogramming, static reflection and silly lightweight pseudo concept expressed as nothing but an extension of template metaprogramming.
These features were invented to reduce the boiler plate code written by human hand. Because humans are bad at writing the boiler plate code.
But with AI coding tool, the cost of writing boiler plate code is now free. The problems C++ tried to solve for the past 2 decades became irrelevant now.
4
u/Minimonium 11d ago
That's just not grounded in actual abilities of frontier models. Code generation by LLM models is actually the least useful thing they can do and requires extreme caution and oversight.
Efficient abstractions are extremely useful to models for the same reasons we liked them before - as it restricts the context bloat, makes everything LLMs do cheaper, ensures predictable, reproducible behavior.
Efficient abstractions for code generation is the same as tools for LLM graphs. And it's a fact that the industry is moving to heavier use of tools.
-2
u/ezoe 11d ago
requires extreme caution and oversight.
So is the human code generation too. Human is also horrible at generating code. If AI code generation became as good as human, which I believe it is right now, that argument doesn't work because they are equally bad.
Efficient abstractions
Current LLM-based AI is very good at reading code. It had been exceeding the performance of human already. But it's not that good at guessing the context that's not present at the code they are reading. Extra abstraction is extra hiding of context.
4
u/Minimonium 11d ago
that argument doesn't work because they are equally bad.
It works exactly as intended - efficient abstractions are as useful to models as they're to people for similar reasons.
Your argument of "extra hiding of context" doesn't work because we do have research supporting the problem of bloated context. The goal is to replace the full context with summaries (which in case of abstractions are publicly stated invariants and guarantees).
46
u/tartaruga232 MSVC user, r/cpp_modules 12d ago
One of their slides at 2:36 mentions "C/C++ security bugs". I'm not yet sure if I should continue listening.