TypeScript 6.0 Released Ahead of Go Rewrite
The TypeScript team has released version 6.0 of the language. Developers are being encouraged to upgrade in preparation for a planned future rewrite of the TypeScript compiler in the Go programming language, which is expected to enhance performance and tooling.
- The Go rewrite, internally codenamed "Project Corsa," has demonstrated up to a 10x speedup in compilation times in tests on large repositories like VS Code, with some seeing up to 15x improvements. This performance boost impacts not just command-line builds but also IDE operations like autocompletion, error reporting, and go-to-definition. - TypeScript's lead architect, Anders Hejlsberg, explained that Go was chosen over languages like Rust primarily because its structure and coding patterns closely resemble the existing TypeScript codebase, making it a more direct "port" rather than a ground-up rewrite. The team's goal was to preserve the compiler's existing architecture and logic, and the presence of automatic garbage collection in Go was a key factor that ruled out Rust. - While transpilation tools like esbuild (written in Go) and SWC (written in Rust) have offered faster alternatives to TypeScript's compiler (`tsc`) for years, they do not perform type-checking, which has remained a performance bottleneck. The Go rewrite aims to accelerate the type-checking process itself, which is often the slowest part of development workflows in large-scale projects. - TypeScript 6.0 serves as a transitional release, focusing on standardization and eliminating technical debt ahead of the rewrite. It changes several compiler defaults to align with modern practices, such as enabling `strict` mode, setting the module target to `esnext`, and deprecating outdated targets like `es5` and module systems like AMD and UMD. - This release also adds support for new and upcoming JavaScript features, including built-in types for the Stage 3 Temporal API—a modern replacement for the `Date` object—and support for the Stage 4 `RegExp.escape` proposal. - The new, faster compiler is slated for release with TypeScript 7.0. The current 6.x series will continue to receive updates to prepare the ecosystem for the eventual switch, and deprecation warnings in 6.0 are meant to guide developers in making their projects compatible with version 7.0.