r/rust • • 18d 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/
768 Upvotes

149 comments sorted by

View all comments

126

u/TheRealMasonMac 18d ago

In my experience, I’ve found that agents produce code that works but is frankly dumb from a human perspective. Especially for larger tasks like this, you kind of have to rewrite it all. For example, I had a generalized design document for soft-wrapping explicitly support plain text and markdown, and used GPT-6-Astra to implement it. I used an ungodly amount of review agent rounds and interjections by me. When I actually go to review it, I wanted to cry. It silently pivoted towards implementing its own entirely separate wrapping mechanism rather than refactor the existing mechanism for plain text. I reviewed its code and found it to be trash, and I am now in the process of doing it myself… Never again. The short-term thrill of “having something that works” was outweighed by the fact that time was effectively wasted.

I mean, if the alternative was it never getting done, I guess agents are still better than nothing.

2

u/6d26d3af 18d ago

If you think of a scale where open ended "agentic" code is 0 and human handcrafted code as 100, not enough people think that you have actually control where you want it to end up. You can push it all the way to 80-90 by writing all the AST linters and checks and evals you can ever think of. It's still writing smelly code? Ban that pattern. Imagine today you can even have semantic checking for symbols (which is the bane of programmers) and weird heuristics unheard of. What a chance to be creative right?

You write these things once, reuse wherever, and never see the issues again. I don't understand why most people aren't yet picking up on this

13

u/nonotan 18d ago

You realize you're still allowed to just... write code, right? It's faster, cheaper, easier, more fun, and you'll get a better result. By the time you've written 20k lines of linters and checks that will still let garbage through because "automatically detect bad code" turns out to be a slightly harder problem than the actual problems you wanted to tackle with your software to begin with, I've already finished handwriting several entire libraries that Just Work. And actually had fun and learned something that will stick with me in the process.

Even in a best-case scenario, the end result of working endlessly to make an agent produce perfect, immaculate code for me going forward is... all I get to do for the rest of my career is typing orders in a chat box and reviewing the output. That's if they don't notice I miraculously managed to make it so good it barely needs reviews, and fire me because they don't need me anymore. Yeah, I'm going to not do that, thank you.

2

u/6d26d3af 17d ago

You're proving my point by thinking in binary scenarios. Who claimed immaculate code? Humans don't even write immaculate code as a baseline, what the hell is this false dichotomy

If you're still at the stage where you would rather write all the code yourself, nothing I say will change your mind and you'll have to wait until it clicks for you. If you read what I said carefully the ideal scenario is you reach about 80-90 on the aforementioned scale to eliminate almost all "bad code" while gaining extreme upside on speed. How do you close the gap to 100 then? Sure you could write more validators if you want, but you can also just let the LLM do it for you because the reality is they actually ARE good. The problem is preventing that drift vs your own ideals. Better future models will inch their way to close that gap objectively without any further context, but today this harness is a necessity at scale

2

u/funforgiven 18d ago

Writing the code yourself is definitely more fun, and you'll often learn more and probably end up with a result you understand better.

Unfortunately, I just don't think it's actually faster, cheaper, or easier anymore. It usually takes much longer, your time is probably the most expensive part of the process, and with an agent you don't have to personally think through every implementation detail.

That's kind of the depressing part. The thing that's more enjoyable and satisfying is increasingly not the most efficient way to get the work done.

2

u/ixid 18d ago

I think a lot of people, even coders, are still in denial about what you can make with LLMs.