Microsoft goes nuclear on TypeScript codebase…
Summary
TLDRIn a surprising move, Microsoft announced that it will be rewriting the TypeScript language using Go instead of traditional options like C++ or Rust. TypeScript, which is integral to modern web development, has been plagued by performance issues due to its compiler being written in TypeScript itself. By switching to Go, Microsoft aims to improve speed and optimize memory management, resulting in a 10x faster compiler. This shift is seen as a strategic decision for better portability and performance, despite initial concerns about breaking changes and the lengthy timeline until release. The move has sparked mixed reactions within the developer community.
Takeaways
- 😀 Microsoft announced a major decision to rewrite TypeScript in Go, a surprising move considering the language's origins in TypeScript itself.
- 😀 TypeScript's compiler, which was originally written in TypeScript, lacked low-level optimizations such as native multi-threading and direct memory access.
- 😀 The move to Go will make TypeScript's compiler significantly faster, with compile times in VS Code dropping from 70 seconds to 7 seconds in tests.
- 😀 Go, developed by Google, was chosen over C++, Rust, or other languages due to its performance and portability advantages.
- 😀 The decision to switch to Go is also driven by the need for better portability across machine architectures, as Go can be compiled into optimized machine code.
- 😀 The rewrite is more of a port than a complete overhaul, preserving TypeScript's core behavior and semantics while enhancing performance.
- 😀 Although the rewrite won’t be available until TypeScript 7, the improvements will be felt across big projects and the developer community at large.
- 😀 TypeScript 5.8 is the current version, and the new compiler will take months or even years before it reaches the public in full.
- 😀 Anders Hejlsberg, the creator of TypeScript, is praised for choosing the best tool for the job, setting aside any bias towards Microsoft’s own languages.
- 😀 The transition to Go ensures that TypeScript will run faster and be more efficient for developers working on large, complex projects.
Q & A
Why did Microsoft announce a rewrite of TypeScript?
-Microsoft announced the rewrite of TypeScript because the TypeScript compiler was written in TypeScript itself, which created inefficiencies in performance. It lacked support for low-level optimization, such as direct memory access and native multi-threading, making the compiler slower and less efficient.
Which language did Microsoft choose to rewrite TypeScript, and why?
-Microsoft chose Go for the rewrite of TypeScript. Despite Go being developed by their arch-nemesis Google, it offers several benefits, such as being a compiled language that produces optimized machine code, automatic memory management, and portability across various platforms.
How does Go differ from languages like Java and C++?
-Go is a compiled language that generates machine code for direct execution on all chips, unlike Java and C, which are compiled into bytecode and require a virtual machine to run. This gives Go an edge in performance, especially for tasks like rewriting a large compiler.
What is the impact of Go's memory management on the TypeScript rewrite?
-Go uses automatic memory management through garbage collection, which simplifies development compared to C++ or Rust. This allows the developers to focus on the functionality of the TypeScript compiler without worrying about manual memory handling.
What performance improvements can developers expect from the new TypeScript compiler?
-The new TypeScript compiler, written in Go, is expected to be significantly faster. For example, it reduced the VS Code compile time from 70 seconds to just 7 seconds. Similar 10x speedups are expected across other TypeScript-related projects.
Why is Go considered more portable than other programming languages?
-Go is highly portable because it can be compiled into optimized machine code that runs on various chips and platforms. Unlike other languages like Java, which runs on a virtual machine, Go offers a more direct and efficient approach to cross-platform compatibility.
What is the process Microsoft is using to rewrite TypeScript in Go?
-Microsoft is porting TypeScript to Go, meaning they are converting each line of TypeScript code into its equivalent in Go. This ensures that the original behavior and semantics of TypeScript are preserved while making the compiler more efficient.
Will the new Go-based TypeScript compiler be available immediately?
-No, the new Go-based TypeScript compiler will not be available immediately. The rewrite will be implemented over several versions, with the new compiler expected to be released in TypeScript 7, which may take months or even years to fully complete.
Why did Microsoft choose Go over other languages like Rust or Zig?
-Microsoft chose Go over languages like Rust or Zig because Go was the best tool for the job in terms of performance, portability, and ease of development. Microsoft could have used an in-house language or jumped on the Rust or Zig hype, but they prioritized the most practical solution for optimizing the TypeScript compiler.
What is the significance of Anders Hejlsberg in the development of TypeScript?
-Anders Hejlsberg is a key figure in the development of TypeScript. He is also the creator of Turbo Pascal and C, making him a highly influential developer. His work on TypeScript has made it one of the most important tools in modern web development.
Outlines

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.
Améliorer maintenantMindmap

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.
Améliorer maintenantKeywords

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.
Améliorer maintenantHighlights

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.
Améliorer maintenantTranscripts

Cette section est réservée aux utilisateurs payants. Améliorez votre compte pour accéder à cette section.
Améliorer maintenantVoir Plus de Vidéos Connexes

How Much Memory for 1,000,000 Threads in 7 Languages | Go, Rust, C#, Elixir, Java, Node, Python

#06 What is TypeScript | Getting Started with Angular | A Complete Angular Course

Go is officially cooked

A 10x faster TypeScript

What is EUPHEMISM? | Learn with Examples

Best Programming Language | John Carmack and Lex Fridman
5.0 / 5 (0 votes)