$24 047 for two weeks. Claude rewrote the TypeScript compiler on Rust and overtook Microsoft

Depov

Moderator
Staff member
MODERATOR
ULTIMATE
SUPREME
PREMIUM
MEMBER
Joined
Feb 18, 2025
Messages
627
Reaction score
1,227
Deposit
0$
The experiment, conceived as an expensive way to check the limits of AI coding, unexpectedly ended with a working compiler. Developer Theo Brown has published tsc-rs, transferring TypeScript 7 to Rust, which created AI agents. The Rust version saves the compiler interface, type check, language server and Microsoft implementation API on Go, but works noticeably faster.

The most loud result is associated with speed. According to the project, on a set of 60 open repositories, tsc-rs performs type checks in about half the time of the official version on Go. In a separate T3 Code test, the usual mode was almost three times faster, and the accelerated mode exceeded the result of TypeScript 7 more than four times on a 16-nuclear machine.

The history with expenses is more complex than the amount of $24 thousand. Previously, Brown spent more than $ 400 thousand in terms of API tokens, trying to perform the transfer using OpenAI models. Several months of work and more than 1.3 million lines of Rust brought compatibility only to about 84%. After switching to Claude Opus 5.5, the first working version appeared in about 10 hours.

Claude's further refinement took about two weeks and cost another $24,047 at the equivalent price of the API. The AI started the project from scratch and chose a more practical path: it did not transfer the old implementation of TypeScript to JavaScript, but the already ready-made native Microsoft compiler to Go. Together with the architecture, the new version inherited part of the behavior of the source code.
This choice gave the project a strong base of compatibility. Now tsc-rs is tied to the build TypeScript 7.1.0-dev from October 8, passes all 184 773 transferred Go-version tests, and the language server and API coincide with it on the control sets. On 120 open projects, differences in output are limited to known problems and cases where the result of the Go compiler itself depends on the order of execution.

Microsoft released the official TypeScript 7 выпустилаin July after transferring from TypeScript/JavaScript to Go. The company announced about a tenfold acceleration relative to TypeScript 6. The move has already yielded a notable gain to major projects: Next.js 16.3 has previously switched to a new TypeScript branch, reducing compilation time and memory consumption in their scenarios.

The Rust version is still an experiment, not a replacement for the official compiler. The repository lists known discrepancies for individual monorepositories and assembly modes, and Brown himself admits that he did not study the generated code line by line. At the same time, the project shows that AI is already capable of carrying a large compiler entirely, although the real price of such an experiment is much higher than the throwing $24 thousand.
 
Top Bottom