Get 3 months of Sentry’s team plan free https://bit.ly/3Fs19Oj
Let's take a first look at the new TypeScript 7 compiler, which is being completely rewritten in Google's Go language and achieves 10x faster compile times.
#programming #javascript #thecodereport
💬 Chat with Me on Discord
https://discord.gg/fireship
🔗 Resources
TypeScript Go Post https://devblogs.microsoft.com/typescript/typescript-native-port
Go in 100 Seconds https://youtu.be/446E-r0rXHI
TypeScript https://youtu.be/zQnBQ4tB3ZA
🔥 Get More Content - Upgrade to PRO
Upgrade at https://fireship.io/pro
Use code YT25 for 25% off PRO access
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- How does TypeScript work under the hood?
- TypeScript complier explained
- Why is Microsoft rewriting TypeScript in Go?
- Technology build with Go language
Let's take a first look at the new TypeScript 7 compiler, which is being completely rewritten in Google's Go language and achieves 10x faster compile times.
#programming #javascript #thecodereport
💬 Chat with Me on Discord
https://discord.gg/fireship
🔗 Resources
TypeScript Go Post https://devblogs.microsoft.com/typescript/typescript-native-port
Go in 100 Seconds https://youtu.be/446E-r0rXHI
TypeScript https://youtu.be/zQnBQ4tB3ZA
🔥 Get More Content - Upgrade to PRO
Upgrade at https://fireship.io/pro
Use code YT25 for 25% off PRO access
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- How does TypeScript work under the hood?
- TypeScript complier explained
- Why is Microsoft rewriting TypeScript in Go?
- Technology build with Go language
Category
🤖
TechTranscript
00:00Yesterday, Microsoft dropped an unexpected bombshell on programmers when it announced
00:04that the beloved TypeScript programming language is being completely reprogrammed.
00:08TypeScript is one of the most important projects in modern web development, but it has one
00:12fatal flaw.
00:13The TypeScript language itself is written in TypeScript, and TypeScript is just not
00:16optimized for building things like TypeScript.
00:19But you won't believe which language Anders Heilsberg and Microsoft chose for the rewrite.
00:23It's not the battle-tested C++.
00:25It's not Microsoft's golden boy C Sharp.
00:27It's not the highly memeable Rust.
00:29It's a language no one expected, which I will reveal in dramatic fashion at the end of this
00:33video to optimize viewer retention for the algorithm.
00:36Just kidding, I ain't finna play you like that, they used Go, a language developed by
00:40their arch-nemesis Google.
00:41A language with a simplistic type system and limited functional capabilities.
00:45A language that many people on the internet love to hate nowadays.
00:48All the C Sharp and Rust fanboys are feeling the effects of this panic function right now,
00:52and in today's video, we'll find out why this is a huge deal and answer the question of
00:56why did Microsoft go with Go?
00:57It is March 12th, 2025, and you're watching The Code Report.
01:01Another day, another bat-signal that must be answered.
01:03But this trend of waiting for the fireship video on every tech announcement has gotten
01:07out of control.
01:08Tech companies like Microsoft spend millions of dollars making these videos, and you guys
01:11are screwing everything up, causing the entire global economy to collapse.
01:15I'm Michael Jordan, stop it, get some help.
01:19That being said, Anders Heilsberg is one of the true 10x developer unicorns out there.
01:23He's the creator of Turbo Pascal, C Sharp, and TypeScript, and you really should watch
01:27his video.
01:28TypeScript is not your typical programming language.
01:30It's a superset of JavaScript, and doesn't actually have its own runtime.
01:33TS code gets compiled or transpiled to JS code, which then runs somewhere like Node.js,
01:38Deno, Bun, or the browser.
01:40The problem is that because the TypeScript compiler is written in TypeScript, there's
01:44an inherent lack of support for low-level optimization, like direct memory access, native
01:48multithreading, and so on.
01:50The only way to truly fix the TypeScript compiler was to not write it in TypeScript.
01:54By switching to Go, the compiler is already ten times faster.
01:57Like they cut the VS Code compile time from 70 seconds to 7 seconds, and they got similar
02:0210x speedups on a bunch of other projects.
02:05That's cool and all, but the average developer should also see big performance gains in the
02:08editor.
02:09In big projects, TypeScript can be annoyingly slow in VS Code, but the new compiler will
02:13change that in a big way.
02:14The big question though is why would Microsoft use Go?
02:17Well unlike JavaScript, Go is a compiled language, and when you write Go code, it can be compiled
02:22into optimized machine code for all chips.
02:24This differs from Java or C Sharp, which is compiled into bytecode and then runs on a
02:28virtual machine.
02:29In addition, Go uses automatic memory management via garbage collection, which generally makes
02:34it easier to work with compared to something like C++ or Rust.
02:37But aside from performance, I think the main reason they chose Go is for portability.
02:41You see, calling this a total rewrite is actually not the right nomenclature.
02:45It's actually a port to a new language.
02:47What they're doing is going through every line of TypeScript code and converting it
02:50to the equivalent Go code, which means the behavior and semantics of the original codebase
02:55is preserved.
02:56All of your favorite annoying compiler errors will still happen, just ten times faster than
03:00before.
03:01But we won't be able to reap these benefits right away.
03:03We're currently at TypeScript 5.8, but they're not going to release the new compiler
03:06until TypeScript 7, and it will likely take many months if not years to get there.
03:11Now even though I'm still butthurt that Microsoft kicked me out of the MVP program,
03:14I think they deserve a lot of praise for the decision to go with Go.
03:17They could have used one of Microsoft's in-house languages.
03:20They could have jumped on the Rust or ZigHype trains, but instead they put their egos aside
03:23and used the best tool for the job.
03:25But if you're building a serious project with a lot of code like this, one thing's
03:29for sure, your code will break.
03:31And the best way to fix it faster is with Sentry, the sponsor of today's video.
03:35Their brand new Trace Explorer lets you search, filter, and visualize your span data across
03:39multiple traces in your codebase.
03:41So instead of just debugging one request at a time, you're able to easily spot recurring
03:45issues and bottlenecks, then drill down to the exact span that's causing trouble and
03:49make a quick fix.
03:50You can even calculate key metrics, like 95th percentile latency, and turn them into alerts
03:55and beautiful dashboards for monitoring.
03:57It's the tool of choice for making your code not suck, and is trusted by 4 million developers,
04:01myself included.
04:02Give Sentry a try for free today with the link below.
04:05This has been the Code Report, thanks for watching, and I will see you in the next one.