The most controversial rewrite in history just shipped... — Transcript
Full transcript
- 0:00Last week, Bun, the all-in-one
- 0:02JavaScript toolkit that was acquired by
- 0:04Anthropic late last year, announced that
- 0:06they spent the equivalent of $165,000
- 0:09running 64 parallel clot agents to
- 0:12refactor their entire codebase from Zigg
- 0:14to Rust in just 11 days. Usually, a full
- 0:17rewrite to Rust is the swan song of any
- 0:20startup about to get Rick James by the
- 0:21invisible hand of the market, but in
- 0:23this case, it may have actually worked.
- 0:25The millionline port fixed 128 old bugs,
- 0:28shrunk the binary by 20%, made
- 0:30everything a few% faster, and has
- 0:32already been powering Claude code since
- 0:34June without anyone noticing. But not
- 0:36everyone is celebrating. Andrew Kelly,
- 0:38the creator of Zigg, responded claiming
- 0:41the benchmarks are misleading, and the
- 0:42Zig team is actually relieved to see Bun
- 0:45go because internally they used its
- 0:46codebase as an example of how not to
- 0:48write Zigg and that Jared, Bun's
- 0:50founder, was producing SLOP long before
- 0:53LLM existed. In today's video, we'll
- 0:55find out how the biggest AI powered
- 0:57rewrite in history actually went down
- 0:59and decide who should get custody of
- 1:00public opinion in the divorce. It is
- 1:02July 15th, 2026, and you're watching the
- 1:05code report. That 26 years ago, when I
- 1:07was throwing Japan airs in the
- 1:08warehouse, Joel Spolski wrote one of the
- 1:10most famous blog posts in software
- 1:12history where he claimed that rewriting
- 1:14your codebase is the single worst
- 1:15strategic mistake a software company can
- 1:17make. His example was Netscape, who
- 1:19spent three years rewriting their
- 1:21browser while Microsoft stole their
- 1:22women and pillaged their village. So,
- 1:24what led Bun to fall to the temptation
- 1:26of the single word strategic mistake
- 1:28they could make? Well, it's actually the
- 1:30same thing that led you to fail CS 101,
- 1:32switch majors, and become a JavaScript
- 1:34developer, but poor memory management.
- 1:36With Zigg, the language Bun was
- 1:38originally written in, you manually
- 1:40manage memory yourself without much help
- 1:42from the compiler. That's usually a
- 1:43feature of a low-level language because
- 1:45Bun embeds JavaScript core, which is
- 1:47Safari's garbage collected JavaScript
- 1:49engine. Half of Bun's objects were owned
- 1:51by the garbage collector, while the
- 1:53other half lived in manually managed Zig
- 1:55memory, and the two had to constantly
- 1:57manage pointers to each other, which led
- 1:59to a codebase that looked like it had an
- 2:01explosive diarrhea parasite. But Bun's
- 2:03change logs are full of bugs stemming
- 2:04from this, where code was reading memory
- 2:06that had already been freed, or freeing
- 2:08the same memory twice, or just never
- 2:10freeing it at all. At one point, the dev
- 2:12server was leaking three megabytes every
- 2:14time it rebuilt, all because a single
- 2:16error path forgot to clean up after
- 2:17itself. And though memory bugs alone
- 2:19might not have justified a rewrite,
- 2:21there was still a bigger problem. Once
- 2:22Anthropic acquired Bun, the majority of
- 2:24its future code was going to be written
- 2:26by Claude. And Zigg is famously anti-
- 2:29AI. So much so that they refuse LLM
- 2:32generated pull requests and they'll even
- 2:33close your security report if you admit
- 2:35AI found the bug. On top of that,
- 2:37because there's very little Zig code on
- 2:39the internet to train on, and the
- 2:40language itself hasn't hit 1.0 yet, so
- 2:43it keeps introducing breaking changes,
- 2:45models just aren't very good at writing
- 2:46it compared to more established
- 2:48languages. And so in early May, Jared
- 2:50decided to fix both problems at once by
- 2:53porting all 535,000 lines of Zigg to
- 2:56Rust, whose borrow checker would move
- 2:58memory management into the type system,
- 3:00which made most memory mismanagement a
- 3:02compile time error rather than a runtime
- 3:04error. But the most interesting part is
- 3:06how they did it. They first had Claude
- 3:08spend hours studying the codebase to
- 3:10produce a porting guide. Then ran a
- 3:12workflow that traced the lifetime of
- 3:13every struck field into a giant
- 3:15spreadsheet, essentially documenting
- 3:17years of tribal knowledge about who
- 3:19frees what and when. From there, they
- 3:20used 64 parallel CLA agents across four
- 3:23git workrelate
- 3:25all, 1448 files, at one point cranking
- 3:28out 1300 lines of Rust per minute. And
- 3:31to keep the agents honest, every
- 3:32implementer was paired with two
- 3:34adversarial reviewer clouds running in
- 3:36separate context windows whose only job
- 3:38was to assume the code was wrong and
- 3:40find out why. 11 days, 6,52 commits and
- 3:44what would have been $165,000
- 3:47in spend if they didn't own the token
- 3:48casino later. Bun's entire test suite
- 3:50was passing on every platform. The port
- 3:53fixed 128 long-standing bugs. The dev
- 3:56servers memory leak issues resolved, but
- 3:58binaries got 20% smaller. and Andrew
- 4:00Kelly, the creator of Zigg, lost his
- 4:02mind. In his response, Andrew makes it
- 4:04clear that this divorce was years in the
- 4:06making. According to him, the Zigg team
- 4:08spent years watching Bun embarrassed
- 4:10their language with a codebase they
- 4:11privately used as the example of how not
- 4:14to write Zigg. He also takes some
- 4:16personal swings, pointing out that Jared
- 4:17skipped college at 18 to take Peter
- 4:19Teal's money and Chase startup glory,
- 4:22which Andrew blames for his beginner
- 4:23energy and passing along secondhand
- 4:25reports that Jared wasn't exactly a
- 4:27great manager to work under. But buried
- 4:29under the resentment are some legitimate
- 4:31technical gripes. He argues the
- 4:32performance gains mostly came from link
- 4:34time optimization which Zig has
- 4:36supported the whole time that the binary
- 4:38size reduction had nothing to do with
- 4:40Rust and that Jared conveniently left
- 4:42out any reference to compile times which
- 4:44Zigg almost certainly wins. So the
- 4:46question is who gets custody of public
- 4:48opinion? Well, probably nobody. Zigg
- 4:50lost its most famous user. Andrew lost
- 4:52his cool and Jared got publicly
- 4:54diagnosed with beginner energy by a
- 4:56compiler engineer. But if you're looking
- 4:58to rewrite your own codebase in Rust or
- 5:00just write better code in general, then
- 5:02you need to know about Code Rabbit, the
- 5:03sponsor of today's video. Writing
- 5:05thousands of lines of code with AI feels
- 5:07great until you have to review all that
- 5:09unholy slop by hand. Code Rabbit Review
- 5:11turns your pull requests into guided
- 5:13walkthroughs you'll actually finish. It
- 5:15groups related changes into cohorts,
- 5:17orders them into layers, and adds AI
- 5:19summaries so you can move through all
- 5:21the changes quickly in the right order.
- 5:23Instead of one giant flat diff, it feels
- 5:25like an IDE for your pull requests. Your
- 5:27comments and approvals still go back to
- 5:29GitHub natively. And when it helps, the
- 5:31Code Rabbit can generate inline diagrams
- 5:33for your call flows, state changes and
- 5:35schema updates. Over 100,000 open-
- 5:38source projects like Bun and Nex.js use
- 5:40Code Rabbit, and you can try it out for
- 5:42free at the link below. But this has
- 5:43been the Code Report. Thanks for
- 5:45watching, and I will see you in the next
- 5:46one.
About this transcript
This page contains the full transcript of The most controversial rewrite in history just shipped... by Fireship, generated from the public captions YouTube serves with the video. The transcript has 1,131 words across 174 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.