[2025-03-11] dev, typescript
Today’s announcement by Microsoft:
[…] we’ve begun work on a native port of the TypeScript compiler and tools. The native implementation will drastically improve editor startup, reduce most build times by 10×, and substantially reduce memory usage.
This blog post looks at some of the details behind the news.
Code bases: JavaScript vs. native
To avoid confusion, I’ll use these terms:
- JavaScript code base: the current code base of TypeScript – which is actually written in TypeScript.
- Native code base: the new code base. I’m using the term “native” because that’s what the TypeScript team does. The code is written in Go.
What’s the big deal?
Type checking is the one thing that external tools can’t do:
- Emitting
.js
has already become faster – thanks to native tools and type stripping. - Emitting
.d.ts
has already become faster – thanks to native tools and isolated declarations.
Thus, type checking also becoming faster is great news.
The timeline
-
The current version of TypeScript is 5.8.
-
TypeScript 6 (JavaScript): The JavaScript code base will continue into the 6.x series, with 6.0 introducing some breaking changes to align with the native code base.
- Original code name for TypeScript: Strada
-
TypeScript 7 (native): Once the native code base has reached sufficient parity with the JavaScript code base, it’ll be released as TypeScript 7.0.
- Code name for the native code base: Corsa.
Both code bases will co-exist for a long time.
What needs to be migrated?
It’s useful to note which parts of the TypeScript ecosystem are involved in the migration:
- The command line TypeScript compiler
- The TypeScript language server (which helps editors support TypeScript)
- TypeScript predates (and inspired) the Language Server Protocol that is widely used now. The new language server will also use that protocol.
- Tools that uses the TypeScript code base
- Interfacing with the Go code bases requires a completely new approach:
- Fewer of the internals will be exposed.
- Interactions now happen across processes.
- Interfacing with the Go code bases requires a completely new approach:
When will the native version be ready for public consumption?
Rough predictions by Daniel Rosenwasser:
- Compiler without support for build mode (project references): end of 2025H1 (spring in USA)
- Compiler with build mode and language server: end of 2025.
When did the project start?
- First prototype by Anders Hejlsberg:
- Started in August 2024
- Scanner and parser took 1–1.5 months to write.
- Initial approach: write code manually.
- Later: tool that automatically ports TypeScript code to Go code.
- Porting the code worked well (wit