YOU-CAN COURSE GUIDE

Rewriting TypeScript in Rust for $420k

A chapter-by-chapter readback of the free course by Theo - t3․gg on Theo - t3․gg.

Length47:40
Chapters19
Modules4
Plain Markdown with clickable timestamps — drops into Obsidian, Notion or GitHub as-is.

This isn't a performance story: Theo argues the real reason to port TypeScript to Rust is WASM, unlocking a full dev loop inside V8 isolates. It's also a rare post-mortem of an AI-agent-built compiler, with real cost and benchmark numbers.

Who it's for
Read this guide if
  • You follow the tsc-in-Go/Rust saga and want the benchmarks and caveats
  • You're curious what $20k of Claude tokens actually buys on a hard port
  • You care about serverless/V8-isolate hosting and where AI dev tooling is heading
Skip ahead if
  • You want a step-by-step tutorial on using ts-rust in production
  • You need a beginner TypeScript course rather than compiler/tooling commentary
  • You're looking for balanced skepticism rather than a strong pro-AI take
In brief
  • Runtime ~48 minutes (2860 seconds), split into 19 chapters in 4 chronological modules
  • Tools covered: ts-rust (tsc-rs), TypeScript 6/7 (TS Go), Bun Check, ESBuild, Just Bash, Cloudflare Workers
  • Key numbers: 12.5x faster than TS 6, ~2x faster than TS Go, ~$20k of Claude inference
  • Level: intermediate-to-advanced; assumes familiarity with TypeScript tooling
  • Includes live demos of an agent building an app entirely inside a V8 isolate

The walkthrough

Each chapter below is our original written explanation of what happens at that moment in the video — a paraphrase, not a transcript. Click any timestamp to jump the player.

The State of TypeScript Compilers

0:00

Introduction

Theo announces ts-rust, a full Rust rewrite of the TypeScript compiler, checker, and LSP, built over five months with AI agents. He teases that $400k of Codex tokens failed while $20k of Opus 5.5 succeeded in two weeks.

2:40

Sponsor Break: Qdrant

A sponsor segment on Qdrant, an open-source Rust vector database, showing how semantic search beats keyword search for vague queries, deduping GitHub issues, and thumbnail face indexing.

7:14

Why Rewriting TSC Is Hard

Transpiling TS to JS is trivial syntax-stripping, but type checking is the expensive part. The talk covers ESBuild, splitting hot-reload from type checking (the Twitch story), and why TypeScript's Turing-complete, weird-JS-shaped type system is hard to port to another language.

9:14

Microsoft's Go Rewrite

Microsoft chose Go for the official TypeScript 7 rewrite, and Theo argues that was the right call for most JS build tooling — a hot take he says dates back to early 2024.

Building TS Rust with AI Agents

10:34

Why Go Made Sense

A self-described Go hater explains Go's fit: flexible typing, goroutines, JS-like syntax, and GC. Garbage collection hurts latency-sensitive services, but for a minutes-long compiler run its cost washes out.

13:22

Porting from Go, Not JavaScript

Direct JS-to-Rust porting failed, but porting from the Go code worked — so faithfully that the agent even ported Go's standard library and reimplemented goroutines. The first Rust build was slower than Go until a two-week optimization goal was set.

15:15

What It Cost

A full price breakdown: ~$24k at API rates, effectively ~$500 via subscriptions, about ten weekly Claude limits. Theo calls it excellent value for a build that's more memory-efficient and 2x faster than the Go version.

16:42

A Drop-in Replacement?

ts-rust is nearly a 100% drop-in for TS Go: of six issues filed, five were pre-existing TSC 7 bugs faithfully ported. Benchmarks show roughly 2x over TS Go and up to 20x over the last JS-based tsc.

17:52

Bun Check vs TS Rust

Bun's Rust checker is faster but raised incorrect errors on Sentry, TRPC, and reportedly Effect. Theo would still recommend Bun Check for most people, but says ts-rust is the more faithful recreation.

20:03

The Silly Reason: A Meme

The original motivation was partly a meme: Theo claimed in flame wars that models couldn't rewrite TypeScript in a month. Opus 5.5 proved him wrong and exhausted his list of 'too hard for AI' ideas.

WASM, Isolates, and the Real Reason

21:46

The Real Reason: WASM

Go bundles poorly to WebAssembly because its garbage collector must ship too, which is why TS Go lost in-browser execution and JS APIs. Rust, by contrast, compiles cleanly to WASM.

23:22

AI and Compute Cost Trends

Using Artificial Analysis data, Theo shows inference quality-per-dollar collapsing: the 50-point tier fell from $5.86 to $0.32 in months, and lower tiers fell ~1000x annualized, while VM and compute costs climb.

24:38

Agents Expect Real Machines

Cursor Cloud runs each thread on a full ~32GB VM, and agents expect real Linux machines with bash, ripgrep, and Git. As inference gets cheaper than the compute it runs on, a better abstraction layer is needed.

28:05

How Cloudflare Isolates Work

A rundown of the computer stack from hardware to applications, contrasting Docker-per-app hosting with Cloudflare's V8 isolates: no kernel or file system, but dramatically cheaper because Google already invested billions in V8 efficiency.

31:54

Just Bash and the Isolate Demo

Just Bash gives agents a fake Bash environment in JavaScript, and a demo shows GPT-61 Sol building a working app entirely inside a V8 isolate using under 260MB RAM. The whole loop — agent, build, type check — works even with a read-only file system.

33:42

Why Rust Beats Go Here

Running the compiler in an isolate is impractical with Go: tsgo wastes resources and WASM fits Go poorly. The Rust-based version idles at half the RAM of the Go/esbuild variant, making a pennies-per-app dev loop plausible.

Behind the Build and Final Takes

41:53

How the Two-Week Build Ran

Theo walks through the actual agent setup: auto-notes from a 16-hour run, crashing memory issues at 'ultracode' effort, SSH access to extra VPS machines, and a goal of at least 2x over the Go build. He stresses the real work was environment design, not prompts — like management.

44:31

The Mega Dev Course

Theo announces his first paid course for employed developers wanting to maximize AI usage, co-taught with Angie, Kent, and John Lindquist, with a live workshop, and suggests paying via employer education budgets.

46:44

Closing Takes

Closing thoughts: ts-rust validates wild ideas that can now be tested by just asking Opus, traditional YOLO engineering shouldn't work yet somehow does, and a provocative claim that AI dev is obviously the future of software.

Moment by moment

TimeWhy it matters
1:15The headline claim: $400k of Codex failed, $20k of Opus 5.5 shipped the port in two weeks
15:15The full cost breakdown of the AI build, including the subscription math
21:46The reveal of the real motivation: WASM, not performance
31:54Demo of an agent building an app entirely inside a V8 isolate under 260MB RAM
43:44Theo's manager analogy: the real work was setting up the environment for parallel agents

Do this next

  1. Star and read the ts-rust repo (github.com/pingdotgg/ts-rust) and try it on a small project to compare check times against tsc and TS Go
  2. Experiment with a V8-isolate platform like Cloudflare Workers plus Just Bash to feel what a no-VM agent loop is like
  3. Track model cost-efficiency data (e.g., Artificial Analysis) to build your own intuition for when agent-driven projects become economically viable

Common questions

Is ts-rust actually faster than the official Go rewrite?

Yes — Theo reports roughly 2x faster than TypeScript 7 (TS Go) on real projects like T3 code, and 12.5x to 20x faster than TypeScript 6, the last JS-based compiler.

Did it really cost $420,000?

No. The title is a hook. About $400k of Codex tokens produced nothing usable; the successful port used roughly $20k of Claude Opus, effectively around $500 via subscription limits.

Why not just use Bun's Rust type checker?

Bun Check is faster but raised incorrect errors on Sentry, TRPC, and reportedly Effect. Theo recommends Bun Check for most users, but ts-rust is the more faithful checker.

Why rewrite TypeScript in Rust at all if Go already works?

The main reason is WASM: Go bundles poorly to WebAssembly, while Rust compiles cleanly, enabling the compiler to run inside V8 isolates for a full browser-based dev loop.

Spot a mistake?

Spotted an error in a timestamp, summary, or number? Every chapter summary is hand-checked against the video, but we still get things wrong sometimes. Email us and we'll fix it quickly.

More course guides