Credit: this is my take on I finally ported typescript to rust, a 47-minute video by Theo (t3.gg). The project is tsc-rs on GitHub. The facts below come from his video and the project README. The opinions are mine.
The short version#
Theo says he spent about five months throwing agents at a Rust rewrite of the TypeScript compiler, type checker and language server. By his account, more than $400K of OpenAI-model tokens got him to about 84% compatibility and stalled. Then he pointed Claude Opus at it, and it restarted from scratch and got there in about two weeks, for about $24K at API prices. He says he has not read a single line of the code.
The project is called tsc-rs (also ts-rust), and it is on npm. The README flags it as an early release. It is not a port of the old JavaScript compiler. It ports Microsoft’s new Go-based TypeScript 7 compiler, and the README says all 181,711 of the ported Go compiler tests pass.
Why this matters beyond one repo#
The speed headline is the least interesting part. In the README’s six-app benchmark (VS Code, Sentry, Playwright, Excalidraw, TypeORM and tRPC), tsc-rs checks about 1.9x faster than TypeScript 7 and about 13x faster than TypeScript 6. Bun’s own checker, bun check, is faster still, at about 3x faster than TypeScript 7, and it is the fastest on every app in that list except tRPC.
The interesting part is what changed between the failed attempt and the working one. Theo’s explanation is that porting JavaScript to Rust is brutal, while porting Go to Rust is mostly a line-by-line translation. Microsoft’s team had already done the hard JavaScript-to-Go step by hand. The agents inherited a typed reference with a huge test suite and a clear definition of done.
That is the pattern I would bet on. Agents are weak at open-ended rewrites and strong when there is a reference implementation and thousands of tests to check against. If your own codebase has that shape, big migrations just got cheaper.
Theo’s real reason for wanting it#
He says speed was not the point. His argument is that a Go compiler is hard to ship to the browser as WebAssembly because you have to bundle the garbage collector too. A Rust version avoids that. He also built the Effect library’s diagnostics into tsc-rs, so projects using Effect get type checking and those checks in one pass instead of two.
His wider thesis is that inference keeps getting cheaper while the VMs agents run on do not, so lightweight sandboxes will matter more. That is his prediction, not something I can verify, so weigh it that way.
What is still rough#
The README is blunt about this, and so is Theo:
- It is an early release.
- Editor features such as quick fixes, refactors, hover and completions are not ported yet.
- In some monorepos it can write output for more files than
tscdoes. - In
tsc -bbuilds, it can fail to find a module thattscresolves. - In long editor sessions, memory grows by about 20 MiB per 1,000 edits.
Theo also says he would recommend Bun’s checker over tsc-rs for most people because he trusts its maintenance more. The catch he raises is accuracy: the README notes that bun check reports errors no other checker reports, 3 on Sentry and 2 on tRPC.
What I would do with it#
Do not swap your CI compiler this week. Run tsc-rs next to tsc on a branch, diff the diagnostics, and time it on your biggest project. If the output matches and your pipeline is type-check bound, the gain is free. If you use Effect, the single pass is the strongest reason to try it.
The bigger takeaway is the price tag. A compiler port that people treated as a meme cost about $24K in API spend, and Theo’s README says you could probably do it for around $20K now. Expect more of these.
Source video and project: Theo (t3.gg), I finally ported typescript to rust and pingdotgg/ts-rust.