The TypeScript team has tried several times to rewrite the original JavaScript engine in a different programming language, but so far these attempts have not produced the desired results. Recently, however, they announced a breakthrough by rewriting it in Go.
The rewrite was long needed because JavaScript cannot natively support multithreading, so TypeScript could not take full advantage of modern processors. The main goal of the rewrite was to increase efficiency. The results so far show that some functions are ten times, and in some cases even fifteen times, faster. These functions include loading in various IDEs, type checking, error checking, and code generation. These improvements help shorten the development cycle, work more efficiently, and bring products to market faster.
Choosing the language best suited to the task also contributed to the success of the rewrite. Several languages could have supported native parallelization; for example, the use of Rust was considered. In fact, the team was criticized for not choosing Rust. The team agreed that rewriting in Rust could also have been efficient, but Go’s structure is very similar to TypeScript’s, which made the rewrite easier. In contrast, using Rust could have caused difficulties.
The new version is still in development. However, a beta version is expected to be available sometime in the second half of the year, and the final version is planned for release with TypeScript 7.0. Development work will continue, as the rewrite is not yet complete and work on the JavaScript engine will go on for a while. However, users will not need to take any special preparations for the switch.