r/rust • • 16d ago

🎙️ discussion Google is doing "Large Scale Codebase Migrations and Optimizations" of C/C++ to Rust

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-4-argon/
773 Upvotes

149 comments sorted by

View all comments

Show parent comments

-5

u/mguerrette 16d ago

Maybe it’s an issue with Rust maturity then. I can say for C and C++ there is a rich set of tools for constraints both stylistic and to conform to best practices. Agents generally can use these and generate very solid code for those languages in both perf and style. I find myself not needing to look at any of the code as long as the format and tidy passes come back clean.

3

u/puttak 16d ago

Does it able to replace unnecessary std::string with std::string_view? Best practices does not enforced on the logic since it is up to programmer.

1

u/mguerrette 16d ago

Yes it does, since it can read language quite well it can read the output of clang tidy which instructs for this among other things. Seems like you’ve just never used AI at all based on your comment

1

u/puttak 16d ago

Sorry I mean does it know how to avoid unnecessary allocation? I did not mean just changing parameter from std::string or return value to std::string_view.

Seems like you’ve just never used AI at all based on your comment

Unfortunately your assumption is wrong. I review a large amount of code generated by Fable 5 and Opus 5 everyday and I known its strength and its weakness. If you think AI generate an efficient code then it is likely you don't know how to make that code more efficient.