YouTube2Text

The most controversial rewrite in history just shipped... — Transcript

by Fireship · 1,131 words · 174 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Last week, Bun, the all-in-one
  2. 0:02JavaScript toolkit that was acquired by
  3. 0:04Anthropic late last year, announced that
  4. 0:06they spent the equivalent of $165,000
  5. 0:09running 64 parallel clot agents to
  6. 0:12refactor their entire codebase from Zigg
  7. 0:14to Rust in just 11 days. Usually, a full
  8. 0:17rewrite to Rust is the swan song of any
  9. 0:20startup about to get Rick James by the
  10. 0:21invisible hand of the market, but in
  11. 0:23this case, it may have actually worked.
  12. 0:25The millionline port fixed 128 old bugs,
  13. 0:28shrunk the binary by 20%, made
  14. 0:30everything a few% faster, and has
  15. 0:32already been powering Claude code since
  16. 0:34June without anyone noticing. But not
  17. 0:36everyone is celebrating. Andrew Kelly,
  18. 0:38the creator of Zigg, responded claiming
  19. 0:41the benchmarks are misleading, and the
  20. 0:42Zig team is actually relieved to see Bun
  21. 0:45go because internally they used its
  22. 0:46codebase as an example of how not to
  23. 0:48write Zigg and that Jared, Bun's
  24. 0:50founder, was producing SLOP long before
  25. 0:53LLM existed. In today's video, we'll
  26. 0:55find out how the biggest AI powered
  27. 0:57rewrite in history actually went down
  28. 0:59and decide who should get custody of
  29. 1:00public opinion in the divorce. It is
  30. 1:02July 15th, 2026, and you're watching the
  31. 1:05code report. That 26 years ago, when I
  32. 1:07was throwing Japan airs in the
  33. 1:08warehouse, Joel Spolski wrote one of the
  34. 1:10most famous blog posts in software
  35. 1:12history where he claimed that rewriting
  36. 1:14your codebase is the single worst
  37. 1:15strategic mistake a software company can
  38. 1:17make. His example was Netscape, who
  39. 1:19spent three years rewriting their
  40. 1:21browser while Microsoft stole their
  41. 1:22women and pillaged their village. So,
  42. 1:24what led Bun to fall to the temptation
  43. 1:26of the single word strategic mistake
  44. 1:28they could make? Well, it's actually the
  45. 1:30same thing that led you to fail CS 101,
  46. 1:32switch majors, and become a JavaScript
  47. 1:34developer, but poor memory management.
  48. 1:36With Zigg, the language Bun was
  49. 1:38originally written in, you manually
  50. 1:40manage memory yourself without much help
  51. 1:42from the compiler. That's usually a
  52. 1:43feature of a low-level language because
  53. 1:45Bun embeds JavaScript core, which is
  54. 1:47Safari's garbage collected JavaScript
  55. 1:49engine. Half of Bun's objects were owned
  56. 1:51by the garbage collector, while the
  57. 1:53other half lived in manually managed Zig
  58. 1:55memory, and the two had to constantly
  59. 1:57manage pointers to each other, which led
  60. 1:59to a codebase that looked like it had an
  61. 2:01explosive diarrhea parasite. But Bun's
  62. 2:03change logs are full of bugs stemming
  63. 2:04from this, where code was reading memory
  64. 2:06that had already been freed, or freeing
  65. 2:08the same memory twice, or just never
  66. 2:10freeing it at all. At one point, the dev
  67. 2:12server was leaking three megabytes every
  68. 2:14time it rebuilt, all because a single
  69. 2:16error path forgot to clean up after
  70. 2:17itself. And though memory bugs alone
  71. 2:19might not have justified a rewrite,
  72. 2:21there was still a bigger problem. Once
  73. 2:22Anthropic acquired Bun, the majority of
  74. 2:24its future code was going to be written
  75. 2:26by Claude. And Zigg is famously anti-
  76. 2:29AI. So much so that they refuse LLM
  77. 2:32generated pull requests and they'll even
  78. 2:33close your security report if you admit
  79. 2:35AI found the bug. On top of that,
  80. 2:37because there's very little Zig code on
  81. 2:39the internet to train on, and the
  82. 2:40language itself hasn't hit 1.0 yet, so
  83. 2:43it keeps introducing breaking changes,
  84. 2:45models just aren't very good at writing
  85. 2:46it compared to more established
  86. 2:48languages. And so in early May, Jared
  87. 2:50decided to fix both problems at once by
  88. 2:53porting all 535,000 lines of Zigg to
  89. 2:56Rust, whose borrow checker would move
  90. 2:58memory management into the type system,
  91. 3:00which made most memory mismanagement a
  92. 3:02compile time error rather than a runtime
  93. 3:04error. But the most interesting part is
  94. 3:06how they did it. They first had Claude
  95. 3:08spend hours studying the codebase to
  96. 3:10produce a porting guide. Then ran a
  97. 3:12workflow that traced the lifetime of
  98. 3:13every struck field into a giant
  99. 3:15spreadsheet, essentially documenting
  100. 3:17years of tribal knowledge about who
  101. 3:19frees what and when. From there, they
  102. 3:20used 64 parallel CLA agents across four
  103. 3:23git workrelate
  104. 3:25all, 1448 files, at one point cranking
  105. 3:28out 1300 lines of Rust per minute. And
  106. 3:31to keep the agents honest, every
  107. 3:32implementer was paired with two
  108. 3:34adversarial reviewer clouds running in
  109. 3:36separate context windows whose only job
  110. 3:38was to assume the code was wrong and
  111. 3:40find out why. 11 days, 6,52 commits and
  112. 3:44what would have been $165,000
  113. 3:47in spend if they didn't own the token
  114. 3:48casino later. Bun's entire test suite
  115. 3:50was passing on every platform. The port
  116. 3:53fixed 128 long-standing bugs. The dev
  117. 3:56servers memory leak issues resolved, but
  118. 3:58binaries got 20% smaller. and Andrew
  119. 4:00Kelly, the creator of Zigg, lost his
  120. 4:02mind. In his response, Andrew makes it
  121. 4:04clear that this divorce was years in the
  122. 4:06making. According to him, the Zigg team
  123. 4:08spent years watching Bun embarrassed
  124. 4:10their language with a codebase they
  125. 4:11privately used as the example of how not
  126. 4:14to write Zigg. He also takes some
  127. 4:16personal swings, pointing out that Jared
  128. 4:17skipped college at 18 to take Peter
  129. 4:19Teal's money and Chase startup glory,
  130. 4:22which Andrew blames for his beginner
  131. 4:23energy and passing along secondhand
  132. 4:25reports that Jared wasn't exactly a
  133. 4:27great manager to work under. But buried
  134. 4:29under the resentment are some legitimate
  135. 4:31technical gripes. He argues the
  136. 4:32performance gains mostly came from link
  137. 4:34time optimization which Zig has
  138. 4:36supported the whole time that the binary
  139. 4:38size reduction had nothing to do with
  140. 4:40Rust and that Jared conveniently left
  141. 4:42out any reference to compile times which
  142. 4:44Zigg almost certainly wins. So the
  143. 4:46question is who gets custody of public
  144. 4:48opinion? Well, probably nobody. Zigg
  145. 4:50lost its most famous user. Andrew lost
  146. 4:52his cool and Jared got publicly
  147. 4:54diagnosed with beginner energy by a
  148. 4:56compiler engineer. But if you're looking
  149. 4:58to rewrite your own codebase in Rust or
  150. 5:00just write better code in general, then
  151. 5:02you need to know about Code Rabbit, the
  152. 5:03sponsor of today's video. Writing
  153. 5:05thousands of lines of code with AI feels
  154. 5:07great until you have to review all that
  155. 5:09unholy slop by hand. Code Rabbit Review
  156. 5:11turns your pull requests into guided
  157. 5:13walkthroughs you'll actually finish. It
  158. 5:15groups related changes into cohorts,
  159. 5:17orders them into layers, and adds AI
  160. 5:19summaries so you can move through all
  161. 5:21the changes quickly in the right order.
  162. 5:23Instead of one giant flat diff, it feels
  163. 5:25like an IDE for your pull requests. Your
  164. 5:27comments and approvals still go back to
  165. 5:29GitHub natively. And when it helps, the
  166. 5:31Code Rabbit can generate inline diagrams
  167. 5:33for your call flows, state changes and
  168. 5:35schema updates. Over 100,000 open-
  169. 5:38source projects like Bun and Nex.js use
  170. 5:40Code Rabbit, and you can try it out for
  171. 5:42free at the link below. But this has
  172. 5:43been the Code Report. Thanks for
  173. 5:45watching, and I will see you in the next
  174. 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.