NextBuild

TypeScript Changed Forever - TypeScript Go!

TypeScript Changed Forever - TypeScript Go!

TypeScript Changed Forever - TypeScript Go!

Microsoft is revamping its TypeScript programming language with a native compiler and toolset. This effort seeks to address performance challenges, especially in large codebases, by porting the existing TypeScript compiler from TypeScript/JavaScript to the native language, Go.


TypeScript delivers an excellent developer experience, making your codebase more manageable as it grows. However, in large-scale projects, developers often face long load times, slow code checks, and a tough choice between fast editor startup or a complete project view.


With AI-driven tools requiring faster access to semantic data and quicker command-line builds, we're working to make TypeScript scale seamlessly—even for the biggest projects! 


Currently, tsc is written in TypeScript and runs on Node.js, requiring a JavaScript runtime to execute. But soon, the TypeScript compiler will have a native port in Go—a statically compiled language!


Key takeaways from the FAQ include:


# Go was chosen for performance reasons. The team evaluated other languages like Rust, C and C++, but found Go to be the best fit for their needs.


# Compatibility is a major concern. The team is working to ensure that the native port is as compatible as possible with existing TypeScript code and configurations.


# Why a port instead of a rewrite? The primary constraint here relates to compatibility. Something we're keenly aware of is that TypeScript exemplifies Hyrum's Law: seemingly without exception, every single optimization, behavior, design limitation, bug, or just quirk of TypeScript is (intentionally or otherwise) relied on by some project or another.


How Much Faster?


CodebaseSize (LOC)CurrentNativeSpeedup
VS Code1,505,00077.8s7.5s10.4x
Playwright356,00011.1s1.1s10.1x
TypeORM270,00017.5s1.3s13.5x
date-fns104,0006.5s 0.7s9.5x
tRPC (server + client)18,0005.5s0.6s9.1x
rxjs (observable)2,1001.1s0.1s11.0x


For Github link Click Here

  • Share:

  • Share on X