‹ BackHN Continuity

Thread

Gemini 4 Argon

1699 points · 1187 comments · bradleyg223

  1. tazjin · · focus · HN ↗
    > Argon agents are working on migrating C/C++ codebases to Rust across Google

    Man, I remember back in the days when the cppnext team was refusing to even consider Rust, instead looking at absurd stuff like Carbon and Swift (!), even though half of the engineering staff already knew where this was headed. I hope they got a few good promos out of the delays at least.

    1. ChickeNES · · focus · HN ↗
      Heh, I use my clankers to rewrite Rust in C
    2. baq · · focus · HN ↗
      Not many people can hold grudges as strong as principal engineers
      1. bbor · · focus · HN ↗
        Longtime Google engineers have it particularly bad. Some of it could be bad-faith promotion hunting I suppose, but the core problem is that their "find something to work on" culture leads to some insanely dysfunctional ideas around ownership. In the reverse, too; only at Google can you be the head engineer for a service necessary for $10B in ARR and never really realize it.

        Also the internal tooling culture there is just insane. I'll never forget the day the last SUPER_ESSENTIAL_TOOL was marked as "Deprecated - do not use!" while the only replacement was still marked "Pre-release -- use at your own risk!". I can't pretend to know what dynamics led to that cause it was so far from my org, but I can't imagine they were healthy ones!

    3. timmg · · focus · HN ↗
      I wonder if this means Carbon is DOA.

      I was excited to see what it would be. But I don't think I can argue that it makes as much sense anymore.

      1. qalmakka · · focus · HN ↗
        Carbon was clearly DOA the moment it was announced, IMHO. It looked cool but it served none but Google, and now with LLMs you have a massive incentive not to use a niche or new language due to how better LLMs get the bigger the corpus is

        The only somewhat realistic proposal in this space is Herb Sutter's cpp2, which is arguably a massive improvement and I'm puzzled why nobody in the standard thought to give it a spin, there's just to much cruft they'll never be able to get rid of unless they make an alternate yet backward compatible syntax with C++ that changes the defaults from "random 80s nonsense" to something better

        1. Mond_ · · focus · HN ↗
          Cpp2 has been dead for a while afaik, while Carbon is still going.

          I don't think Carbon is dead, it just all depends on how easy it actually is to rewrite "all of C++" in Rust. (The jury is still out on this one, but it's not looking good.)

          1. qalmakka · · focus · HN ↗
            Yes, but at least it was a real thing with a serious proposal behind. Even if Carbon ships, what value would it give in 2029 or whenever it is in a world where writing rust or heck even C++ is now way easier and foolproof (as long as you know where to guide an LLM)
            1. pjmlp · · focus · HN ↗
              The Carbon team has always been the first one to assert this is for Google internal purpose first and formost, everyone else should go to Rust, Java, Go, C#, Swift,... whatever fits their workloads.

              It has been the social media that has given Carbon a roadmap that the team never communicated.

              As for Cpp2, it was yet another C++ wannabe replacement, sold as if it wasn't, because the chair of ISO C++ at the time, naturally could not be seen as yet another one coming up with C++ wannabe replacements as well.

        2. geokon · · focus · HN ↗
          Is there evidence that LLMs generate better code in more popular languages? I get the sense the "experience" translates between languages and it can reason in any language just fine. I write Clojure code using a rather esoteric framework (Pathom3). There is probably very little similar code out there (it's definitely a tiny fraction of the training dataset) but it seems to do just fine

          Not saying you're wrong, just curious if there are numbers backing this up.

          1. qalmakka · · focus · HN ↗
            In my experience LLMs are way better when they "know" a language "instinctively". It's just that unless your language is very niche, the corpus is usually good enough. I tried using Claude to write my own personal language a while ago (I wrote a toy compiler decades ago) and it struggled a bit, because you could see in it's reasoning it had to "repeat" the syntax equivalence to itself while it read the code. It didn't just "know" it could use a given construct to do something; conversely Astra, when carefully instructed to do so, can plop down esoteric template code that works the first time, because it just "knows" it's the right stuff to write
          2. dom96 · · focus · HN ↗
            I built a brand new language to test this[1]. Not only is the language different to basically any other language but it also tries to be adversarial against LLM understanding.

            The best models can still make sense of it[2], though the tasks so far have been pretty basic. But I do think it gives some evidence that languages which aren’t well represented in an LLM’s training can still be reasoned about and written well by LLMs.

            1 - <a href="https:&#x2F;&#x2F;killswitch-lang.org" rel="nofollow">https:&#x2F;&#x2F;killswitch-lang.org

            2 - <a href="https:&#x2F;&#x2F;bench.killswitch-lang.org" rel="nofollow">https:&#x2F;&#x2F;bench.killswitch-lang.org

        3. fg137 · · focus · HN ↗
          None of these solutions has a chance. That should be clear from the beginning. The last thing the C++ community will do is to migrate to an incompatible language that only looks&#x2F;reads like C++ -- that did not happen in the past 30 years and will not happen now.
      2. YuechenLi · · focus · HN ↗
        Version 0.0.0.0 after 4 years. Their goal of &quot;full interop with C++ while being a completely new language without any of the flaws of C++&quot; is plain absurd.

        It&#x27;s DOA because Google doesn&#x27;t have any idea of what Carbon should be, and to be completely honest, at least 80% of what they currently use C++ for should be rewritten Go, you know, that language developed specifically because of the issues with C++ by teams within Google.

      3. pornel · · focus · HN ↗
        Carbon&#x27;s own docs say:

        &gt; Existing modern languages already provide an excellent developer experience: Go, Swift, Kotlin, Rust, and many more. Developers that can use one of these existing languages should.

        So the reason for Carbon to exist is gone. C++ code can be migrated straight to Rust without Carbon&#x27;s stopgap.

        1. akoboldfrying · · focus · HN ↗
          I think that&#x27;s overstating it. Carbon promises a reliable transition; getting an LLM to rewrite in Rust depends on the LLM being smart enough to never make a mistake that it can&#x27;t catch with (existing or its own freshly created) tests.

          LLMs are very good now, but they are still stochastic (when temp &gt; 0), and Google has a lot of code -- i.e., many rolls of the die.

          1. fg137 · · focus · HN ↗
            &gt; Carbon promises a reliable transition

            Does it deliver?

            Can all existing C++ code be ported to Carbon without refactoring?

            1. akoboldfrying · · focus · HN ↗
              What you know with Carbon is that the subset of code that you can port mechanically is behaviourally equivalent to the original. This is massive, and something you can&#x27;t get from LLM translation.
              1. fg137 · · focus · HN ↗
                Is anyone doing that, especially at Google?
                1. akoboldfrying · · focus · HN ↗
                  I don&#x27;t know.
          2. pornel · · focus · HN ↗
            The bar isn&#x27;t getting it perfect. The bar is merely parity with the legacy C++ code that wasn&#x27;t perfect either, which nobody wants to maintain either.

            LLMs are fuzzy when generating, but such conversions aren&#x27;t done one-shot. Review and test feedback loops are there to catch the random errors. The frontier models are getting good enough at this.

            When LLM is instructed to generate idiomatic safe Rust (rather than literal 1:1 unsafe translation), it benefits from a lot of feedback from the compiler.

            Whatever QA there was to ensure C++ was good enough can be applied to the Rust version too.

            1. akoboldfrying · · focus · HN ↗
              &gt; The bar isn&#x27;t getting it perfect

              Right, I&#x27;m also talking about making the new Carbon code behaviourally equivalent to the old C++ code, i.e., bug-for-bug compatible (except w.r.t. C++ bugs caused by UB).

              &gt; Whatever QA there was to ensure C++ was good enough can be applied to the Rust version too.

              The point is that all that QA over the years was a vast amount of effort by highly-paid Google engineers, which could be (mostly) avoided by mechanising the conversion as far as possible, which is something that Carbon&#x27;s approach can do and LLM translations can&#x27;t.

              I&#x27;m not against LLM translations per se. Ultimately it&#x27;s an engineering decision like any other. I&#x27;m just pointing out that, similar to the benefits of using a strongly typed language over relying purely on tests, using an approach that guarantees to eliminate a large class of possible problems has many advantages, especially at scale.

      4. DetroitThrow · · focus · HN ↗
        It was never built with an open source community in mind. It was always DOA in a world where Rust existed.
    4. vovavili · · focus · HN ↗
      What exactly makes Carbon absurd?
      1. Maxatar · · focus · HN ↗
        The fact that it will never exist.
      2. gorbot · · focus · HN ↗
        rust&#x27;s existence?
      3. boshalfoshal · · focus · HN ↗
        There is 0 practicality in inventing an entirely new coding language that only one company uses, and you have to teach it to thousands of new engineers. Rust exists and fits the job totally fine and is used in more places and has actual support outside of a single entity (i.e you can actually hire people that feasibly know the language).

        It was clearly done because some PL guys at google really wanted to make a new cool language and Google was the perfect place to incubate it without it getting axed. Probably got a couple of promos out of it too. This is clearly not the best use of time or money, but I guess if you&#x27;re google you have so much of both it probably doesn&#x27;t really make a dent, and you can keep a few very smart people happy with shiny new projects.

        Also, LLMs being used for a large portion of coding nowadays sort of remove the need for these types of languages, IMO. They make less &quot;silly&quot; bugs (both logical and structural) that languages like this are meant to catch, and they are much better at languages that are better represented in the training corpus. This somewhat obviates the need for very niche &quot;type&#x2F;dummy-safe&quot; languages like carbon (and even rust&#x2F;zig, imo). So even if you did want to use Carbon, you&#x27;d likely have to bootstrap a decent amount of your own &quot;good&quot; carbon code to post train an LLM, and even then, it likely won&#x27;t have that big of a gain vs just having an LLM write C++ or even Rust. If you are a company that still reviews code, you should just have an LLM code in a language most people can understand anyway to make verifiability tractable.

        1. vovavili · · focus · HN ↗
          That same logic could have been applied to Go.
        2. computerdork · · focus · HN ↗
          Hmm, I don&#x27;t disagree with you that LLM&#x27;s remove the need for type-safe languages, but as the blog mentioned, Google is porting their C++&#x2F;C code to rust. Does this mean the port is waste of time and that they should just rely on the LLM&#x27;s to catch memory errors?
          1. boshalfoshal · · focus · HN ↗
            I mean Rust definitely has a better tradeoff than Carbon in this case, re readability&#x2F;verifiability by a person (and sufficiently good internet training data).

            I personally think that you _could_ use an LLM to catch these types of boundary case errors without having to port the _entire_ C++ codebase to Rust, but maybe pre-emptively porting to Rust now can catch some of these cases for cheaper than doing a full LLM sweep. Also more cynically, its a good benchmark lol.

            I guess if you really believe in curve of LLM capabilities you should just use a language that has the best performance, safety, flexibility, and extensibility, since in the limit few&#x2F;no people will actually read the code anyway. I think this ends up being Rust.

            1. chis · · focus · HN ↗
              I&#x27;m not an expert on this. But isn&#x27;t it the case that C++ code could have errors that span the entire codebase, like a setup in file A triggered by a bug in file B which is immensely far away on the import graph? A classic would be a use-after-free. To me that&#x27;s the thing that Rust can help with, even if silly bugs aren&#x27;t being written by AI.

              The other thing is just that rewriting some old human-written codebase in Rust probably immediately catches many bugs. It would be hard to prompt the AI to properly scan for such bugs itself, they&#x27;re lazy when working in that modality.

              1. Paracompact · · focus · HN ↗
                I am an expert (in formal methods). LLMs absolutely need more safeguards rather than less. Not because they &#x2F;need&#x2F; them in order to produce functioning code, or even because they produce as many braindead bugs as humans, but because in an era of explosive code quantity, what has become valuable is (assured) code quality.

                Going back to C++ would be particularly bizarre to me given that AI is also very proficient at verified languages. Not merely typesafe, but languages comprising their own spec languages such as Rocq and Lean.

                I predict that in the next decade: (1) the market will understand the difference between a &quot;code writer&quot; and a &quot;spec writer,&quot; with (2) the expectation that the latter is overwhelmingly more necessary than the former in an AI-dominated field, and (3) there will emerge more useful and less mathematically specialized formal verification alternatives to Rocq and Lean, and a filling-out of the tooling gap of between &quot;static typing&quot; and &quot;interactive proof assistant,&quot; perhaps in the vein of ACSL-like contract annotations, and (4) there will be a subsequent shift in the traditional curriculum for programmers. Since educational change is slow (and spec writing depends on good coding fundamentals anyway), perhaps (4) is a stretch, but I&#x27;m more confident in the first three.

                1. computerdork · · focus · HN ↗
                  For me personally, when doing development with LLM&#x27;s, you&#x27;ve won me over towards using safer languages rather than looser ones. Because for one thing, the developer working with an LLM still has to remember to ask it to check for things like memory leaks and security issues. And (as I understand it), LLM&#x27;s are statistically in the way they work and some level of randomness is always apart of their answer, so there is always a chance they will miss something. Interesting
                2. diegojromero · · focus · HN ↗
                  Could you recommend some lectures&#x2F;reads about the use of formal methods in LLMs, I&#x27;m interested in the area.
          2. tclancy · · focus · HN ↗
            &gt; I don&#x27;t disagree with you that LLM&#x27;s remove the need for type-safe languages

            That feels like a really strong conclusion. I’m not clear on why any safeguard isn’t a useful safeguard if you let agents write all the code.

            1. computerdork · · focus · HN ↗
              actually, not my conclusion, just paraphrasing what Boshalfoshal was saying. In fact, am also questioning whether this is true, but personally haven&#x27;t done development enough with LLM&#x27;s to make my own determination:)
        3. mike_hearn · · focus · HN ↗
          &gt; There is 0 practicality in inventing an entirely new coding language that only one company uses, and you have to teach it to thousands of new engineers

          They did that for Go and it seems to have worked out for them though.

          1. pjmlp · · focus · HN ↗
            Three famous guys on Google&#x27;s pay check did it on their 20% to avoid C++, and they were lucky Docker and Kubernetes projects pivoted from Python and Java respectively into Go.

            Google themselves aren&#x27;t big Go users.

        4. lesuorac · · focus · HN ↗
          Didn’t FaceBook fork php into another language?

          I’m not entirely sure Google should have both Go and Carbon but when you have billions in server costs it makes sense to do extreme stuff for even basis points of performance. I’m still surprised at how much java there is.

          1. fg137 · · focus · HN ↗
            I don&#x27;t know what the exact deal is, but I assume Hack meets specific use cases at Facebook and can be put in production. It doesn&#x27;t matter if anyone else is using it.

            By comparison, virtually nobody is using Carbon at Google for production code.

            The counterexample, ironically, is Flow. It&#x27;s practically irrelevant these days -- many (if not most) of Facebook&#x27;s open source projects use typescript.

        5. torginus · · focus · HN ↗
          Rust is not the end of history. One of the difficulties with the language lies exactly with porting existing code written in an OOP style to idiomatic Rust, as those codebases weren&#x27;t written with ownership in mind.

          Such rewrites will contain judicious uses of Cell, RefCell, unwrap() etc. which make for ugly code that&#x27;s not exactly simple to understand and might even have some landmines (crashes).

          Getting rid of these requires a subtantial amount of engineering effort, which I&#x27;m not sure how well these LLM manage.

          Given the nigh-universal experience of LLMs producing an ungodly mess when left to their own devices, I have my concerns.

      4. fg137 · · focus · HN ↗
        I wouldn&#x27;t call it absurd, but very questionable at least. Most companies are not going to even consider throwing money at this adventure.
      5. bvinc · · focus · HN ↗
        I’m not op. But I think it’s not Carbon itself that is absurd.

        It’s absurd to think that Carbon is the solution to memory safety when rust exists and Carbon’s memory safety story is basically “TBD”.

    5. minimaxir · · focus · HN ↗
      A RewriteInRustBench would be unironically useful at this point since all the main agents can write it reasonably well despite its relative scarcity in the input data.
      1. culi · · focus · HN ↗
        I wouldn&#x27;t be surprised if we&#x27;re already at the point of more LLM-written Rust than hand-written. Models training off models
      2. LarsDu88 · · focus · HN ↗
        Rust is the best language for LLMs b&#x2F;c it gives by far the best debug messages. Just tons of verifiable reward signal for post-training. Even the most rudimentary LLMs can school me on idiomatic Rust
        1. bitexploder · · focus · HN ↗
          Evidence needed. I think for certain kinds of outcomes it has very strong advantages, but these advantages are not a given as &#x27;best for LLMs&#x27; :)
        2. rafram · · focus · HN ↗
          On the other hand, Rust&#x27;s borrow checker is very picky, and even a frontier LLM still sometimes struggles to respond to roadblocks sensibly (refactoring so whatever it&#x27;s trying to do can be done safely) rather than stupidly (introducing some horrible global arena thing so it can make the borrow checker go away). A lot depends on how good your instructions are, and how good the existing code is, since bad input begets bad output.
          1. nchie · · focus · HN ↗
            I&#x27;ve (more or less; I&#x27;ve read quite a bit of the code) vibecoded several houndred thousand lines of Rust and I&#x27;ve not seen this happen a single time. It sounds like something it&#x27;d do when you ask it to &quot;write a linked list while satisfying the borrow checker&quot;. Are you sure you haven&#x27;t (possibly) unknowingly been giving it instructions which ended up luring it into doing these things?
            1. zahlman · · focus · HN ↗
              Couldn&#x27;t it just look at what std::collections does?
          2. Karrot_Kream · · focus · HN ↗
            A good eval benchmark suite could really improve this then.
          3. hbbio · · focus · HN ↗
            Yep! In our tests, we found Zig to be a pretty good fit to translate C++ codebases.

            And static analysis + agents are good enough at keeping the memory management in check. Compared to Rust, there&#x27;s no magic so it&#x27;s easy for devs and agents to reason about.

            If you&#x27;re curious: <a href="https:&#x2F;&#x2F;github.com&#x2F;okcontract&#x2F;oksolc" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;okcontract&#x2F;oksolc

          4. fireant · · focus · HN ↗
            TBH a &quot;global arena thing&quot; can be very good for performance rather than a bunch of random allocations&#x2F;deallocations
        3. lossolo · · focus · HN ↗
          Not always. In my experience, if you&#x27;re not working on a small, trivial codebase, LLMs will sometimes just create spaghetti unreadable, inefficient code to satisfy the constraints of the type system&#x2F;borrow checker.
        4. throwitaway222 · · focus · HN ↗
          I&#x27;ve narrowed in on only using Go or Rust generated code (Go for APIs right now) and rust for some TUI or other thing. TS for web interfaces (w&#x2F;React).
        5. iillexial · · focus · HN ↗
          in my experience LLMs write pretty bad Rust code. sure it works, strong typing system, etc., but it&#x27;s unmaintainable and not readable.
          1. konart · · focus · HN ↗
            I doubt these two features will be a defining quality of a product soon enough.

            Many pieces of software are going to be just blackboxes worked by AI. You will be maintaining output quality and stability and that&#x27;s it.

          2. david-gpu · · focus · HN ↗
            I have the same problem with the assembly produced by compilers.

            Maybe we should let them do their thing and instead focus our attention on the higher-level stuff like specifications and testing.

      3. adamrezich · · focus · HN ↗
        All the main agents can write Jai code reasonably well despite being even more scarce in input data!
      4. 6thbit · · focus · HN ↗
        Have each agent rewrite openssl in $lang and call it the RollYourOwnCrypto bench.
      5. DrBenCarson · · focus · HN ↗
        From DARPA’s “Translating all C to Rust” TRACTOR program:

        <a href="https:&#x2F;&#x2F;www.ll.mit.edu&#x2F;r-d&#x2F;projects&#x2F;translating-all-c-rust-tractor-benchmarks" rel="nofollow">https:&#x2F;&#x2F;www.ll.mit.edu&#x2F;r-d&#x2F;projects&#x2F;translating-all-c-rust-t...

        1. ksec · · focus · HN ↗
          I wonder why not to Ada or SPARK.
    6. pshc · · focus · HN ↗
      Rewrite everything in Rust has been a meme for so long that to see it coming to pass is surreal.
      1. Gigachad · · focus · HN ↗
        After the current onslaught of 0 days on linux and other C projects combined with the new incredible ability to convert codebases to another language I think we will start to see this actually happen.

        I&#x27;m not saying we blindly vibe convert Linux to Rust, but I think it could be a valid idea to start converting small parts and carefully auditing them.

        1. hectdev · · focus · HN ↗
          I&#x27;ve been a Swift&#x2F;Obj-C engineer for my whole 15 year career. I now have all these odd jobs I have going on Raspberry Pis around my house that LLMs have written in Python. I&#x27;m now having them convert some of them to Rust and I am astonished on how fewer resources are used.
          1. Gigachad · · focus · HN ↗
            I converted some Ruby stuff at a previous job to Rust pre-ai days and it was incredibly how much less memory they took and how fast it ran. But we still built everything else in Ruby because finding Rust devs was hard.
          2. keepitwiel · · focus · HN ↗
            I let an LLM write a custom kernel for doing inference on an RPi cluster. The age of bespoke custom kernels is upon us.
        2. hollowturtle · · focus · HN ↗
          &gt; carefully auditing them

          and start everything all over again? current c&#x2F;c++ tools have been audited for years

          1. fg137 · · focus · HN ↗
            Yet certain categories of bugs are basically unavoidable in C&#x2F;C++ but almost eliminated in Rust. Human audited doesn&#x27;t mean bug free.
    7. 6thbit · · focus · HN ↗
      I wonder if there&#x27;s people already whose full time job is maintaining&#x2F;extending one of these auto-migrated codebases.

      Imagine they aren&#x27;t even familiar with rust but are deeply familiar with the product.

    8. mlmonkey · · focus · HN ↗
      &gt; The end result is a memory-safe video decoder that runs 2.7x faster than the Rust port, with identical video output, bringing it closer to the optimized C++.

      So ... Rust still can&#x27;t beat the C++ implementation :-D

      Sorry, didn&#x27;t mean to ignite a langwar, but it&#x27;s still interesting to see.

      1. pasteleft · · focus · HN ↗
        &quot;Safe Rust&quot; being closer to &quot;optimized C++&quot;. And those &quot;optimized C++&quot; usually incldues assembly code, so it&#x27;s a huge improvement.

        Of course, Rust is not a magic, so just porting to Rust wouldn&#x27;t make this performance improvement. It seems their AI overfitted code to Rust compiler to find safe Rust code that compiles to efficient assembly.

      2. himata4113 · · focus · HN ↗
        Additional safety checks do mean less performance, it&#x27;s the same thing as hardened allocators.
      3. manbash · · focus · HN ↗
        If it&#x27;s &quot;rust still can&#x27;t beat... performance-wise&quot;, then yeah I guess.

        But there are other criteria. The move to rust might&#x27;ve also resolved numerous potential memory-safety bugs in the decoder.

        1. stephbook · · focus · HN ↗
          Memory safety is pretty important in the &quot;AIs hack everything&quot; age.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.