Microsoft Ports TypeScript to Go with 10x Speed Boost
Microsoft on Tuesday announced a project to enhance TypeScript performance by porting its compiler and language tools to Go. The project, titled ‘Corsa’ promises a 10x speed boost for developers, along with a ‘substantial’ reduction in memory usage. Anders Hejlsberg, the lead architect of TypeScript, and a technical fellow at Microsoft, took to a blog post, and a YouTube video to announce the same. The TypeScript compiler and toolset have been ported to Go, through a direct, file-by-file and function-by-function translation from the original codebase. The decision to port the TypeScript compiler and toolset to Go was to overcome JavaScript’s (JS) performance limits. Despite TypeScript’s success over the past decade, its self-hosted JavaScript implementation struggled with issues like slow compile times, and out-of-memory errors, as indicated by Hejlsberg. “We’ve likely reached the limit of what we can squeeze out of JavaScript,” he said. Microsoft expects to be able to preview a native implementation of the TypeScript compiler, capable of command-line typechecking by mid 2025, with a feature-complete solution for project builds and a language service by the end of the year. This project showed over 10x faster compile time across several codebases. For example, compiling Visual Studio Code’s 1.5 million lines of code drops from 77.8 seconds to 7.5 seconds. “This native port will be able to provide instant, comprehensive error listings across an entire project, support more advanced refactorings, and enable deeper insights that were previously too expensive to compute,” read a section of the blog post. Source: Microsoft Microsoft also said that overall memory usage also ‘appeared to be roughly’ half of the current investigation. A few developers also questioned why Microsoft chose Go, over other programming languages like Rust. Matt Pocock, a TypeScript expert, wrote, “Far and away the most important reason was its [Go’s] structural similarity to the current JavaScript implementation. Go’s programming patterns closely resemble TypeScript’s existing code structure.” “This means that contributors familiar with the existing codebase will be able to navigate the codebase easier,” he added. TypeScript 5.8 will be updated to 5.9, and development will continue to the 6.0 series. Project Corsa will be released as TypeScript 7.0. The JS based codebase will be maintained along with the development of the new project – ‘until TypeScript 7+ reaches sufficient maturity and adoption.’ Developers are already in awe of the project. “I cannot think of a bigger impact project in software,” said a user on X. Microsoft is also inviting developers for an ‘Ask me Anything’ (AMA) session in the TypeScript community Discord channel at 10 AM PDT on March 13th.
The native implementation will drastically improve editor startup, reduce most build times by 10x, and substantially reduce memory usage.
The native implementation will drastically improve editor startup, reduce most build times by 10x, and substantially reduce memory usage.
["coding", "Microsoft", "TypeScript"]
["Go", "Rust", "programming_languages:R", "AI", "coding", "TypeScript", "ViT", "JavaScript", "R", "Java", "Microsoft", "programming_languages:JavaScript"]
["AI", "R", "JavaScript", "TypeScript", "Go", "Rust", "Java", "ViT", "programming_languages:R", "programming_languages:JavaScript"]
Supreeth is an engineering graduate who is curious about the world of artificial intelligence and loves to write stories on how it is solving problems and shaping the future of humanity.