When Microsoft announced its native TypeScript compiler rewrite, the team explained why they picked Go over Rust: garbage collection made the port tractable, and a Rust rewrite would need years and risk producing an incompatible language. This week a developer called that answer with an experiment. ts-rust is an experimental Rust port of the TypeScript 7 compiler, checker, and language server, and its author says he has never read a line of the code, because an LLM wrote all 1.3 million lines of it.

The author is Theo Browne of Ping.gg, known in the TypeScript community as t3dotgg. The project is pinned to a single upstream revision, the TypeScript 7.1.0-dev tree as of September 29, and the README claims all 181,711 ported Go tests pass, with language server and API outputs matching the Go compiler on the oracle test sets. Those are big claims for a two-week-old repository. The early numbers back at least some of them up.

The speed numbers

Across six open-source applications, the author measured a geometric-mean 1.61x speedup over tsc 7, the official Go compiler, and 11.4x over tsc 6, the JavaScript implementation most of the world still runs. On the VS Code codebase, ts-rs checked in 4.20 seconds against 6.84 for tsc 7. One benchmark favors Go: a Bun-based check was faster still. These are the author’s own measurements on one machine, so treat them as a datapoint until someone independent reproduces them, but a Rust port matching or beating the Go port is the part that raises eyebrows, because the official team’s reasoning said Rust would have meant starting from scratch.

It did not, technically, because the Rust port is not from scratch. It is a mechanical translation of the Go compiler’s algorithms, which is exactly what the TypeScript team said made Go attractive in the first place. The Go code structure mapped closely to the existing JavaScript codebase, so a port could keep the same architecture. The Rust port inherited that architecture secondhand. The lesson cuts both ways: Go made the official port feasible, and the Go port’s existence made a mechanical Rust translation feasible.

How it was built, and what it cost

The build story is the other half of why this repo blew up on Hacker News. The README describes months of attempts with two frontier models that burned through roughly $400,000 in API tokens while the port sat at about 84% compatibility and would not move. A switch to Anthropic’s Opus 5.5 produced a working v0 in ten hours, for around $24,000 over two weeks. Whatever your position on AI-assisted engineering, that cost curve is the interesting signal. A task that looked economically impossible in the spring was done for six percent of the price by autumn, using a different model.

TypeScript team member Dan Rosenwasser dropped into the HN thread to call it impressive work and noted it is honestly strange that three of these ports appeared within a single week. The official line has not changed: the supported compiler is the Go-based TypeScript 7, which shipped stable on July 8 with 8x to 12x full-build speedups, and typescript-go has already been merged back into the main TypeScript repository. Nobody should read ts-rs as a threat to that. It is a research artifact with a pinned upstream, an early 0.1.0 release, no Windows or Linux arm64 builds yet, and a known issues list that includes TS6059 reports in some monorepos, stale output under tsc -b, and editor memory growth during long sessions.

Why Rust anyway

The Go port has one soft spot the Rust port exploits: WebAssembly. Go’s runtime and binary size make WASM targets awkward, and Rust remains the best-supported path to small, fast WASM modules. A TypeScript checker that runs in WASM opens use cases the Go port handles poorly, like in-browser type checking and tighter bundler integration. That is one of the stated motivations for ts-rs, and it is a genuine gap rather than a benchmark flex.

Should you use it

Not in production yet, and not as your only compiler. But it is worth ten minutes in CI on a non-critical repo: run npx tsc-rs against your tsconfig, compare the diagnostics and the wall clock against tsc 7, and see whether your project matches the author’s compatibility claims. Benchmark against the pinned upstream, TypeScript 7.1.0-dev, rather than the 7.0 stable release, or the numbers will not be comparable. If your real goal is tooling compatibility with typescript-eslint and bundler plugins, wait for the official 7.1 programmatic API, which is where the supported ecosystem is heading.

The bigger story is what this says about ports of large, mature codebases. A mechanical translation of a million-line compiler used to be a multi-year team effort. It is now a two-week solo project with a token bill, gated primarily on how good the current generation of models is at long-horizon refactoring. The three ports that appeared in one week are probably a coincidence of timing. They are probably not a coincidence of trend.

Leave a Reply

Your email address will not be published. Required fields are marked *