*The Rustification of Bun#
Rewriting 500,000 lines of Zig into another language would be a gargantuan undertaking if done by hand. “A rewrite in another language would take a small team of engineers a full year. It would mean freezing bugfixes, security fixes or feature development for that time,” Sumner wrote.
Instead, Sumner went with Claude. He spun up about 50 dynamic Claude Code workflows, reaching a peak of about 1,300 lines of code per minute and generating over a million lines of Rust code. The job took 11 days and cost about $165,000 at API pricing. Claude Fable did most of the heavy lifting.
https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html
This original post is also very informative.
I, for one, am glad they are volunteering as guinea pigs in an experiment to see how long a popular project can survive LLM slop.
And if they harm javascript’s popularity in the process and projects start to look elsewhere… that’s an added benefit ;-)
Bun is not nearly popular enough to have a measurable impact on the JavaScript community, no matter what happens with it.
The market can remain irrational longer then you can remain liquid as they say
I miss “We can remain stupid longer than you can remain solvent.” and “Ape together strong.”
Since we introduced claude enterprise, number of unexpected bugs skyrocketed tremendously
Because devs are adding more features faster than before? Or because the quality of each feature is low?
- The bugs were always there. And some are just not happy with their incompetence getting surfaced/exposed.
- 🟢 All of the above.
They also moved to Codeberg: https://codeberg.org/ziglang ❤️
There’s no way a million lines of code were reviewed in 11 days. Not by a human at least.
No need, you just ask the AI to “make no mistakes”, then you spawn a second AI to review the first AI’s output, and then you ask
a turdthird AI to review the output of the second AI. Easy peazy. No need for pesky engineers and their stupid human inefficiency. /sNon-ironically though, I think that’s exactly what they did. I have watched Prime’s video about this, and, although I was second-screening his video, I believe he mentioned that they used this “technique”.
They didn’t use that technique. Some vibers do ask Codex to review Claude and vice versa. But since this is Anthropic-owned, they did use “parallel agents”, but they were all Claude.
It took the llm 11 days to generate the code
It doesn’t seem to say anywhere anyone reviewed it in any time
11 days and $165,000
They code review in prod, like REAL PROGRAMMERS HOO RAH
Exactly
Ew. Reviewing code is so 2024
What a waste of resources for an unreviewed and unmaintainable pile of junk.
How much is one million lines of code?
If a senior engineer works in a well-defined, well-architected greenfield project, and does extensive tests, 10,000 lines of code written in one year are very productive. The amount of new code per person-year will be much less in larger projects - a good indicator is the line count and the estimated value of the Linux kernel (40 million lines in 2025, redeveloping it in 2011 would have already cost 2200 million Euros, which would pay e.g. 36000 person-years for mid-level German software developers, that would mean 1111 lines per person-year{actually about half of that because of the interim growth of line count in the meantime }- and most software projects can only dream about so much actual value.)
So, you can say 1,000,000 lines of code generated in 11 days are probably 100 person-years of technical debt.
One caveat: It is relatively simple to auto-translate code in restricted languages like Java, Python, or Rust to unrestricted languages like C or C++. In that case, enforced invariants (like “no use of freed memory” or “sharing data across threads xor mutation”) become implicit, but verbatim translation is often possible.
The other direction will require a re-design…
you can’t compare the tech debt because it’s essentially a line by line translation from an existing codebase, not 1M brand new lines of code
That’s…irrelevant.
Really. The specific details of the task doesn’t change that this was automated. Until it’s reviewed, it’s basically a pile of Schrödinger’s bugs and security holes. That’s the technical debt.
It really isn’t. A line by line translation doesn’t introduce new logic and doesn’t change the system architecture. Saying it carries the same tech debt as brand new code is just not true.
Assuming the llm did it line by line without changing anything during an arbitrary hallucination.
and that’s a different problem entirely
that would mean 1111 lines per person-year
not sure if I understand correctly, but this sounds off
More like 500 lines per person-year.
You can do the math yourself:
-
how many lines of code does the linux kernel have?
-
what is the estimated value of the kernel, which is the hypothetical cost to re-create it?
-
what do you think the seniority of a linux kernel developer is?
-
what annual salary do they make in the country which uses Linux most - the US?
-
now divide kernel value by annual salary to get man-years, and lines of code by man-years to get average lines of code per year
Result: Typing in code that somehow compiles was never the bottleneck
-
Kelley is artisan, Sumner is a factory manager. Indeed they cannot be using same tools or work on the same floor or within the same building. Blind trust in AI (even with guardrails) is a recipe for disaster. They have jumped to Rust to add more guardrails to their AI lunacy but it won’t hold for long. At this point there’s no single human who actually knows or understands the code and AI code is proven to have durability issues at scale. So direct rewrite gives a quick boost as code is ported from somewhat reviewed base onto new platform, but as new code gets added this will dissipate. It sounds like Bun issue is systemic Zig Rust or Pixie dust won’t fix it.
My modest career in software development has shown me that the real value of a developer isn’t how much code they can write, it’s how well they understand the existing code base. LLMs can’t understand because that requires memory larger than an LLM’s context window, by orders of magnitude.
I’ll never update Bun again. And maybe I’ll just revert back to Npm.
What a shit show.
Please save yourself from lunacy by using pnpm. You can always use shamefullyHoist to get the npm compatibility
What makes him think it’s unreviewed? Any AI process worth its salt has several review steps.
review
You should stop using words that clearly mean human cognitive activity, like “to review”, to describe what LLMs do.
You really think one person reviewed over a million lines of code in 11 days?
I think they mean “reviewed by AI”
You really think one person reviewed over a million lines of code in 11 days?
I think they mean “reviewed by AI”
The cops have investigated themselves and concluded that they did nothing wrong.
Yes.
AI code reviews can assert good patterns that’s baked into the training data, but it’s impossible for an LLM to understand the whole project. LLM code reviews can’t match a senior dev’s code reviews (unless VRAM becomes astronomically cheaper).
Regardless of the truth of the matter, the Zig creator is being an unprofessional bell-end, and should let Bun fail on its own.
No, AI psychosis has done so much damage to open source and software engineering as whole already, the professional thing to do is to start to call it out for what it is. And sometimes that means intentionally making people mad, like that project that instructed the AI to put self-disparaging remarks into the author’s PR to both mock the author and make it obvious they used AI. He may not be the hero we deserve, but he’s the hero we need right now.
Maybe you do get more flies with honey than with vinegar, but vinegar is useful too. Fuck AI (at least in many of the forms it is currently being used and pushed in)
If it’s doing “so much damage” - let them crash and burn. That’s all the vinegar you need.
It’s different when it’s people coming and fucking up your project and breaking your rules - then they deserve to be dealt with robustly. But if all they’re doing is fucking up their own product then being a wretched little gossip doesn’t help anyone.
By that logic, we would not need regulation for financial institutions because “the free market will sort it out”.
Except that capitalism or the free market does not care about people. Only people, we ourselves, care about people. We need rules shielding off harm like the guests of a hotel need a fire safety system.
You should enter for long jump with those leaps
But they are fucking up other people’s projects. Badly enough that some are ending paid bug hunting programs or just eating so much of maintainers time looking through bogus bug reports that development stalls.
Some of the ways in which bun came fucking up zig’s ecosystem can be found in Andrew’s own blog post.
Nope, he’s based as fuck. And I don’t even like Zig that much.
He’s allowed to express his opinion.
And I didn’t say he wasn’t, so good day to you.
The only good use of “professionalism” as a concept is to get bigots and sex-pests fired.
I’m gonna guess you routinely behave in a way that is off-putting to colleagues then.
Nah the malicious compliance mostly just pisses off my boss, and no ones ever complained about me hitting the pen on the clock.
You don’t have to be “professional” to not be insufferable.
hitting the pen on the clock.
So weird of you to admit your shitty behaviour in this conversation, but fair play to you.
My work here is done.
Your Reddit is showing lol
You here to leap to the defence to the pissrag vaping in the office?
Dunno what that shows but let’s hear it.
I go out to my car to hit the pen, thank you very much.
Who the fuck rips a weed pen in the middle of a working office building?
Like there’s not giving a shit about my company, then there’s not giving a shit about the people around me, or if nothing else, not giving a shit about making rent next month.
Do you just spend your time making up ridiculous scenarios to get pissed about? Or is it only when you get to make it an appeal to authority?
PiSsRaG?!?! You don’t even KNOW this person and you’re willing to make such an EXTREME INSULT??? Why, I never!!! The state of modern discourse is simply AtRoCiOuS!!!
I write powershell based .MSI wrappers for a company that’s actively building the apacolypse.
Working slower is arguably taking the moral high-ground.
Thank you for your service
o7
Sumner said the port was necessary given the growing number of bugs Bun users were finding, including one implicated in the recent Claude Code source leak.
But the creator of Zig, Andrew Kelley, didn’t want his project to be seen as the culprit behind Bun’s woes, which he blames on Sumner’s bad programming practices.
Ah, the old “blame the programmer” defense of low-level languages. By the same argument, why would anyone use Zig and not C? Do all Zig developers have bad programming practices?
Apparently Bun was always an especially bad example of how to use Zig.
From https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html
The Zig team regularly checks in on our users’ projects. We read source code to find out how the language is affecting users, we test changes to see how problematic breakage might be, and we check for performance regressions.
We became increasingly horrified at the programming practices we saw in Bun’s codebase. Hacks on top of hacks. Abuse of assertions. Most of all, recklessly speeding past feature after feature with very little time taken for reflection and elimination of bugs and technical debt. Jarred was already writing slop well before he had access to LLMs. Now, it’s not our business to police what our users do, but you may have noticed people screaming in our faces about memory safety constantly. You can imagine how we might want to put some social distance between ourselves and a project whose irresponsible software engineering practices invite the exact kind of criticism that people are eager to level.
We made futile attempts to guide them towards better programming practices. There were a few exceptional heroes who did their very best in a dysfunctional company. You know who you are. But you can’t stop a rising tide.
By this time, we all felt at ZSF that Bun was a net liability, and this was before RoboBun became the #1 contributor.
Oh my, that’s a proper bitchfight
Double sucks because it’s also being used as a proxy flamewar between Zig and Rust enthusiasts.
Which is awful because there are good conversations and teachings to be had between those languages; but instead all of the circumstance is just blood in the water and completely unproductive.
Zig is too irrelevant, both technically and adoption wise, for anyone actually relevant to be fighting over it. The number of notable Zig projects went from 3.5 to 2.5 recently 😉. Hell, Zig probably has more adoption as a build tool, than as an actual implementation language (I would take it over CMake any day of the month tbf).
Hell, WIP languages experimenting with effect systems and/or similar next-gen concepts will probably hit v1.0 before Andrew thinks Zig is ready for a v1.0, which is in his forte, but no one should be holding their breath if they are not aware of some history and personality details. Since Andrew tagged Zig v0.1, the Rust project designed the edition mechanism, introduced three inter-compatible editions (four if you include 2015), and managed on-schedule ~66 1.n minor releases, and in the process grew into a semi-popular language impacting almost every corner of the industry.
Let’s hope after this is done we can have more productive conversations. There’s so much potential for all of us to learn, or at least definitely for me.
This sounds like Kelly is giving the “you’re holding it wrong” argument.
Languages like Rust make it hard to run into memory bugs. C and Zig don’t protect you. Here is a good article about Zig vs Rust memory safety. If your language allows you to easily write memory unsafe code, then your language is partially to blame.
It’s like why we have type systems. Sure, you could write bug-free code using untyped python. And you can blame somebody for “coding too fast” if they end up with a lot of bugs. But a well designed language with a well designed type system, could have prevented many of those bugs from being written in the first place
To a degree, sure, but going out of your way to go against convention even for the language itself is also to blame if Kelly is right. It’s less about whether you add type annotations to python, and more about following conventions and writing python in a way that a random developer with enough python experience would be able to understand and contribute to the codebase. I’ve seen anti patterns in a handful of languages I know well enough and it’s easy to tell the other person didn’t bother practicing enough and learning basic conventions.
Coding conventions are fine but generally the language should enforce them by design. This is the difference between Rust and Zig. In Zig, you can ignore memory safety. In Rust you can’t (or rather, it’s hard to). Type systems are the same, you generally can’t just ignore the rules. The compiler will complain.
My friend just got dumped. And from what she’s telling me, he is the worst person ever.
kek
Kelley does indeed blame Sumner’s poor engineering and lays out a series of events where he describes a transformation into VC-backed startup and the changes in engagement with Zig, and also the effect this has on Bun’s source. I’m inclined to believe Kelley’s accounting. Let’s not forget that it was Sumner/Anthropic that decided to throw Zig under the bus first.
He blames it on Sumner because Sumner is not a good programmer and an even worse manager. https://andrewkelley.me/post/my-thoughts-bun-rust-rewrite.html













