TypeScript Announces Rewrite in Go
TypeScript is being rewritten in Go, offering up to 10x faster performance. It’s a drop-in replacement, launching with TypeScript 7. No code changes required!
The TypeScript team announced today a complete rewrite of TypeScript in Go. The new implementation already supports processing some popular projects and delivers approximately 10 times better performance. This change will impact all developers, from running tsc
to experiencing faster reporting in IDEs.
The Speed Boost
As stated in the announcement, several well-known projects have already been tested with the new native version, showing a significant improvement in speed (or a reduction in build time):
- VS Code: 77.8s to 7.5s (10.4x faster)
- Playwright: 11.1s to 1.1s (10.1x faster)
- TypeORM: 17.5s to 1.3s (13.5x faster)
- date-fns: 6.5s to 0.7s (9.5x faster)
- tRPC (server + client): 5.5s to 0.6s (9.1x faster)
- rxjs (observable): 1.1s to 0.1s (11.0x faster)
Although it is not fully ready yet, the results are already impressive.
An AMA session will be held on the TypeScript Community Discord on Thursday, March 12th.
The Transition
The best part? No changes to your codebase are required. The native implementation is designed as a drop-in replacement. The plan is to release it as TypeScript 7 (native), while the TypeScript 6.x (JS) line will continue to be supported until version 7.x reaches a stable level of maturity and adoption.
You can try it already by visiting the microsoft/typescript-go repository an following the setup instructions.
Status of The Current Version
When major rewrites happen, the older version of a project often gets neglected. However, the TypeScript team has assured that both the JavaScript and native versions will be maintained as closely as possible. This means that if you need to stick with TypeScript 6, you won't be left behind.
Why Go Instead of Rust?
A common question after hearing about the rewrite is, "Why not Rust?" The TypeScript team addressed this in a GitHub discussion. There's also an active thread on Reddit debating the decision.
In short, the choice was not about rejecting Rust. Go simply turned out to be a better fit for the project.
Personally, I prefer Go over Rust - it’s just a matter of preference.