# How to Ship Millions of Lines of Agent-Written Code — Jarred Sumner, Anthropic

Jarred Sumner, Anthropic

[Talk page](https://ai.engineer/talks/TvsF67C2F54-ship-millions-lines-agent-written-code) · [Video](https://www.youtube.com/watch?v=TvsF67C2F54)

## How to Ship Millions of Lines of Agent-Written Code

Bun moved JavaScript compilation out of Claude Code sessions and into the build. Existing tests gave Jarred Sumner a way to check five compiler rewrites against the same expectations. An overbroad API-detection rule and a 50-second build each gave him a reason to hold back a version.

### The cost of compiling in every session

[0:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=14s)

Each new Claude Code session paid to compile JavaScript as it ran. Jarred Sumner, Bun’s creator, started with a brief to cut memory use and improve speed. The team could change Bun, the runtime behind Claude Code, or WebKit, whose JavaScriptCore engine Bun uses. By the time of the talk, Sumner had merged a several-million-line pull request adding an ahead-of-time compiler to Bun. [0:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=23s)

The compiler went through five rewrites in a little over a month. One version came close to shipping before the time it took to compile an application forced another pass. The freedom to start over depended on having a way to tell whether the next compiler still ran the same programs correctly.

A just-in-time compiler, or JIT, compiles code on demand as the application runs. An ahead-of-time compiler, or AOT compiler, does that work at build time. Sumner estimated that compiling on demand accounts for roughly half the CPU time of a typical JavaScript application. For Claude Code sessions launched through the iOS app, the cost mattered because every new session had to pay it again.

![The just-in-time timeline alternates compilation and execution, while the ahead-of-time timeline shows a single compile step before execution.](https://ai.engineer/api/talk-essay-media/84ce026a99cf3e5140f375121682778dd289a6ea9964017bddc81b94966051d2)

The JIT timeline alternates bursts of compilation with stretches of execution. The AOT timeline moves compilation into one step before the program starts.

### Why Claude Code stayed in JavaScript

[3:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=236s)

The Bun team had already rewritten Bun in Rust, so a Rust port of Claude Code was a serious option. Bun’s TypeScript tests were independent of the language used to implement the runtime. The same suite could run against the Zig and Rust versions and hold both to the same expectations. [4:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=240s)

The team expected a Claude Code port to require rewriting its TypeScript tests. A passing test could then conceal a regression if the port also changed what the test exercised or expected. Keeping Claude Code in JavaScript let the team change how the application ran while preserving the suite that defined its expected behavior.

The AOT build of Claude Code used about a quarter as much memory and started about twice as fast, Sumner reported. He gave those headline figures without specifying the workload or measurement setup. The team was using the build internally and expected a wider release soon. [5:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=314s)

The TypeScript compiler offered a second comparison. Its JavaScript and TypeScript implementation, built with `bun compile`, ran faster than the Go port in the single-threaded comparison Sumner presented. Thread support for Bun’s AOT build was still in progress.

Bun treats TypeScript types as predictions. An annotation can suggest which case to optimize, but a runtime value can differ from the annotation. The compiler needs stronger evidence before it can specialize an operation.

![A TypeScript test imports wrapText directly and checks that a sample wraps onto two lines. The slide explains that these tests cannot run on a Rust version and warns that rewriting the suite is risky.](https://ai.engineer/api/talk-essay-media/ed13f0734b9d5520e7dd55d138a67f39d8f12c3bf2b17c544bb0ff08f80cc536)

Claude Code’s tests import TypeScript functions like wrapText directly. A Rust port would mean rewriting the test suite, which Sumner worried would make it harder to tell whether the port preserved behavior.

### Keep the existing tests and compare three executions

[6:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=415s)

Bun’s existing tests, WebKit’s tests, Test262, and Claude Code’s suite all gave the compiler behavior to match. The team also made Bun’s own test runner work in AOT mode. New tests could exercise compiler-specific cases, while the suites that predated the project supplied expectations independent of the new implementation.

Some tests failed because of two deliberate compatibility changes. Their main purpose was to prevent prototype pollution, and Sumner said they helped performance as well. The failures made those changes in behavior visible in the same suites used to look for regressions.

How can the team tell whether compiling ahead of time or using type information changed what an application does? It runs the same application three ways and compares the behavior.

- **JIT.** Use the existing execution path as the reference.
- **AOT.** Run the compiled program with its type information available to the compiler.
- **Types removed.** Strip the type information and run the program again to see whether the behavior changes. [8:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=502s)

Agreement gives confidence in the behavior those runs exercise. To widen coverage, Claude could write generators for different code patterns. Each generated program becomes another input to the three-way comparison. When the runs disagree, the team has a specific program to investigate.

![The table reports 62,858 matches with the JIT. In matching, refused, and different order, the counts are 49,473, 1,685, and 0 for test262, 8,624, 508, and 8 for WebKit, 2,894, 81, and 0 for Node.js, and 1,867, 15, and 3 for Bun.](https://ai.engineer/api/talk-essay-media/abf717a6b17b3d6a6bf6e0934d367b150aa5f43b1540bfedc44db8bc422f8f3d)

Bun checked its ahead-of-time compiler on Linux using existing tests that pass in the JIT. The compiler matched the JIT on 62,858 tests and differed on 11. Most of the 2,289 refusals came from tests that modify built-in objects.

How do three runs become one comparison?
The program branches into three independent executions. The observed behavior from each run converges at the comparison.
- One application — Start all three runs from the same program.
- JIT execution — Observe behavior on the existing execution path.
- AOT execution — Run the compiled program with type information available to the compiler.
- Execution with types removed — Observe program behavior after stripping the type information.
- Compare behavior — Agreement covers the cases exercised by the runs.
- One application → JIT execution (Run with the JIT)
- One application → AOT execution (Compile ahead of time and run)
- One application → Execution with types removed (Strip the types and run)
- JIT execution → Compare behavior (Observed behavior)
- AOT execution → Compare behavior (Observed behavior)
- Execution with types removed → Compare behavior (Observed behavior)

### Write in batches, then make the build work

[8:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=538s)

Tests accounted for most of the project’s code volume. During a big implementation pass, agents wrote changes in parallel and the team ran one build against the combined work. Repeated builds during that pass would have meant waiting on the compiler and chasing errors while other pieces were still being written. Once the batch was in place, individual agents could work through build errors and test failures.

The first compiler reused as much of JavaScriptCore’s code as possible. That gave it a starting point and tied its performance ceiling to what the team could get from the existing code. The early Claude Code result fell short of what Sumner wanted.

The team added a TypeScript type checker to Bun as `bun check` and asked Claude to use it. After that, Sumner reported that Claude Code started about twice as fast and used about a third as much memory. He still called the code “slop.”

What made the `archive` rule too broad? An ordinary read such as `record.archive` would flag possible use of Bun’s archive API even if `record` had nothing to do with Bun. The rule took the property name as its signal and ignored which object the code was reading from. That false positive was enough for Sumner to rule out shipping the version. [11:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=687s)

Agent-written planning could swamp reviewers too. Sumner’s example was 1,500 Markdown files. For the third compiler version, the coding batch had a concrete endpoint. He had 140 agents write code at the same time, then turned to getting Claude Code to run. [12:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=754s)

### A 50-second build forces a fifth rewrite

[12:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=771s)

The fourth compiler had better code and roughly the same runtime performance as before. It took about 50 seconds to compile Claude Code, up from 10 to 20 seconds in earlier versions. Claude Code was a large codebase, but even the single-digit waits Sumner expected for smaller projects would add friction for JavaScript developers accustomed to running their code straight away. [12:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=771s)

Sumner also questioned why the version was 900,000 lines. The team rewrote it again. He judged the fifth version’s code ready to ship, and the build came in under 20 seconds. Moving compilation out of the session had created a separate performance target. Claude Code could start quickly and still leave developers waiting too long for a build.

Much of the work began by asking Claude to try an idea and see what happened. Claude was quick to estimate whether a change was worth pursuing. Sumner wanted to revisit some of those calls. An estimate could talk the team out of trying a promising change, and a misleading measurement could persuade it to keep a slow one.

### Long-lived subagents and hourly scorecards

[15:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=921s)

For the Rust rewrite, Sumner had leaned on Claude Code workflows. For the compiler, he shifted to long-lived subagents after the initial coding batch. An agent could keep the relevant code in its context window across successive fixes and spend less effort rediscovering how its part of the compiler worked.

A property read shows when the compiler can act on type information. If it can prove the access is monomorphic, meaning the relevant type stays consistent at that site, it can emit a direct field access. Otherwise, it has to check each time the operation runs. The compiler also uses some inline caching to reuse lookup information at an access site.

What did the team track while agents worked in parallel? An hourly scorecard reported the metrics the team had chosen to prioritize. The regular Slack post usually put the previous and current values side by side, so a measurement moving in the wrong direction could catch someone’s eye while work was still underway. [16:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=1008s)

Bun already used Fuzzili, a JavaScript engine fuzzer also used by V8. The compiler project extended it to exercise TypeScript types, so generated programs could cover cases where type information might change a compiler decision. The test machinery needed a check of its own. A clean run carries weight once the team knows its tests can catch the kinds of failures they’re meant to find.

### When runtime-generated code gives back the speedup

[18:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=1087s)

Where did AOT lose its edge over the JIT? AOT led on most of the application benchmarks Sumner showed, with UglifyJS as an exception. Code created through `eval` or `new Function` only becomes available at runtime. When enough of the workload takes that path, the interpreter does more of the work and the AOT speedup can disappear. [18:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=1087s)

One deliberate compatibility change concerned `Object.prototype`. The AOT compiler bans assigning properties to it. Many ordinary objects inherit from that shared prototype, so changing it can affect property lookups across the application. The restriction addresses a common route for prototype pollution and changes behavior for applications that deliberately modify the shared prototype.

### What the human does all day

[19:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=1158s)

One of Sumner’s most frequent messages was “continue.” The more consequential prompts asked why an agent had taken an approach, what was making it slow, or whether it could try a faster method. Claude could turn its own assumptions into rules or underestimate what it could take on. A question as simple as “what’s taking so long?” could reopen a choice the agent had already settled. [19:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=1158s)

How often did the AOT build beat both JITs? In the closing JavaScript engine benchmark comparison, Bun’s AOT build beat the JavaScriptCore JIT and Node.js’s V8 JIT on most of the cases Sumner showed. The result applied to the individual benchmark cases, where the rankings could vary by workload. [20:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=1223s)

The compiler also ran on the tool doing the work. The team used Claude Code to build Bun’s compiler, compiled Claude Code with `bun compile`, and used that compiled version during development.

Working in the compiled build gave the team daily use of the result. Sumner still stressed rerunning tests and measurements throughout development. With many changes in flight, a regression can slip by between big milestones if the team stops measuring. On a large project that had yet to ship, he found it easier to rewrite around a better approach than to refactor the current version into shape. He used 0.1% and 10% to describe different scales of ambition. When an agent settled for a string of tiny gains, he pushed it to try for a larger one.

At the time of the talk, readers who already had Bun installed could try the compiler by running `bun upgrade --canary` and then using `bun compile`. [22:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=1322s)

## Key takeaways

- The test suite shaped what the team chose to rewrite. Bun could use the same TypeScript tests for its Zig and Rust implementations. Keeping Claude Code in JavaScript gave the compiler project the same advantage.
- Moving work to build time makes build latency a release criterion. The fourth compiler kept the runtime gains and took about 50 seconds to compile Claude Code. The fifth brought the build under 20 seconds.
- Remeasure while changes are still in flight. Bun’s hourly Slack scorecard put current and previous values side by side so regressions could come to light during development.

## Slides

### What can models do today?

Jarred Sumner’s timeline goes from line autocomplete in 2021 to a fall 2026 project he describes as bigger than Bun’s Rust rewrite. The goal is to compile JavaScript ahead of time and avoid the cost of JIT compilation at runtime.

[0:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=48s) [A timeline of coding tasks from 2021 to fall 2026 progresses from autocompleting a line of code to building an ahead-of-time JavaScript compiler.](https://assets.ai.engineer/sites/aiecode2025/sha256/e9efe7b9542cd24bfe46825ae8a4953c38cc215df13356ba1179d1382a84fa92.webp)

What can models do today?

2021 ❯ autocomplete a line of code
2023 ❯ write some tests
2025 ❯ fix this bug and open a PR
2026 summer ❯ rewrite Bun in Rust
2026 fall ❯ build an ahead-of-time JavaScript compiler

ANTHROPIC

Interface text:
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC
Google Deep[illegible]
SUPPORTED BY

### The opening Claude Code prompt

Sumner asked Claude Code to add sound types and ahead-of-time compilation to Bun and WebKit. He gave it free rein to change WebKit, whose JavaScriptCore engine Bun uses, in pursuit of Go-like speed and memory use.

[1:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=90s) [A Claude Code prompt asks for sound types and ahead-of-time compilation in Bun and WebKit, with Go-like performance and memory usage as the goal.](https://assets.ai.engineer/sites/aiecode2025/sha256/6023df05b54d64aa6685b1ad53fe938e04bc8cecde67b0db5a66da5602fb0af1.webp)

Claude Code

❯ Build sound types and AoT into bun and webkit. … Give Claude Code Go-like performance and memory usage. Modify WebKit freely to do so. Be ambitious!

ANTHROPIC

Interface text:
~/code/WebKit
Sep 27, 12:26 am
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
SUPPORTED BY
Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC

### 28,547 agents

The grid groups 28,547 agents by compiler version. Most dots are blue or orange. Jarred Sumner nearly shipped the blue version, then rewrote the compiler because it took too long to compile code. He reports five rewrites in all.

[1:46](https://www.youtube.com/watch?v=TvsF67C2F54&t=106s) [A grid of 28,547 dots uses one dot per agent and one color per compiler.](https://assets.ai.engineer/sites/aiecode2025/sha256/79378cd46908b98a188adf24f90b4c50db27d7aeeb406f177e1cfb9e9abbb224.webp)

28,547 agents

Each dot is an agent. Each color is a compiler.

ANTHROPIC

### Design for testability from the start

Jarred Sumner argues that how you verify the compiler works should drive how you build it. Start with tests the model can’t game, so a pass gives you a reason to trust the code.

[2:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=136s) [The slide urges designing for testability from the start and using tests the model can’t game.](https://assets.ai.engineer/sites/aiecode2025/sha256/d1484782884dbf8c880c1872f51fe527c3e7138d7344c9ee5b1f2bea79f2ec76.webp)

Design for testability
from the start

In a way the model can’t game

ANTHROPIC

Interface text:
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC
SUPPORTED BY [illegible]

### What’s an ahead-of-time compiler?

The JIT timeline alternates bursts of compilation with stretches of execution. The AOT timeline moves compilation into one step before the program starts.

[3:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=204s) [The just-in-time timeline alternates compilation and execution, while the ahead-of-time timeline shows a single compile step before execution.](https://assets.ai.engineer/sites/aiecode2025/sha256/84ce026a99cf3e5140f375121682778dd289a6ea9964017bddc81b94966051d2.webp)

What’s an ahead-of-time compiler?

Just-in-time (JIT): compiles while your code runs

Ahead-of-time (AOT): compiles before your code runs
Compile → Run

compiling
running your code

ANTHROPIC

### Claude Code in the cloud

The progress bars show each Claude Code cloud session compiling the same code as it runs. With just-in-time compilation on Linux x64, Claude Code takes 430 ms and uses 158 MB to start.

[3:36](https://www.youtube.com/watch?v=TvsF67C2F54&t=216s) [A grid of 32 Claude Code sessions with orange progress bars illustrates that every session compiles the same code. The slide lists 430 ms and 158 MB to start Claude Code with JIT on Linux x64.](https://assets.ai.engineer/sites/aiecode2025/sha256/f642893be1304d07a81d40758e2351ed17e7e138c081c40845190ad11978c1fd.webp)

Claude Code in the cloud

Every session compiles the same code

430 ms and 158 MB to start Claude Code. Linux x64, in a JIT.

ANTHROPIC

### We rewrote Bun in Rust. Why not Claude Code?

Bun went from Zig to Rust in 11 days. Tests written in a language independent of Bun’s implementation made the port easier. The team considered porting Claude Code from TypeScript to Rust and decided against it.

[3:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=233s) [Bun’s Zig-to-Rust rewrite is labeled 11 days. A second row shows a possible TypeScript-to-Rust rewrite of Claude Code with a question mark.](https://assets.ai.engineer/sites/aiecode2025/sha256/2f0d324675b9ae155386968e629abc1e572b5f86aa5992082098dfb8fb947184.webp)

We rewrote Bun in Rust.
Why not Claude Code?

Bun
Zig → Rust    11 days

Claude Code
TypeScript → Rust    ?

ANTHROPIC

### Bun’s tests run bun

The example tests Bun through its CLI by running bun install and checking for exit code 0. Bun’s TypeScript suite passed on both the Zig and Rust versions, with 0 tests skipped or deleted.

[4:19](https://www.youtube.com/watch?v=TvsF67C2F54&t=259s) [A test launches bun install and checks for exit code zero. The slide shows the same tests passing on Bun in Zig and Bun in Rust, with zero tests skipped or deleted.](https://assets.ai.engineer/sites/aiecode2025/sha256/eab00901d82596232a94779e6e6503d54b38cde43913acbb187ae2a09f4fa94b.webp)

Bun’s tests run bun

test("bun install", async () => {
  const proc = Bun.spawn(["bun", "install"])
  expect(await proc.exited).toBe(0)
})

Bun in Zig
pass

Bun in Rust
pass

Same tests
0 tests skipped or deleted

ANTHROPIC

### Claude Code’s tests import its source code

Claude Code’s tests import TypeScript functions like wrapText directly. A Rust port would mean rewriting the test suite, which Sumner worried would make it harder to tell whether the port preserved behavior.

[4:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=277s) [A TypeScript test imports wrapText directly and checks that a sample wraps onto two lines. The slide explains that these tests cannot run on a Rust version and warns that rewriting the suite is risky.](https://assets.ai.engineer/sites/aiecode2025/sha256/ed13f0734b9d5520e7dd55d138a67f39d8f12c3bf2b17c544bb0ff08f80cc536.webp)

Claude Code’s tests import its source code

import { wrapText } from "../src/wrapText"

test("wraps long lines", () => {
  expect(wrapText("hello world", 5).length).toBe(2)
})

None of these tests can run on a Rust version
Rewriting the test suite is risky

ANTHROPIC

### What if we just made JavaScript faster?

Sumner uses bun compile app.ts to sketch a way to speed up Claude Code while keeping its TypeScript tests. A Rust port would also mean rewriting the test suite, which he considers too risky.

[4:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=298s) [A dark keynote slide asks about making JavaScript faster and displays the example command `bun compile app.ts`. A small stage view appears to the left.](https://assets.ai.engineer/sites/aiecode2025/sha256/e09c2b5e2d365252c832eab9921442af14939f81f7b99405e7dc2dd74ced08cc.webp)

What if we just made JavaScript faster?

$ bun compile app.ts

ANTHROPIC

Interface text:
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC
SUPPORTED BY [illegible]

### Claude Code performance with bun compile

On Linux x64, bun compile cut Claude Code’s startup time from 430 to 194 ms and memory at the prompt from 158 to 36 MB versus JIT. Over 5 turns, it used roughly a third of the CPU time and a quarter of the instructions.

[5:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=316s) [On Linux x64, the chart compares JIT with bun compile. Startup drops from 430 to 194 ms, memory at the prompt from 158 to 36 MB, CPU time from 1.82 to 0.63 s, and instructions from 6.4 to 1.5 billion. CPU time and instructions cover five turns.](https://assets.ai.engineer/sites/aiecode2025/sha256/1c30d6fd2b8be63c20177a06beee77b411962fe6e52986fff9cb38ac98f6450c.webp)

Claude Code starts 2.2x faster
and uses 4.4x less memory

Startup time   430 ms   194 ms   2.2x
Memory   158 MB   36 MB   4.4x
CPU time   1.82 s   0.63 s   2.9x
Instructions   6.4 billion   1.5 billion   4.2x

Claude Code in a JIT
Claude Code with bun compile

Linux x64. Memory is at the prompt. CPU time and instructions are for 5 turns.

ANTHROPIC

### Type-checking Effect with TypeScript

In a Linux development benchmark, TypeScript 6 checks Effect on one thread in 4.2 s with bun compile, down from 13.9 s on Node.js. TypeScript 7’s Go port takes 4.8 s on one thread and 2.4 s with all threads.

[5:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=339s) [Bar chart of Effect type-checking times on the same Linux machine. TypeScript 7 in Go takes 2.4 seconds with all threads and 4.8 seconds with one thread. On one thread, TypeScript 6 takes 4.2 seconds with bun compile, 13.9 seconds with Node.js, and 14.5 seconds with Bun’s JIT.](https://assets.ai.engineer/sites/aiecode2025/sha256/b6887c249080c34692d308dec57c9f2dfc36ab62fbf7d8cae7f0a548b2570552.webp)

Type-checking Effect with TypeScript

TypeScript 7 (Go)
All threads
2.4 s

TypeScript 6 + bun compile
One thread
4.2 s

TypeScript 7 (Go)
One thread
4.8 s

TypeScript 6 + Node.js
One thread
3.3x faster
13.9 s

TypeScript 6 + Bun’s JIT
One thread
3.5x faster
14.5 s

Type-checking the same project on the same Linux machine. Development build.

ANTHROPIC

### What if the types are wrong?

Bun’s ahead-of-time compiler uses types as predictions for optimization. Here JSON.parse passes the string 3 to double, so both Node.js and bun compile concatenate it with itself and return "33".

[6:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=381s) [A TypeScript function adds its argument to itself. The parameter is annotated as a number, but the example passes the string 3. Node.js and bun compile both produce the string “33.”](https://assets.ai.engineer/sites/aiecode2025/sha256/890b65535572b8d393005806a7f45918919cf40d2288f6f3949b36ea21b5ebc7.webp)

What if the types are wrong?

function double(n: number) {
  return n + n
}
double(JSON.parse('"3"'))

Node.js
"33"

bun compile
"33"

Types only affect performance

ANTHROPIC

### Models are really good at writing compilers

Jarred Sumner argues that models do well at writing compilers because their behavior is easy to test. For Bun’s ahead-of-time compiler, one check is whether code behaves as expected when a TypeScript type prediction is wrong.

[6:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=402s) [Keynote slide says models are really good at writing compilers because compilers are easy to test. The speaker appears in an inset beside the slide.](https://assets.ai.engineer/sites/aiecode2025/sha256/e2ccc7b2f4ab18fdca6068d97d61b52c0dc529482e121b8b96a21dfeddd5fc93.webp)

Models are really good at writing compilers
Because compilers are really easy to test

ANTHROPIC

Interface text:
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun ANTHROPIC
[illegible] BY

### Tests that predate this project

Bun could check its ahead-of-time compiler with test suites the team already trusted. Claude Code alone accounted for 560,000 tests, and the team made Bun’s own test runner work in AOT mode.

[7:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=424s) [The slide lists 560,000 Claude Code tests, 53,578 test262 tests, 11,852 WebKit tests, 2,188 Bun test files, and 3,656 Node.js test files.](https://assets.ai.engineer/sites/aiecode2025/sha256/cd469d5858c827c0d01281454e71ace1e867509a24bf951075acb6409e97b0be.webp)

Tests that predate this project

Claude Code 560,000 tests
test262 53,578 tests
WebKit 11,852 tests
Bun 2,188 test files
Node.js 3,656 test files

ANTHROPIC

### 62,858 tests match the JIT

Bun checked its ahead-of-time compiler on Linux using existing tests that pass in the JIT. The compiler matched the JIT on 62,858 tests and differed on 11. Most of the 2,289 refusals came from tests that modify built-in objects.

[7:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=468s) [The table reports 62,858 matches with the JIT. In matching, refused, and different order, the counts are 49,473, 1,685, and 0 for test262, 8,624, 508, and 8 for WebKit, 2,894, 81, and 0 for Node.js, and 1,867, 15, and 3 for Bun.](https://assets.ai.engineer/sites/aiecode2025/sha256/abf717a6b17b3d6a6bf6e0934d367b150aa5f43b1540bfedc44db8bc422f8f3d.webp)

62,858 tests match the JIT

          Same result   Refused   Different
test262   49,473        1,685     0
WebKit    8,624         508       8
Node.js   2,894         81        0
Bun       1,867         15        3

Tests from before this project that pass in the JIT. Most of the refused ones change a built-in object. 678 of Node.js’s can’t run in an executable. A bun that a test starts isn’t compiled. Linux.

ANTHROPIC

### Our own fuzzers find most of the bugs

The team used 352 generators to vary JavaScript code patterns and reports 49 million programs in 5 days. It looked for compiler bugs by checking whether JIT, ahead-of-time compiled, and untyped runs behaved the same.

[8:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=519s) [Two columns report 352 generators and 49 million programs in five days, with examples of tested patterns and a note that Fuzzilli was also used.](https://assets.ai.engineer/sites/aiecode2025/sha256/416a82dd3d7ed81a635428219f7ed4f9de80e607f2d70b3d8393ff12be4fd27d.webp)

Our own fuzzers find most of the bugs

352 generators
arrays-shifted-during-gc
generator-resume-orders
closures-tested-before-escape
many-live-values
all-microtask-kinds

49 million programs in 5 days
callee-reassigned-during-call
fields-never-read-by-name
callbacks-around-awaits
constant-arrays-mutated
atom-tables-and-string-conversion

Plus Fuzzilli, Google’s fuzzer for JavaScript engines

ANTHROPIC

### 46 days of code changes

In 46 days, the team added 14,742,060 lines and removed 10,160,904. Sumner says the project went through five rewrites. The compiler itself accounts for 1.1 million lines, and most of the remaining code is tests.

[8:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=533s) [In 46 days, the project added 14,742,060 lines and removed 10,160,904. The slide reports 1.1 million lines of compiler code and says most of the rest is tests.](https://assets.ai.engineer/sites/aiecode2025/sha256/4cbcc70fc9df09072eea8f01e92d76b389c88a57a9c774b005dd30c19d9aaf8e.webp)

46 days

+14,742,060
−10,160,904
lines of code

1.1 million lines of compiler. Most of the rest is tests.

ANTHROPIC

### Three modes of working

Sumner’s team runs one build after a large batch to avoid repeated waits for compilation. Then individual agents fix errors and get tests passing across many builds. The team checks the same scorecard every hour.

[9:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=551s) [A grid, arrows, and a scorecard illustrate large structured batches with one build, continuous work with many builds, and tracking with the same scorecard every hour.](https://assets.ai.engineer/sites/aiecode2025/sha256/58a7e55a77150117c68b0f212aac46846fab192cbb28071cec99171bf29c5f22.webp)

Three modes of working

Large structured batches
1 build

Long-running continuous work
Many builds

Keeping track
The same scorecard, every hour

ANTHROPIC

### Compiler 1: start with bytecode

The first compiler reused JavaScriptCore code and guessed types from bytecode after conversion to JavaScript erased them. Claude Code grew from 330 MB to 1,036 MB. Using types cut CPU use by 2%. Speed stayed close to the JIT’s.

[10:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=621s) [The first compiler strips TypeScript types, converts JavaScript to bytecode, guesses types, and emits machine code. The slide reports 1,036 MB for Claude Code versus 330 MB before, and 2% less CPU from using types.](https://assets.ai.engineer/sites/aiecode2025/sha256/561348c5f5a8cccecf8212b5798c4cda28b2ac4c04bfe3003de5d448af36c941.webp)

Compiler 1: start with bytecode

TypeScript → JavaScript → Bytecode → Guess the types → Machine code
types removed

1,036 MB
Claude Code (it was 330 MB)

2%
less CPU from using types

It wasn’t much faster than the JIT

ANTHROPIC

### Why the compiler started with bytecode

The first compiler started with bytecode largely to reuse JavaScriptCore’s existing compiler code. The Claude Code prompt challenges that starting point by asking whether the compiler could use type inference.

[10:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=648s) [A Claude Code exchange asks why the compiler works from bytecode. The reply explains that the existing compiler already operated at that stage.](https://assets.ai.engineer/sites/aiecode2025/sha256/daec87aaac5ef1177a1cdb58021dfa912d4f7705a409bd67e3934ab949113fa4.webp)

❯ Why are we doing this through bytecode instead of through the type inference?

• We did it in bytecode mostly because that’s where our compiler already lived, not because it’s the better place.

Interface text:
Claude Code
~/code/WebKit
Oct 5, 12:20 am
ANTHROPIC

AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC

### Using bun check for type inference

After a third attempt at a weaker C++ inference pass, Sumner tells Claude Code to use Bun’s TypeScript checker, bun check. He reports that Claude Code then started 2× faster and used about one-third as much memory.

[10:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=656s) [Two Claude Code prompts challenge the compiler design and call for using bun check for type inference after repeated attempts to implement a separate inference pass in C++.](https://assets.ai.engineer/sites/aiecode2025/sha256/187f1e62c3b0e7ef9b0a7b8df582c790239d47614ba101128186c90c15e09377.webp)

❯ this design is still wrong imo

❯ bun check exists for you to use it for type inference, not to do a second weaker inference in C++, which is now the 3rd time you’ve tried to implement that in this project.

Interface text:
Claude Code
~/code/WebKit
Oct 7, 6:10 pm
ANTHROPIC

AI Engineer
Code Summit
PRESENTED BY
Google DeepMind

Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC

### Does this program use Bun.Archive?

The draft --trim check writes every property name to a text file and looks for an exact match. An Archive property on any object can make the trimmer keep Bun.Archive even when the program never uses the API.

[11:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=680s) [A code example shows how Bun’s --trim checks whether any recorded property name matches Archive.](https://assets.ai.engineer/sites/aiecode2025/sha256/c69776d96c1dfc45a798b54424a5ca11f35c16cf911a32deb97cbbae6205e77b.webp)

Does this program use Bun.Archive?
--trim removes the parts of Bun you don’t use

split(facts, b"\n").any(|line|
  line.strip_prefix(b"program-property ")
    == Some(condition.name))

• Print every property name in the program to a text file
• Search it for the word “Archive”

ANTHROPIC

### Claude Code confirms the Archive property-name search

Claude Code confirms that Bun’s trim check searches property names as text, so even an unrelated Archive property can flag Bun.Archive as potentially used. The screenshot also reads “Deleting 127,553 lines…”

[11:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=705s) [Claude Code confirms that the implementation searches property names as text. A status line says 127,553 lines are being deleted.](https://assets.ai.engineer/sites/aiecode2025/sha256/e21c347a54f4f1a268723c9369e86f2f452818510afe88fcb7ddb952dac93b63.webp)

Claude Code

❯ it uses Archive?
❯ omfg does the facts thign do a string search
❯ over property names
• Yes, it does a text search over property names.

✻ Deleting 127,553 lines…

ANTHROPIC

Interface text:
~/code/WebKit
Oct 18, 1:05 am
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun
ANTHROPIC

### Claude Code’s Markdown planning estimate

Claude Code estimated that sticking to its compiler design plan would mean about 7,600 Markdown files. Jarred Sumner pushed back at even 1,500, questioning who would read that many.

[11:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=710s) [Claude Code estimates that its plan would produce about 7,600 Markdown files. A later prompt in the exchange objects to 1,500 files.](https://assets.ai.engineer/sites/aiecode2025/sha256/7c6a9f79169176a83f1f2fef9551940a850701e3f7f8cc38f6f18d074ef48bfd.webp)

Claude Code

❯ How many like markdown files is this going to be?
• About 7,600 if I stick to the plan I gave you, which is too many.
❯ What the hell are you doing?
❯ 1500 markdown files is insane slop

ANTHROPIC

Interface text:
~/code/WebKit
Oct 18, 9:53 pm
AI Engineer
Code Summit
PRESENTED BY
Google DeepMind
Keynote
Jarred Sumner / Founder of Bun  ANTHROPIC

### Compiler 4: analyze the whole program

[12:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=768s) [The pipeline runs from type checking through flow analysis, 60 passes, and B3 to machine code. The slide reports 2.3× faster startup and 4.2× less memory for Claude Code compared with the JIT.](https://assets.ai.engineer/sites/aiecode2025/sha256/4a1b448a0f8cd399c60ccff18c0baf01a3d9f2d3053257e9579e2e7ae52cdaf2.webp)

## Full transcript

[0:01](https://www.youtube.com/watch?v=TvsF67C2F54&t=1s) [music]

[0:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=12s) Hello everyone.

[0:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=14s) My name is Jared. Uh I'm the creator of

[0:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=17s) Bung. Uh and I work at Enthropic. Um uh

[0:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=22s) Bun is the JavaScript runtime that

[0:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=23s) powers cloud code. And recently I merged

[0:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=28s) a several million line of code PR um to

[0:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=31s) add an ahead of time compiler uh to to

[0:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=35s) bun which is uh basically the idea is uh

[0:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=39s) instead of paying the cost of a JIT at

[0:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=42s) runtime you can uh uh you can compile

[0:46](https://www.youtube.com/watch?v=TvsF67C2F54&t=46s) all the code ahead of time. Um

[0:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=50s) and it's it's like a really big project.

[0:54](https://www.youtube.com/watch?v=TvsF67C2F54&t=54s) Um over the summer I uh rewrote bun and

[0:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=58s) rust. Um uh and this is a project on a

[1:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=62s) larger scale. This ahead of time

[1:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=64s) compiler is like a larger project than

[1:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=66s) that. Um and

[1:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=70s) I think one of the challenges right now

[1:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=71s) with large projects is like how do you

[1:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=74s) actually confidently ship a mill like

[1:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=76s) millions of lines of code written by

[1:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=78s) agents. Um

[1:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=80s) so that's what I'm going to talk about.

[1:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=83s) This was like the opening prompt after

[1:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=85s) some discussion with it was like

[1:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=88s) basically uh we need to make cloud code

[1:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=92s) use a lot less memory and uh and faster

[1:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=95s) and we can modify either webkit or bun.

[1:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=99s) Um bun uses JavaScript core which is

[1:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=101s) webkit um under the hood. Uh and it's

[1:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=105s) been a little bit over a month. Um

[1:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=109s) uh

[1:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=111s) uh this is this compiler has gone

[1:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=113s) through five rewrites. Um you can see

[1:57](https://www.youtube.com/watch?v=TvsF67C2F54&t=117s) the like the first couple ones were like

[2:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=120s) pretty short and then I like almost

[2:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=122s) shipped the blue one. Uh and then I was

[2:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=126s) like this is building way too long. Like

[2:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=127s) it's taking way too long to compile the

[2:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=129s) code. So rewrote it again. Uh and this

[2:13](https://www.youtube.com/watch?v=TvsF67C2F54&t=133s) next one is shipping next week.

[2:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=138s) Uh

[2:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=140s) this is kind of the way I think about a

[2:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=143s) project like this is like you're really

[2:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=145s) constrained by how you test that the

[2:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=148s) code works. Um so that's like even more

[2:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=151s) important than what you're specifically

[2:33](https://www.youtube.com/watch?v=TvsF67C2F54&t=153s) like like the approach you go with for

[2:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=154s) how to build it is entirely driven by

[2:36](https://www.youtube.com/watch?v=TvsF67C2F54&t=156s) how do you verify that it actually is

[2:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=158s) going to like work and not be buggy and

[2:40](https://www.youtube.com/watch?v=TvsF67C2F54&t=160s) that you can trust it.

[2:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=162s) Um and so just a little more background

[2:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=165s) on like like why this particular project

[2:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=169s) why the ahead of time compiler and it's

[2:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=171s) because uh for a typical JavaScript

[2:54](https://www.youtube.com/watch?v=TvsF67C2F54&t=174s) based application

[2:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=176s) roughly half of like this the CPU time

[2:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=179s) is just spent compiling code on demand.

[3:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=182s) Um and so a lot of the general like

[3:05](https://www.youtube.com/watch?v=TvsF67C2F54&t=185s) thing you you've seen in a lot of

[3:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=187s) applications where people are rewriting

[3:08](https://www.youtube.com/watch?v=TvsF67C2F54&t=188s) their code bases in in a language like

[3:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=190s) Rust or sometimes Go um it's like when

[3:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=194s) coming from JavaScript it's because uh

[3:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=198s) like there it's really the the

[3:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=200s) combination of the JIT and that it's a

[3:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=202s) single threaded application.

[3:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=205s) Um so that's sort of the difference

[3:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=208s) between a JIT and AOT is that uh you

[3:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=212s) compile before whereas with a JIT you

[3:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=214s) compile as you go along.

[3:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=218s) This is particularly important for

[3:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=219s) something like cloud code where when

[3:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=221s) using like the cloud code like iOS app

[3:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=224s) where the CPU time is a lot uh if you're

[3:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=229s) if you have to have every session of

[3:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=231s) cloud code also compiling

[3:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=236s) um so we talked a lot about like like

[4:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=240s) should we rewrite cloud code in Rust um

[4:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=243s) because the bun team us rewrote bun in

[4:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=247s) rust So like we're pretty good at

[4:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=249s) rewrites. Um uh and we decided not to.

[4:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=256s) Um and the the reason why is because

[4:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=260s) like for in bun's case it's actually

[4:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=261s) like pretty easy to do like bun is an

[4:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=264s) easy project to do a rust rewrite

[4:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=265s) because the tests were written in a

[4:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=267s) language that's independent of the one

[4:29](https://www.youtube.com/watch?v=TvsF67C2F54&t=269s) it runs in. But so because all the tests

[4:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=271s) were written in Typescript um we could

[4:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=274s) run the tests on both the zig version

[4:36](https://www.youtube.com/watch?v=TvsF67C2F54&t=276s) and the rust version whereas for cloud

[4:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=279s) code uh we like cloud codes tests are

[4:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=283s) written in typescript. So we would have

[4:46](https://www.youtube.com/watch?v=TvsF67C2F54&t=286s) to port cloud codes test suite and

[4:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=290s) as soon as you're like rewriting the

[4:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=291s) tests then you can't really trust the

[4:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=293s) tests anymore. Um so that seemed like

[4:57](https://www.youtube.com/watch?v=TvsF67C2F54&t=297s) it'd be too risky.

[4:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=299s) So instead, what if we just make

[5:01](https://www.youtube.com/watch?v=TvsF67C2F54&t=301s) JavaScript faster so we don't have to

[5:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=304s) rewrite it in Rust?

[5:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=307s) Um, this was another prompt a little bit

[5:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=309s) later. Um,

[5:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=312s) uh,

[5:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=314s) and the result

[5:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=318s) is that it actually did uh have

[5:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=320s) JavaScript's memory like the memory

[5:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=322s) usage uh, it uses about 4x less memory.

[5:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=326s) Um uh it starts about two times faster.

[5:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=330s) Um

[5:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=332s) uh and we we're dog fooding this

[5:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=335s) internally and it'll be external soon.

[5:40](https://www.youtube.com/watch?v=TvsF67C2F54&t=340s) Um some more benchmarks uh and then I'll

[5:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=343s) also go into more detail about how we

[5:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=344s) actually did this. Um so like it's it's

[5:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=349s) possible that if an interesting thing is

[5:52](https://www.youtube.com/watch?v=TvsF67C2F54&t=352s) like like TypeScript 7 rewrote their

[5:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=355s) code by by hand um from uh

[5:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=358s) JavaScript/TypeScript

[6:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=360s) to to go and uh the singlethreaded

[6:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=364s) version uh with you when compiled via

[6:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=367s) bun compile is now faster than the

[6:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=369s) singlethreaded TypeScript Go port. Um

[6:15](https://www.youtube.com/watch?v=TvsF67C2F54&t=375s) and we will add threads also to the

[6:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=377s) ahead of time compiled version of bun

[6:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=380s) but we haven't done that yet. So there

[6:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=382s) is a PR.

[6:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=384s) Um and so a little bit about like the

[6:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=387s) actual ahead of time compiler um uh

[6:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=391s) typescript is not the type types are

[6:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=394s) don't necessarily need to be correct. So

[6:36](https://www.youtube.com/watch?v=TvsF67C2F54&t=396s) it treats types as predictions uh

[6:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=399s) instead of like trusting them.

[6:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=403s) Um, and this kind of problem works

[6:46](https://www.youtube.com/watch?v=TvsF67C2F54&t=406s) really well for models because uh

[6:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=409s) they're just really good at writing

[6:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=410s) compilers. Um, so so uh

[6:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=415s) uh this is sort of like more about like

[6:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=418s) how how uh like should we like how we

[7:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=423s) were thinking about this decision. Um,

[7:05](https://www.youtube.com/watch?v=TvsF67C2F54&t=425s) and a a big thing here is like there's

[7:08](https://www.youtube.com/watch?v=TvsF67C2F54&t=428s) so many tests you can run when you're

[7:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=430s) when it's like uh in ahead of time like

[7:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=432s) like for something like this because we

[7:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=434s) don't need to write any tests pretty

[7:15](https://www.youtube.com/watch?v=TvsF67C2F54&t=435s) much ourselves. Like we actually do

[7:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=437s) write a lot of tests but uh we can

[7:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=440s) largely trust that the tests that

[7:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=442s) predate the project work. Um, and this

[7:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=445s) was the same thing with the the bun rust

[7:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=448s) rewrite where we had buns existing test

[7:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=450s) suite we could run and now with a

[7:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=452s) compiler uh we have bun's existing test

[7:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=455s) suite plus web kids test plus test 262

[7:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=458s) plus cloud codes tests

[7:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=461s) um and then we also made it so that way

[7:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=463s) bun itself the bun's own test runner

[7:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=465s) could be run in the AOT mode

[7:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=470s) uh

[7:52](https://www.youtube.com/watch?v=TvsF67C2F54&t=472s) and like the we have one breaking change

[7:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=476s) with or relates to two breaking changes

[7:57](https://www.youtube.com/watch?v=TvsF67C2F54&t=477s) with the ahead of time compiler and

[7:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=479s) that's pretty much why these particular

[8:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=482s) tests are failing. Um but the and the

[8:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=486s) two breaking changes are actually like

[8:08](https://www.youtube.com/watch?v=TvsF67C2F54&t=488s) mostly security things um to prevent

[8:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=491s) prototype pollution attacks but they

[8:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=494s) also end up benefiting for performance.

[8:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=496s) Um

[8:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=498s) so like what makes this particular kind

[8:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=500s) of problem pretty good for agents is

[8:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=502s) like uh you run it with you can run all

[8:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=506s) three versions of an application. One

[8:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=507s) with a JIT, one with ahead of time

[8:29](https://www.youtube.com/watch?v=TvsF67C2F54&t=509s) compiled and one also without the types

[8:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=511s) and as long as the three of them uh

[8:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=514s) behave the same then you know that it

[8:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=517s) works at least for that specific

[8:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=518s) application. But then you can take that

[8:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=521s) kind of problem and fuzz it a lot. Um uh

[8:46](https://www.youtube.com/watch?v=TvsF67C2F54&t=526s) and just have Claude like turn out code

[8:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=529s) generators to like fuzz different

[8:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=531s) patterns. Um and you can catch a lot of

[8:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=535s) bugs that way. Um

[8:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=538s) uh this is a very large project. This is

[9:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=540s) the biggest I think I've worked on uh in

[9:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=544s) terms of like code volume.

[9:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=547s) Um most of this is tests. Um

[9:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=550s) and also because we rewrote it five

[9:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=552s) times. um when you're like doing this

[9:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=556s) kind of project

[9:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=558s) what how I think about it is like you

[9:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=560s) have like batches of like okay we need

[9:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=563s) to write a lot of code at once and then

[9:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=566s) after that initial batch then it's okay

[9:29](https://www.youtube.com/watch?v=TvsF67C2F54&t=569s) let's have let's like fix everything

[9:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=571s) make sure it compiles make sure it

[9:33](https://www.youtube.com/watch?v=TvsF67C2F54&t=573s) passes a bunch of tests um and make sure

[9:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=575s) it like really truly works um and the

[9:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=579s) actual logistics of that are like when

[9:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=582s) you're in the big batch kind of project

[9:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=584s) stage, then uh you don't want to run

[9:47](https://www.youtube.com/watch?v=TvsF67C2F54&t=587s) builds. You want to run one build

[9:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=590s) because otherwise you're going to spend

[9:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=591s) all your time compiling and like waiting

[9:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=593s) for build errors and it's going to like

[9:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=595s) not be a good use of anyone's time. Uh

[9:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=599s) and then separately

[10:01](https://www.youtube.com/watch?v=TvsF67C2F54&t=601s) uh for like longer running like once you

[10:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=604s) have once you've written all the code uh

[10:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=606s) you want to uh have it like have lots of

[10:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=611s) individual agents. Um

[10:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=614s) this is like a little bit of the

[10:16](https://www.youtube.com/watch?v=TvsF67C2F54&t=616s) timeline um of this project. Uh

[10:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=623s) the first one was not very good. Uh like

[10:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=628s) cloud code was a gigabyte. Um which is

[10:31](https://www.youtube.com/watch?v=TvsF67C2F54&t=631s) terrible. Uh

[10:33](https://www.youtube.com/watch?v=TvsF67C2F54&t=633s) uh and like this used as much as

[10:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=637s) possible from JavaScript core's existing

[10:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=639s) code. Um so it was like basically the

[10:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=643s) ceiling was what is is like only as good

[10:46](https://www.youtube.com/watch?v=TvsF67C2F54&t=646s) as like what it could be from that. Um

[10:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=650s) uh so then a little bit after this we

[10:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=653s) added a TypeScript type checker into bun

[10:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=655s) itself.

[10:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=656s) Um

[10:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=659s) these were prompts uh uh and so we added

[11:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=663s) bun check and then we're like hey Claude

[11:05](https://www.youtube.com/watch?v=TvsF67C2F54&t=665s) please use bun check. Um uh and then

[11:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=670s) after that startup time got two times

[11:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=672s) faster and uh in cloud code and uh

[11:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=677s) started using about 3x less memory

[11:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=682s) but the code was slop

[11:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=686s) uh

[11:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=687s) and like like this is not good. it

[11:29](https://www.youtube.com/watch?v=TvsF67C2F54&t=689s) should never basically this meant that

[11:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=692s) any object that accessed a property

[11:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=694s) called archive it would then assume that

[11:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=697s) the bun.archive API was potentially

[11:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=699s) used. Um and I looked at this and I was

[11:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=702s) like we cannot ship this. This is not

[11:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=704s) good. Um so then uh uh

[11:54](https://www.youtube.com/watch?v=TvsF67C2F54&t=714s) this is like yeah and that this is

[11:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=716s) another thing too is like it just like

[12:01](https://www.youtube.com/watch?v=TvsF67C2F54&t=721s) when you're doing like a large planning

[12:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=722s) like when you're starting to like have

[12:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=723s) it do a bunch of design docs and stuff

[12:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=726s) it just loves writing markdown docs and

[12:08](https://www.youtube.com/watch?v=TvsF67C2F54&t=728s) it doesn't make sense because who's

[12:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=730s) going to like

[12:13](https://www.youtube.com/watch?v=TvsF67C2F54&t=733s) 1500 markdown files It's just not

[12:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=737s) reasonable.

[12:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=738s) Uh

[12:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=742s) uh

[12:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=744s) so for this it was like and this was

[12:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=746s) like I think the third compiler version

[12:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=748s) maybe it was the fourth. No this was the

[12:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=750s) third. Um uh

[12:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=754s) it to like just to kind of batch get it

[12:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=758s) all out uh 140 agents at the same time

[12:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=761s) write all the code all at the same time.

[12:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=763s) then get cloud code to run. Um

[12:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=768s) uh

[12:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=771s) and then uh this is the fourth one. Um

[12:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=775s) and this one the code was not slop um

[12:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=779s) pretty good um with like basically the

[13:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=782s) same performance as before. However, the

[13:05](https://www.youtube.com/watch?v=TvsF67C2F54&t=785s) compilation time was way too slow

[13:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=787s) because people coming from like a

[13:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=790s) JavaScript background don't expect any

[13:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=791s) compilation time. Um uh so 50 seconds

[13:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=797s) for like cloud code is like a pretty

[13:19](https://www.youtube.com/watch?v=TvsF67C2F54&t=799s) large codebase but this meant that like

[13:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=802s) other projects would take like

[13:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=804s) single-digit seconds and people don't

[13:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=806s) want to wait that long.

[13:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=808s) Um so uh

[13:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=812s) we're going to rewrite it again. Um and

[13:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=815s) and uh cuz in in older versions of this

[13:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=818s) compiler, it was taking like 10 to 20

[13:40](https://www.youtube.com/watch?v=TvsF67C2F54&t=820s) seconds.

[13:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=822s) Uh and then cloud does this thing where

[13:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=825s) like it'll try to like size up

[13:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=829s) everything to judge whether or not it's

[13:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=831s) worth working on, but it's really easy

[13:52](https://www.youtube.com/watch?v=TvsF67C2F54&t=832s) to convince yourself that like your

[13:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=835s) measurements are good um when they're

[13:57](https://www.youtube.com/watch?v=TvsF67C2F54&t=837s) not good. Uh uh

[14:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=843s) and like part of it was also like why is

[14:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=846s) this 900,000 lines of code? This should

[14:08](https://www.youtube.com/watch?v=TvsF67C2F54&t=848s) be a lot like smaller. Um

[14:13](https://www.youtube.com/watch?v=TvsF67C2F54&t=853s) uh so then we did it one more time. Um

[14:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=858s) and the code was good and the build time

[14:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=863s) uh was under 20 seconds.

[14:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=865s) Um,

[14:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=872s) it's possible that we end up with a

[14:33](https://www.youtube.com/watch?v=TvsF67C2F54&t=873s) sixth time sometime later, but the fifth

[14:36](https://www.youtube.com/watch?v=TvsF67C2F54&t=876s) one is like very shippable and I've

[14:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=878s) worked on this for enough time that it's

[14:40](https://www.youtube.com/watch?v=TvsF67C2F54&t=880s) like time to ship it.

[14:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=883s) Um, a lot of this was like just like,

[14:47](https://www.youtube.com/watch?v=TvsF67C2F54&t=887s) "Hey Claude, try this idea and then see

[14:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=890s) what happens." And then it would like

[14:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=891s) size up the idea. Um, and I think this

[14:54](https://www.youtube.com/watch?v=TvsF67C2F54&t=894s) is like still kind of not right. Uh,

[14:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=896s) like I think a lot of this are like

[15:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=900s) things that we should try again and not

[15:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=903s) let it like kind of what I said earlier

[15:05](https://www.youtube.com/watch?v=TvsF67C2F54&t=905s) about like uh sizing up the the impact

[15:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=909s) of a change is like it's really easy to

[15:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=912s) underest or to like size it up

[15:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=914s) incorrectly and then talk yourself out

[15:15](https://www.youtube.com/watch?v=TvsF67C2F54&t=915s) of it. Um, so I think this probably

[15:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=918s) needs to be revisited more.

[15:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=921s) Um my old approach particularly with

[15:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=924s) like the the bun rust rewrite was very

[15:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=927s) much leaning on like cloud code

[15:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=928s) workflows to do things. Um and pretty

[15:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=932s) much now with the most recent models uh

[15:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=935s) I mostly just rely on sub agents that

[15:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=937s) are like very longived. Um

[15:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=941s) except for that initial part where

[15:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=943s) you're like writing all the code all at

[15:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=944s) once. Um, and this with the sub aents it

[15:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=948s) works pretty well because they keep all

[15:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=951s) the context of the relevant code in

[15:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=953s) their head or like in the context

[15:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=955s) window. Um, uh, and uh, that's like less

[16:01](https://www.youtube.com/watch?v=TvsF67C2F54&t=961s) wasteful. Um, and like they can just

[16:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=964s) keep going. Um,

[16:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=970s) here's a little more about like how the

[16:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=972s) different parts of the compiler works.

[16:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=974s) Um

[16:15](https://www.youtube.com/watch?v=TvsF67C2F54&t=975s) generally it's like there's if we can

[16:19](https://www.youtube.com/watch?v=TvsF67C2F54&t=979s) confidently prove that uh the value is

[16:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=983s) like the types are the same that they're

[16:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=984s) monomorphic then it can become a field

[16:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=986s) access otherwise it has to check every

[16:29](https://www.youtube.com/watch?v=TvsF67C2F54&t=989s) single time uh uh and it has like some

[16:33](https://www.youtube.com/watch?v=TvsF67C2F54&t=993s) inline caching but not like a lot. Um

[16:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=997s) uh as with a project of this size, you

[16:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=1001s) really do need to it's kind of hard to

[16:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=1003s) follow sometimes like what everything

[16:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=1005s) what everything's happening. So uh I

[16:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=1008s) lean a lot on like just having an hourly

[16:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=1010s) update.

[16:52](https://www.youtube.com/watch?v=TvsF67C2F54&t=1012s) Um and where it would post a scorecard

[16:54](https://www.youtube.com/watch?v=TvsF67C2F54&t=1014s) comparing a bunch of metrics that we

[16:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=1016s) were prioritizing.

[16:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=1019s) Um,

[17:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=1020s) usually though when it was posting in

[17:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=1022s) Slack, it would show like a previous and

[17:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=1024s) this version so that way it was easy to

[17:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=1026s) see if numbers went up or down. Um, but

[17:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=1029s) it's like not helpful in a slide because

[17:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=1031s) the previous one is just legit.

[17:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=1034s) Um,

[17:19](https://www.youtube.com/watch?v=TvsF67C2F54&t=1039s) the the important thing is like none of

[17:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=1041s) these tests for the most part are things

[17:22](https://www.youtube.com/watch?v=TvsF67C2F54&t=1042s) that are like made up. um uh they're

[17:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=1047s) things that like pre predated the

[17:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=1050s) project so that way we know that like

[17:32](https://www.youtube.com/watch?v=TvsF67C2F54&t=1052s) the agent couldn't have messed with it.

[17:36](https://www.youtube.com/watch?v=TvsF67C2F54&t=1056s) Fuzzili is like a JavaScript engine

[17:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=1058s) fuzzer that V8 uses. Um so uh and we

[17:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=1063s) were already using that in bun but we

[17:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=1064s) also extended it to have uh to like test

[17:48](https://www.youtube.com/watch?v=TvsF67C2F54&t=1068s) for TypeScript types um as well. Um

[17:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=1073s) uh

[17:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=1075s) and it's also important to check that

[17:57](https://www.youtube.com/watch?v=TvsF67C2F54&t=1077s) the tests actually catch things because

[18:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=1080s) it's really easy to fool yourself that

[18:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=1082s) it's finding bugs when it's not finding

[18:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=1083s) bugs.

[18:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=1087s) Some more numbers uh on the ahead of

[18:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=1090s) time compiler. Um it generally for most

[18:14](https://www.youtube.com/watch?v=TvsF67C2F54&t=1094s) projects outperforms the JIT. Um not

[18:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=1098s) always. the you can see in the uglify.js

[18:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=1100s) case and that's basically if it has to

[18:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=1103s) use the interpreter a lot. So if there's

[18:24](https://www.youtube.com/watch?v=TvsF67C2F54&t=1104s) a lot of like eval or a new function um

[18:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=1107s) then it's not faster. Um but most

[18:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=1110s) applications don't do that. Uh and it's

[18:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=1115s) like

[18:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=1117s) it's like a make it like it's as close

[18:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=1118s) as possible as you can get to like a

[18:40](https://www.youtube.com/watch?v=TvsF67C2F54&t=1120s) oneliner to like make an application run

[18:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=1123s) faster. Um this is not 100% true because

[18:47](https://www.youtube.com/watch?v=TvsF67C2F54&t=1127s) as you can see uglifyjs and there are

[18:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=1129s) other cases as well. Um but it is often

[18:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=1133s) true.

[18:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=1136s) So like yeah the other thing is object

[18:58](https://www.youtube.com/watch?v=TvsF67C2F54&t=1138s) prototype. Uh this is like a rare edge

[19:01](https://www.youtube.com/watch?v=TvsF67C2F54&t=1141s) case but basically

[19:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=1143s) there's a lot of security

[19:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=1144s) vulnerabilities in JavaScript

[19:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=1146s) applications called like prototype

[19:08](https://www.youtube.com/watch?v=TvsF67C2F54&t=1148s) pollution. And this usually works by

[19:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=1149s) assigning properties onto

[19:11](https://www.youtube.com/watch?v=TvsF67C2F54&t=1151s) object.prototype.

[19:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=1152s) Um, and the compiler bans that.

[19:18](https://www.youtube.com/watch?v=TvsF67C2F54&t=1158s) So like for a large project like this,

[19:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=1160s) what do you actually do all day? These

[19:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=1161s) were like the top messages that I sent

[19:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=1165s) saying continue a lot.

[19:28](https://www.youtube.com/watch?v=TvsF67C2F54&t=1168s) Um,

[19:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=1170s) uh, also like my laptop kept dying. Um

[19:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=1174s) uh

[19:38](https://www.youtube.com/watch?v=TvsF67C2F54&t=1178s) and then like but like more concretely

[19:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=1181s) what you actually do is like a bunch of

[19:43](https://www.youtube.com/watch?v=TvsF67C2F54&t=1183s) leading questions like why are we doing

[19:45](https://www.youtube.com/watch?v=TvsF67C2F54&t=1185s) this? Uh can we do this? Also I end up

[19:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=1190s) saying like can you do this faster or

[19:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=1191s) like what's taking so long? Because it

[19:53](https://www.youtube.com/watch?v=TvsF67C2F54&t=1193s) kind of like talks itself into making up

[19:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=1196s) rules. Um

[19:59](https://www.youtube.com/watch?v=TvsF67C2F54&t=1199s) uh

[20:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=1203s) and also it tends to not be uh it tends

[20:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=1206s) to like underestimate what it can do. Um

[20:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=1210s) so I often end up saying things like

[20:13](https://www.youtube.com/watch?v=TvsF67C2F54&t=1213s) this to Claude to to get it to like uh

[20:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=1217s) try harder.

[20:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=1223s) And the result is that uh Jetream 3

[20:27](https://www.youtube.com/watch?v=TvsF67C2F54&t=1227s) which is one of the main benchmarks that

[20:29](https://www.youtube.com/watch?v=TvsF67C2F54&t=1229s) JavaScript engines use um uh the bun

[20:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=1234s) outperforms both JavaScript cores JIT

[20:37](https://www.youtube.com/watch?v=TvsF67C2F54&t=1237s) and no Node.js in like V8 JIT um in most

[20:42](https://www.youtube.com/watch?v=TvsF67C2F54&t=1242s) of them. Uh,

[20:49](https://www.youtube.com/watch?v=TvsF67C2F54&t=1249s) and the whole time like it's been using

[20:51](https://www.youtube.com/watch?v=TvsF67C2F54&t=1251s) cloud code to like build the bun compile

[20:54](https://www.youtube.com/watch?v=TvsF67C2F54&t=1254s) like to build bun compile itself and

[20:56](https://www.youtube.com/watch?v=TvsF67C2F54&t=1256s) then using the build of cloud code that

[20:57](https://www.youtube.com/watch?v=TvsF67C2F54&t=1257s) was compiled with bun compile.

[21:00](https://www.youtube.com/watch?v=TvsF67C2F54&t=1260s) Um,

[21:03](https://www.youtube.com/watch?v=TvsF67C2F54&t=1263s) uh,

[21:05](https://www.youtube.com/watch?v=TvsF67C2F54&t=1265s) so sort of how I think about this is

[21:07](https://www.youtube.com/watch?v=TvsF67C2F54&t=1267s) like

[21:09](https://www.youtube.com/watch?v=TvsF67C2F54&t=1269s) like the testability thing is super

[21:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=1270s) important when you're working on a large

[21:12](https://www.youtube.com/watch?v=TvsF67C2F54&t=1272s) project with Claude. Uh, and to make

[21:15](https://www.youtube.com/watch?v=TvsF67C2F54&t=1275s) sure that the tests actually test

[21:17](https://www.youtube.com/watch?v=TvsF67C2F54&t=1277s) things. Um,

[21:20](https://www.youtube.com/watch?v=TvsF67C2F54&t=1280s) and if you're not actively

[21:21](https://www.youtube.com/watch?v=TvsF67C2F54&t=1281s) reme-measuring, then it's going to like

[21:23](https://www.youtube.com/watch?v=TvsF67C2F54&t=1283s) get worse because it's just if there's

[21:25](https://www.youtube.com/watch?v=TvsF67C2F54&t=1285s) so much stuff going on, it's really easy

[21:26](https://www.youtube.com/watch?v=TvsF67C2F54&t=1286s) to lose track. Um

[21:30](https://www.youtube.com/watch?v=TvsF67C2F54&t=1290s) uh and like it's easier for large

[21:34](https://www.youtube.com/watch?v=TvsF67C2F54&t=1294s) projects like this that haven't shipped

[21:35](https://www.youtube.com/watch?v=TvsF67C2F54&t=1295s) yet to uh rewrite than it is to

[21:39](https://www.youtube.com/watch?v=TvsF67C2F54&t=1299s) refactor.

[21:41](https://www.youtube.com/watch?v=TvsF67C2F54&t=1301s) Um and if you don't act ambitiously then

[21:44](https://www.youtube.com/watch?v=TvsF67C2F54&t=1304s) the models will like start having like

[21:47](https://www.youtube.com/watch?v=TvsF67C2F54&t=1307s) 0.1% improvements instead of like 10%

[21:50](https://www.youtube.com/watch?v=TvsF67C2F54&t=1310s) improvements. So you kind of have to

[21:52](https://www.youtube.com/watch?v=TvsF67C2F54&t=1312s) constantly nudge it to like hey you can

[21:55](https://www.youtube.com/watch?v=TvsF67C2F54&t=1315s) do really cool things if you try harder.

[22:02](https://www.youtube.com/watch?v=TvsF67C2F54&t=1322s) Uh you can try this now if you want uh

[22:04](https://www.youtube.com/watch?v=TvsF67C2F54&t=1324s) by running bun upgrade- canary if you

[22:06](https://www.youtube.com/watch?v=TvsF67C2F54&t=1326s) have bun installed um and then just bun

[22:10](https://www.youtube.com/watch?v=TvsF67C2F54&t=1330s) compile. Thanks everyone.
