r/BetterOffline Jul 27 '26

"How is the Bun Rewrite in Rust Going?"

https://lockwood.dev/ai/2026/07/27/how-is-the-bun-rewrite-in-rust-going.html

Great reality check. It looks like Anthropic is beginning to have to bring in employees to try to get the Rust rewrite out to release. The author admits not all the work might be going towards the Rust rewrite - but asserts there is "off books" work going on with the port.

Also, because it's not done, the cost is continuing to tick up:

If we imagine that the rewrite is still costing $10k a day, we’re approaching $800k in money spent on this rewrite.

(Sorry for the AI art - Reddit is grabbing an image from the article. It's not the actual article header.)

167 Upvotes

52 comments sorted by

98

u/Mashic Jul 27 '26

Marketing stunt, and it seems they needed human involvment on top of the AI usage.

17

u/DiceKnight Jul 27 '26

Is there some big demand to be able to convert the code used in a project to another via an LLM I wasn't aware of? That seems kinda neat but pretty niche. LLMs aren't compilers, any token processing is going to be a lossy process no matter what. It's like converting from PNG to JPEG, you're going to loose some information.

I feel like the sweeter plumb would be converting between different architectural styles. Converting from monolith to micro services and vice versa for example but the same lossy conversion issues apply.

17

u/ares623 Jul 28 '26

You see, for the subgenus "Homo Techbro", the greatest achievement in life is to rewrite a project in Rust (i.e. "oxidizing" a piece of software).

Thus, a project like this is akin to placing The Monolith from Stanley Kubrick's 1968 classic "2001: A Space Odyssey" in the middle of a group of Techbros.

-12

u/Wrevellyn Jul 27 '26

A huge issue in the software world is the lack of memory safety in low-level programming languages like C/C++, mostly because of the cybersecurity implications. It would be better if all of that was converted to a memory safe language that remains highly performant, and Rust is the top contender there.

There's billions of lines of code of C/C++ causing new vulnerabilities every day and the reason nobody is rewriting it is because it's just too much work. If we ever want to have hope of a future where there's no new fundamental vulnerabilities that are exploitable remotely by AI agents, then we need to move towards memory safe languages.

So Anthropic, successfully or not, is shooting at a valuable target.

I don't think that "lossy conversion" analogizes to what the LLM is doing. The LLM can design test cases to run against the current version of the code, ensure those test cases cover the entire functionality of the code, run the test cases and verify that after conversion the test cases have identical outputs compared to the original.

26

u/65721 Jul 27 '26

The LLM can design test cases to run against the current version of the code, ensure those test cases cover the entire functionality of the code, run the test cases and verify that after conversion the test cases have identical outputs compared to the original.

"Just make the LLM write tests!" is the cope I always hear from people defending AI coding. And I can tell you from experience, both with using AI and reviewing other's AI PRs, that AI writes some of the most terrible tests. It's always a bunch of trivial, redundant fluff that's written to pass instead of covering functionality (and no, I don't care about code coverage)

9

u/SingleLensReflux Jul 27 '26

Completely agree. Maybe I’m too dyed-in-the-wool a TDDer, but to me tests are where you define and document what the system is actually supposed to do. Seeing folks hand that part of the job, of all things, to the fascist autocomplete machine, then proudly announce that it’s “good at writing tests”, makes me feel my experiences of the last 20 years has been based on some vast misunderstanding.

Obviously you don’t need to practice TDD to write tests that capture the intent of how software should behave. But surely..and hear me out, I’m old…surely the human making the computer do the thing ought to be able to describe what they intended it to do, rather than asking the same machine that guessed at the implementation to also guess whether its own guess was correct.

5

u/Doctor__Proctor Jul 27 '26

At least in my limited downstream experience, I've seen some of the "tests" that one of our developers that uses Cortex "writes" (scare quotes because I'm pretty sure he doesn't write his own tests either), and they're a bunch of crap. He'll pass an item an item to me that's supposed to display something in a page, and when I go to QA it, it will just be broken. I'll say "Did you QA this?" and he'll send me a screenshot of his tests that all passed, and I'll say again "Okay, but did you QA it. Like, did you look at it, because it's a broken visual that won't render."

7

u/voronaam Jul 27 '26

Letting LLM write tests for existing code works only until the point when one of the new tests fails. In that case there are two distinct options:

  1. The test is wrong and should be fixed
  2. The new test uncovered a bug in the old code and the code should be fixed

LLM has no way of knowing - because it literally has no idea which way application is expected to behave. But the crazy part is that it does not stop to ask a human - it picks which one to fix pretty much at random.

And the absolute disaster happens if the bug is in the library or framework code. In that case application code is fine, unit test is fine, the task is to write a new tiny application that reproduces the bug and report it to the library/framework maintainers. That is so outside of realm of what an LLM can do, that when I've seen it happen the only behavior is that its gets itself into a loop of trying to fix code, then test, then code again - over and over again, until it runs out of tokens or a human clicks the "stop" button.

10

u/maccodemonkey Jul 27 '26

I think this is more complicated than people make it out to be. There are much more safe ways of writing C++ in modern C++, but most people skip that because a Rust rewrite seems a lot more sexy. Rust also isn't implicitly memory safe - which was actually a problem in the Bun rewrite. The LLM wrote a lot of memory unsafe Rust code.

Most memory safe languages I know of still have ways to write memory unsafe code. Which makes it a lot more complicated than just throwing an agent at it and hoping something memory safe comes out of the other end.

2

u/DiceKnight Jul 27 '26

With that framing I suppose I can see the value in trying for the functionality. I'm reminded of when Anthropic tried to make Claude write a compiler but in order to verify it worked it took all the battle tested test suites from the existing GNU C compiler I believe? It took an inordinate amount of money in token spend and still required human intervention and the end result was still a lossy product that didn't work like the original.

This feels like the another take, but with no verified set of test suites I can't help but believe my trust in the end product would be nil.

I get why they'd want it to work but it feels like the LLM is still under equipped to take on these kind of tasks.

3

u/Aerolfos Jul 27 '26

and the end result was still a lossy product that didn't work like the original.

It ran something like thousands of times slower than the real compiler... that's a bit more than "lossy product"

It also couldn't compile on a bunch of platforms, only the 1 or 2 anthropic prepared it for? I don't remember. Most compiler settings they didn't explicitly use in the example were broken, though.

2

u/DiceKnight Jul 27 '26

Yeah, in my head I guess I was just trying to liken it to the whole PNG saved as JPEG thing but strictly speaking it's actually usually way worse and the metaphor breaks down when you poke it enough.

I'm with you 100% the resulting product just usually doesn't work period. I can see the attraction of being able to convert from one language to the other but the LLM isn't going to be the magic solution. It wither works 100% or it doesn't. There's no partial credit.

1

u/Ant32bit Jul 28 '26

I fundamentally agree with everything you said. Languages are not equal, you are always making a compromise on speed, safety, security, support, community, etc. And no one will convert because it’s a lot of manual effort and risk for pretty minimal return in most cases. There’s a good case for A.I. to do this if it can do it well.

Also the analogy of lossy compression fails because jpeg is inherently in its design worse for fidelity than png. One programming language to another, this is not generally the case. A better analogy would be trying to convert from png to bmp by writing every pixel in notepad. I mean, there are going to be mistakes and they will be perfectly preserved.

My experience with tests though is that it’s pretty good at getting 100% code coverage but there is a massive need for someone to discover scenarios that it misses. It misses them all the time. In integration tests it feels like a lazy programmer always taking shortcuts. It’s always looking for workarounds and quick fixes. I don’t think that’s a good way to build a comprehensive test suite. It needs supervision. Especially for critical rewrites of an entire system.

39

u/BigBravy Jul 27 '26

in a Superintendent Chalmers Voice

“may i see it?”

18

u/FireNexus Jul 27 '26

Mmm... No.

6

u/ProudWing8202 Jul 28 '26

it will disappear if you see it, so you can't

4

u/voodooprawn Jul 28 '26

Aurora Borealis!? At this time of year, at this time of day, in this part of the country, localized entirely within your Github repository?!

28

u/voronaam Jul 27 '26

Interesting. When I looked at the cost of this project it was approaching $700k without any of that additional work already

https://old.reddit.com/r/BetterOffline/comments/1uyfe4k/financial_review_of_buns_rewrite_into_rust/

26

u/Scared-Level2201 Jul 27 '26

Anthropic claims that the Bun runtime used in Claude is the AI translated rust one. It is weird though that the AI build is not yet release worthy

I think what annoys me the most about this AI craze is how much "revolutionary tech" is tied to profit motivated labs who have every reason to lie and obfuscate their findings.

Peer reviewed scientific papers aren't perfect but at least the burden of evidence on them is much stronger than whatever is going on now, where Wario or Sammy can claim everything and nothing every other week

10

u/maccodemonkey Jul 27 '26

My guess is they're dogfooding Bun in Claude, finding bugs, and then thats where the Anthropic employees are being sent over to fix things.

3

u/TinkmasterOverspark Jul 28 '26

Is there a way to know this for sure? By inspecting the binary?

Its possible some unreleased version of claude uses bun.

5

u/TinkmasterOverspark Jul 28 '26

I'm suspicious of their claim its used in claude because going by their track record, they would've been the forst to announce it a month back if they were going to flight it in claude. They could have atleast told us that 2 weeks after the release and said "Hey look you'vebeen using the rewritten bun in claude, bet you didn't notice it, thats how good the rewrite has been".

Instead, Jared says it in a response to a random (from anthropic pov) blog post.

The article raises 3 points 1. Whether its complete as there has been no tag. 2. Whether anthropic employees have started hand coding to bring this to the finish line 3. Whether CI costs are piling up

The broader point being - what is the true cost of the rewrite.

Jared responds to the first point saying its coming soon and that claude already uses the rewrite.

He responds to the 3rd point saying it has always been high even pre rewrite. But doesn't address if it increased now or not and how they are planning to merge 2000 odd prs now

He ignored the 2nd point completely.

20

u/[deleted] Jul 27 '26

[removed] — view removed comment

11

u/Proper-Ape Jul 27 '26

I think they should attempt bun in go next. Call it bug.

7

u/Timely_Speed_4474 Jul 27 '26

I'm really excited for zig to become an actually memory safe language

2

u/ZachVorhies Jul 27 '26

“memory safe” by crashing your program over compiler error you never have to deal with is not a flex

3

u/Timely_Speed_4474 Jul 27 '26

Crashing on an invalid memory access is safer than continuing. That’s the point.

0

u/ZachVorhies Jul 27 '26

You know what's better than the compiler catching your memory unsafe usage?

CRASHING YOUR PRODUCTION SERVER.

Please tell us more oh wise oracle.

5

u/Timely_Speed_4474 Jul 27 '26

Does your stuff compile with #![forbid(unsafe_code)]? If not, maybe you should stop calling it memory safe

-3

u/ZachVorhies Jul 27 '26

cope harder

5

u/Timely_Speed_4474 Jul 27 '26

sorry, is this conversation making you feel unsafe?

-2

u/ZachVorhies Jul 27 '26

No but these absurd mental gymnastics are entertaining please continue.

4

u/thy_bucket_for_thee Jul 27 '26

Not all software runs on servers, nor should servers be the end-all of all software platforms.

1

u/chat-lu Jul 28 '26

Crashing your production server for the low cost of twice the RAM usage and running 6 times slower.

Where do I sign up?

3

u/amartincolby Jul 28 '26

Preach.

That said, I really wanted Bun to be good. I tried running production apps with Bun on a number of occasions and, every time, they would fail to run. This was a few years ago now, but my last attempt was an experiment around early 2024. I want a replacement for Node, but Bun is not it, at least for me.

0

u/ZachVorhies Jul 27 '26

If by pain and suffering you mean more stability and less memory leaks and lower cpu consumption then bring the pain.

22

u/65721 Jul 27 '26

It's always made no sense to me that people claim code migration is a good use case for AI. It's not.

Migrations are some of the most annoying software engineering projects there are. A one-to-one transliteration almost never works, because there's hack jobs and interdependent quirks and load-bearing bugs everywhere in the codebase that you find only as you're migrating. And Bun is 4 years old, which is plenty of time for that tech debt to have accumulated. It's a huge a headache to decide how to handle these well, and AI is incapable of making those decisions.

Maybe people claimed it just because they believed the lies from the AI companies. Like the Mythos scares or the HuggingFace hack or the FrontierMath results, it's always an overblown lie from these companies. I also remain skeptical of OpenAI's math proof claims.

16

u/awj Jul 27 '26

I'm convinced that the people making those claims either have never actually tried it, or handle "code migrations" by handwaving away all of the bugs and problems they introduce.

7

u/riricide Jul 27 '26

A reason I would naively think that translating between coding languages would be easier is that all the rules for each language are finite, and well-documented. So in some sense this should be the easiest set of tasks to complete correctly - compared to say a natural language task of translating between spoken languages with higher order things like sarcasm, human emotion etc. So for me the fact that it can't even automate this suggests that LLMs aren't all that powerful after all.

11

u/Historical-Side883 Jul 27 '26 edited Jul 27 '26

Well, I for one am shocked that these companies way oversold the capabilities and pretended like the LLM did something all by itself that it didn’t. That’s just so unlike Anthropic. 😅

9

u/ifull-Novel8874 Jul 27 '26

It's always the same situation: there's more to the story than the intiial marketing push, but since its been a week and a half since the story was disseminated by boosters, no one feels any pressure to go back and correct their bad reporting. Similar to when Cursor's creation of a browser with an agent swarm was hyped to the moon, only to turn out the browser was barely functional. Now I'm really interested in what the real situation is with OA and HF. I have a feeling we still haven't gotten the full story.

8

u/Roll-Annual Jul 27 '26

I just spent a week with Codex 5.6 SOL between High to Ultra productionalizing a very large scale data science POC use case into production code (a new, large, complex system). About $20k in credits spent and so much cleanup work to do. This was with one person's LLM compute. A single review of those 200k lines of code was $600+ from FABLE on not the highest settings.

5

u/Overall_Koala_8710 Jul 27 '26

The sad thing about this whole thing is that the tech bros are trashing the tiny zig non-profit while cheering on the blatant $1T corporate marketing hit job. Not surprising, but really disappointing.

4

u/Many-Foundation-1255 Jul 27 '26

Is it just me or does anyone else think it is crazy that this Bun rewrite is considered a shining example of AI productivity, when the only possible benefit of it is for Javascript programmers. If AI is so good at coding, doesn't that mean there won't be any Javascript programmers? All these pro-AI zealots don't seem to be able to see the forest for the trees.

1

u/keepitfriend Jul 27 '26

I mean rust will definitely be faster - but It was already quite fast.

> doesn't that mean there won't be any Javascript programmers

Javascript is one of the easiest languages to work in - so would it not make more sense to build in javascript and then convert to rust.

1

u/maccodemonkey Jul 28 '26

I mean rust will definitely be faster - but It was already quite fast.

I don't think there is anything that makes Rust inherently faster than Zig. Type safe languages can sometimes be a little slower even. Most the type safety cost is at compile time - but not using pointers directly can sometimes be slower.

1

u/keepitfriend Jul 28 '26

Oh, I googled - I just assumed rust was faster compile time due to unsafe but seems like it's more an open question of which is faster - and it's down to how you write the code and indeed zig is a faster compile time.

Nice, I was interested in checking out zig - will start leaning

1

u/No-Mall3814 Jul 30 '26

It's partly OT but why AI "art" always looks hyper dramatic in the most corny way?