The Register Home Page

back to article Microsoft agentically ports Copilot runtime to Rust for $120K

The software engine underpinning GitHub Copilot and a growing number of Microsoft products is now written entirely in Rust, with AI agents doing most of the porting work. The migration cost about $120,000 in AI token usage plus about three weeks of a developer's time. However, managers also had to grapple with a few dozen …

  1. Groo The Wanderer - A Canuck Silver badge

    Interesting. I presume they'll be canning the resulting knowledge base of prompts and suggestions as a "solution/agent" for doing exactly such migration "essential lifting" process.

  2. Jason Bloomberg Silver badge

    "would have taken years and cost millions if done by hand"

    Or an inspired hacker might have done the job in a week using only their knowledge and their bedroom laptop.

    I doubt we'll ever know, but function by function conversion to a new language is often easier than some would think, especially for someone familiar with both source and target language.

    In fact, many people have done it; writing proof of concept code in Python or some other agile language, then converting to C, C++, and these days Rust or Zig, for production or improvement.

    There are always going to be issues along the way, sometimes big ones, but I am sceptical of claims something would have been impractical without AI. Especially when such claims come from those who have vested interests in promoting AI.

    1. ComputerSays_noAbsolutelyNo Silver badge

      Re: "would have taken years and cost millions if done by hand"

      Also, the AI did the same as humans first would have done. Read the docs and try to understand it first, then write code.

      While one suspects that one is expected to be impressed by the short time this took, I am doubtful that this warrants the sinking of trillions of dollars in capital and the perpetration of the largest scale theft in history.

      1. Anonymous Coward
        Anonymous Coward

        Re: "would have taken years and cost millions if done by hand"

        Don't forget the burning of resources during the run; that is what the $120k represents.

      2. Ian Johnston Silver badge

        Re: "would have taken years and cost millions if done by hand"

        Or for it really just tweak the code? Years ago I converted a couple of thousand lines of FORTRAN to C that way and I am sure automatic converters exist.

    2. UnknownUnknown

      Re: "would have taken years and cost millions if done by hand"

      No mention of the quality of the end code, if it wrote any developer documentation and the testing results??

      If if compiles?? … ship it ?

      Hopefully not 800k lines of incomprehensible gibberish.

    3. steviebuk Silver badge

      Re: "would have taken years and cost millions if done by hand"

      Didn't all the bedroom coders of the 80s also do it when they made ports for popular games on other systems?

      1. deanb01

        Re: "would have taken years and cost millions if done by hand"

        For many conversions, especially from arcade machines, we didn't have the luxury of the original source code or graphics. The games were written based upon observations of playing the original. Sometimes the ROMs could be dumped for graphics.

        1. steviebuk Silver badge

          Re: "would have taken years and cost millions if done by hand"

          And coding in assembly.

          Was beyond me as a kid. In middle school, I'd have the urge to go home and type in some code on the ZX81 from books. But, what I still can't understand to this day, they oddly used a really shitty font in the mags and books to donate "This is code". But the font was so shitty, I knew they're be typos. Instead of working out what the problem was, I just gave up.

          Wasn't until PCs came round and I was in college in the mid 90s, that I finally got into a bit of programming.

  3. Uh, Mike Bronze badge

    What Is Your Testing Methodology

    What is/was their test plan?

    Do they even have a spec for the system?

    Or did they just run old pasta through a new pasta machine?

    1. werdsmith Silver badge

      Re: What Is Your Testing Methodology

      There’s a link to the actual process in the article.

  4. rgjnk
    Devil

    Quality

    Well I guess no one has even thought to review any of it? All just rubber stamped?

    That's a big pile of complex code to trust to any porting process, let alone an automated one. There could be all sorts of weird crap added (or kept) and they'd have no idea.

    Just because it compiles doesn't mean it's right, and neither does passing the tests or the other tooling.

    You can see why so many things are not so slowly falling apart in a mass of weird and obvious bugs affecting things that had no need to be touched.

  5. glennsills@gmail.com Bronze badge

    They got ripped off!

    Anyone who has every used Copilot will tell you it isn't worth 2 cents, so Microsoft wildly overpaid for this port.

    1. AVR Silver badge

      Re: They got ripped off!

      That just means they need to get > ($120 000/$0.02 = ) 6 million people using it to break even. Easy.

  6. Peter Mc Aulay

    Aw, they're just like us

    "[T]hey spent far more time gathering information than actually writing code."

    Surprising to non-developers, perhaps.

  7. sarusa Silver badge
    Devil

    Well, I guess CoPilot is so defective (worst in class, except for Grok) that nobody will ever notice the inevitable regressions they didn't catch. Hell, bugs might actually improve it.

  8. andy the pessimist Bronze badge

    stupid question

    Is the change from typescript to rust the only reason for the performance improvement?

    Would better math processing help?

    The performance improvement sounds good.

    1. sindrelspec

      Re: stupid question

      I'm no developer, but these numbers seem to indicate TypeScript has pretty poor performance in general, converting to any other "decent" language would have probably done just as much for performance:

      https://programming-language-benchmarks.vercel.app/typescript-vs-cpp

      https://programming-language-benchmarks.vercel.app/typescript-vs-go

      https://programming-language-benchmarks.vercel.app/typescript-vs-csharp

  9. UnknownUnknown

    More Dev jobs to be chopped

    More Dev jobs to be chopped at Microsoft then? ?

    1. Paul Herber Silver badge

      Re: More Dev jobs to be chopped

      This will be mainly people in India then! What would the reaction be if they got rid of all the Karens at Redmond?

      Nameist!

  10. MattieD

    A lot of cash

    Spending $120k and three-weeks of developer time to get a 15x performance increase sounds like incredible value. Except it really isn't, it just massive highlights how terrible the performance of Type/JavaScript is.

    While a re-factoring of the JS was never going bring similar performance gains, I think they're swapping one set of problems for another. Going from 400k lines of slow JS to 800k lines of machine-created Rust is one of those things that will become a millstone around the neck of anyone trying to maintain it. Unless, of course, they're just going to keep slinging the code into Copilot to make changes and it'll never be touched by human hands again.

    1. FIA Silver badge

      Re: A lot of cash

      [...] it just massive highlights how terrible the performance of Type/JavaScript is.

      To play devils advocate... I'd say it highlights how using the correct tool for the job is an important skill to learn.

      The advantages of JS et. al. is not speed, and it should not have been used for this use case.

    2. You aint sin me, roit Silver badge

      Re: A lot of cash

      I can understand a prototype being written in typescript, but it looks as if the prototype was shown to management who decided to go with it - with no consideration for the performance overhead. If it had been written in a proper language to start with it wouldn't need this conversion to Rust, and the follow up investigation into whether the design is structured correctly.

      At least the AI had documentation to read, is the Rust similarly documented/commented?

      [I know, I know... comments in code just isn't the done thing anymore.]

  11. FIA Silver badge

    However, managers also had to grapple with a few dozen regressions in the resulting code, pointing to AI’s ongoing challenges in understanding Rust.

    I've been teaching myself Rust at home, and also doing a bit of playing with local AIs.

    I'm writing a winamp style music player, I like writing the code but I did wonder if I could use AI to write the documentation for the theming engine. I'm using Slint for my UI.

    So I pointed a local copy of Quen3.8 at it and waited... (and waited... as my GPU isn't really up to the task...)

    It gave up after 3 hours (not enough GPU memory)... but it'd made a good stab at writing some documentation.

    What really shocked me though was how good it was. It had made an amazing job of working out what I was doing and writing it up well. It had even got stuff 'wrong' because that's how the code currently worked.

  12. FIA Silver badge

    “That’s in no way an argument against Rust’s compiler,” Toub wrote. “But ‘if it compiles, it’s correct’ is useful only as a joke.”

    This sentence worries me. Surely that's obvious???

    Any compiled language that compiles is correct. (as far as the compiler is concerned)... it may not do what you want though.

    But do people really think if it compiles it's right?!

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon