Microsoft Rewrites TypeScript Compiler in Go: Why and What It Means
Microsoft announced that it will rewrite the TypeScript compiler in Go, citing native code compilation, automatic memory management, simplicity, portability, and strong concurrency support, promising up to ten‑fold performance gains, faster editor feedback, new features, and a roadmap extending to a Go‑based TypeScript 7 release.
Microsoft announced that it will rewrite the TypeScript compiler in Go, a surprising move given the language’s origins at Google.
Announcement and Its Significance
On February 28, 2025, Anders Hejlsberg, the creator of TypeScript, revealed a "native port" of the compiler and tooling.
This is not a minor update but a fundamental re‑imagining of TypeScript’s internals, aiming for dramatic performance improvements.
The current compiler is written in TypeScript itself, which, while elegant, imposes inherent limitations.
“TypeScript has struggled with large codebases, forcing developers to choose between reasonable editor startup times and a complete source‑code view.”
Why Go? Technical Reasons
Microsoft could have chosen C++, C#, or the increasingly popular Rust, but opted for Go, a language developed by its long‑time competitor Google.
This decision reflects a focus on the best tool for the job rather than corporate rivalry.
Go offers several advantages for this task:
Native code compilation : Go can compile directly to optimized machine code for various chipsets, avoiding bytecode and VM overhead.
Automatic memory management : Its garbage collector provides memory safety without the manual management required by C++ or the complex ownership model of Rust.
Simplicity and portability : Go’s concise syntax and strong cross‑platform support make it ideal for consistent operation across environments.
Concurrency support : Goroutines and channels give native support for parallelizing compilation tasks.
Importantly, Microsoft is not performing a complete rewrite but porting the existing TypeScript codebase to Go, preserving compiler behavior while gaining significant performance gains.
Performance Data Is Impressive
Microsoft released early benchmark results showing substantial speedups across project sizes.
For VS Code, compile time dropped from nearly 78 seconds to 7.5 seconds.
Performance gains extend beyond compile speed:
Editor load time : Loading the entire VS Code codebase fell from 9.6 seconds to about 1.2 seconds, an eight‑fold improvement.
Memory usage : Reported memory consumption is roughly half of the current implementation, with further optimization potential.
What This Means for Developers
The impact of these performance improvements is far‑reaching:
1. Faster Feedback Loop
With build times reduced tenfold, developers receive code‑change feedback almost instantly, eliminating long waits.
2. Better Editor Experience
Faster language services translate to more responsive code completion, navigation, and smoother refactoring.
3. New Features Enabled
As Anders noted, previously “out‑of‑reach” capabilities become attainable, including:
Instant, comprehensive error listings across projects.
Support for more advanced refactoring.
Deeper semantic analysis that was previously too costly.
4. AI‑Driven Development
The performance boost opens the door for more sophisticated AI‑assisted development tools that can analyze large codebases in depth.
Future Roadmap
While excitement is high, developers must be patient. TypeScript 5.8 is current; 5.9 is imminent. JavaScript‑based implementations will continue through the 6.x series, with the Go‑based native implementation slated for TypeScript 7.0.
Microsoft’s version strategy:
TypeScript 6 (JS) : Ongoing maintenance of the JavaScript implementation.
TypeScript 7 (Native) : Full‑feature Go‑based implementation, functionally equivalent.
Timeline:
Mid‑2025 : Preview of the native implementation with command‑line type checking.
End of 2025 : Complete solution for project builds and language services.
Bold Moves for the Future
Microsoft’s choice to rewrite TypeScript in Go represents a major investment in the language’s future and the broader JavaScript ecosystem, prioritizing developer experience over corporate allegiance.
“They could have used Microsoft’s own language or jumped on the Rust/Zig hype, but they set aside ego and chose the tool best suited for the job.”
This move underscores Microsoft’s mature stance under Satya Nadella: a willingness to embrace competing technologies when they deliver the best solutions.
For TypeScript users, the future looks bright: a faster, more responsive, and more powerful language that will underpin the next generation of web applications and development tools.
The TypeScript team will host an AMA on the TypeScript community Discord on March 13, offering developers a chance to learn more about this exciting plan.
Code Mala Tang
Read source code together, write articles together, and enjoy spicy hot pot together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.