Microsoft goes nuclear on TypeScript codebase…

00:04:08
https://www.youtube.com/watch?v=PQ2WjtaPfXU

摘要

TLDRMicrosoft is rewriting TypeScript in the Go programming language to enhance its compiler performance and optimize it for larger projects. This major change aims to address the limitations of TypeScript, which was originally written in itself, making low-level optimizations difficult. The switch to Go, known for its speed and efficient memory management, is expected to yield tenfold improvements in compile times and overall efficiency, even preserving the existing functionalities of TypeScript. The release of the new compiler correlates with TypeScript 7, which may take some time.

心得

  • 🚀 Microsoft is rewriting TypeScript for better performance.
  • 🐹 New compiler will be in Go, not C++ or Rust.
  • ⚙️ Expected to be 10x faster than current TypeScript compiler.
  • 🔄 Porting TypeScript to Go means existing functionalities remain intact.
  • ⏳ Release of the new compiler is projected alongside TypeScript 7.
  • ♻️ Go offers better memory management than TypeScript.
  • 🔥 The rewrite addresses TypeScript's performance issues.
  • 💡 Anders Hejlsberg is a key figure behind TypeScript's development.
  • 🛠️ Sentry is introduced as a useful debugging tool for developers.

时间轴

  • 00:00:00 - 00:04:08

    Microsoft has announced a major reprogramming of TypeScript, a key language in web development that has been critiqued for being self-contained and lacking optimization. This rewrite will shift the development from TypeScript to Go, a programming language designed by Google that offers more efficiencies, such as faster compile times and better performance in large projects. The decision to switch to Go is significant as it maintains the original TypeScript code semantics while improving speed and portability. This rewrite signifies a strategic move by Microsoft to enhance TypeScript capabilities, showcasing their focus on using the best tools available rather than relying solely on in-house technologies.

思维导图

视频问答

  • Why is Microsoft rewriting TypeScript?

    Microsoft aims to enhance the TypeScript compiler's performance and optimize it for building larger projects.

  • What language is TypeScript being rewritten in?

    TypeScript is being rewritten in Go.

  • What are the benefits of using Go for TypeScript's rewrite?

    Go offers better performance, portability, and automatic memory management compared to TypeScript.

  • How much faster is the new TypeScript compiler expected to be?

    The new compiler is reported to be ten times faster than the current one.

  • When will the new TypeScript compiler be available?

    The new compiler is expected to be released with TypeScript 7, which could take months or years.

  • What might the effects be for average developers?

    Average developers may experience significant performance gains in large projects using the new compiler.

  • Is the rewrite fully preserving TypeScript's functionality?

    Yes, the rewrite aims to maintain the behavior and semantics of the original code base.

  • Why didn't Microsoft choose other popular languages like Rust or C++?

    Microsoft prioritized using the best tool for the job, which in this case is Go, despite other options being available.

  • What is Sentry?

    Sentry is a tool that helps developers monitor and debug their code by providing insights into performance bottlenecks.

  • How can developers benefit from using Sentry?

    Sentry helps identify recurring issues and bottlenecks, making it easier for developers to fix problems quickly.

查看更多视频摘要

即时访问由人工智能支持的免费 YouTube 视频摘要!
字幕
en
自动滚动:
  • 00:00:00
    yesterday Microsoft dropped an
  • 00:00:01
    unexpected bombshell on programmers when
  • 00:00:03
    it announced that the Beloved typescript
  • 00:00:05
    programming language is being completely
  • 00:00:07
    reprogrammed a typescript is one of the
  • 00:00:09
    most important projects in modern web
  • 00:00:10
    development but it has one fatal flaw
  • 00:00:12
    the typescript language itself is
  • 00:00:14
    written in typescript and typescript is
  • 00:00:16
    just not optimized for building things
  • 00:00:18
    like typescript but you won't believe
  • 00:00:19
    which language Anders hilburg and
  • 00:00:21
    Microsoft chose for the rewrite it's not
  • 00:00:23
    the battle tested C++ it's not
  • 00:00:25
    Microsoft's Golden Boy C it's not the
  • 00:00:27
    highly memeable rust it's a language
  • 00:00:29
    know expected which I will reveal in
  • 00:00:31
    dramatic fashion at the end of this
  • 00:00:33
    video to optimize viewer retention for
  • 00:00:35
    the algorithm just kidding I ain't F to
  • 00:00:37
    play you like that they used go a
  • 00:00:39
    language developed by their arch nemesis
  • 00:00:40
    Google a language with a simplistic type
  • 00:00:42
    system and limited functional
  • 00:00:44
    capabilities a language that many people
  • 00:00:46
    on the internet love to hate nowadays
  • 00:00:48
    all the CP and rust Fanboys are feeling
  • 00:00:50
    the effects of this Panic function right
  • 00:00:51
    now and in today's video we'll find out
  • 00:00:53
    why this is a huge deal and answer the
  • 00:00:55
    question of why did Microsoft go with go
  • 00:00:57
    it is March 12th 2025 and your watching
  • 00:01:00
    the code report another day another bat
  • 00:01:02
    signal that must be answered but this
  • 00:01:04
    trend of waiting for the fireship video
  • 00:01:05
    on every Tech announcement has gotten
  • 00:01:07
    out of control the tech companies like
  • 00:01:08
    Microsoft spend millions of dollars
  • 00:01:10
    making these videos and you guys are
  • 00:01:11
    screwing everything up causing the
  • 00:01:13
    entire global economy to collapse I'm
  • 00:01:15
    Michael Jordan stop it get some help
  • 00:01:18
    that being said Anders hilburg is one of
  • 00:01:21
    the true 10x developer unicorns out
  • 00:01:22
    there he's the creator of Turbo Pascal C
  • 00:01:25
    and typescript and you really should
  • 00:01:27
    watch his video typescript is not your
  • 00:01:28
    typical programming language it's a
  • 00:01:30
    super set of JavaScript and doesn't
  • 00:01:32
    actually have its own runtime TS code
  • 00:01:34
    gets compiled or transpiled to JS code
  • 00:01:36
    which then runs somewhere like node.js
  • 00:01:38
    Dino bun or the browser the problem is
  • 00:01:41
    that because the typescript compiler is
  • 00:01:42
    written in typescript there's an
  • 00:01:44
    inherent lack of support for low-level
  • 00:01:46
    optimization like direct memory access
  • 00:01:48
    native multi-threading and so on the
  • 00:01:50
    only way to truly fix the typescript
  • 00:01:51
    compiler was to not write it in
  • 00:01:53
    typescript by switching to go the
  • 00:01:55
    compiler is already 10 times faster like
  • 00:01:57
    they cut the vs code compile time from
  • 00:01:59
    70 seconds to 7 seconds and they got
  • 00:02:02
    similar 10x speedups on a bunch of other
  • 00:02:04
    projects that's cool and all but the
  • 00:02:06
    average developer should also see big
  • 00:02:07
    performance gains in the editor in big
  • 00:02:09
    projects typescript can be annoyingly
  • 00:02:11
    slow in VSS code but the new compiler
  • 00:02:13
    will change that in a big way the big
  • 00:02:14
    question though is why would Microsoft
  • 00:02:16
    use go well unlike JavaScript go is a
  • 00:02:19
    compiled language and when you write go
  • 00:02:21
    code it can be compiled into optimized
  • 00:02:23
    machine code for all chips this differs
  • 00:02:25
    from Java or C which is compiled into B
  • 00:02:27
    code and then runs on a virtual machine
  • 00:02:29
    in addition go uses automatic memory
  • 00:02:31
    management via garbage collection which
  • 00:02:33
    generally makes it easier to work with
  • 00:02:35
    compared to something like C++ or rust
  • 00:02:37
    but aside from performance I think the
  • 00:02:39
    main reason they chose go is for
  • 00:02:40
    portability you see calling this a total
  • 00:02:42
    rewrite is actually not the right
  • 00:02:44
    nomenclature it's actually a port to a
  • 00:02:46
    new language what they're doing is going
  • 00:02:48
    through every line of typescript code
  • 00:02:49
    and converting it to the equivalent go
  • 00:02:51
    code which means the behavior and
  • 00:02:53
    semantics of the original code base is
  • 00:02:55
    preserved all of your favorite annoying
  • 00:02:57
    compiler errors will still happen just
  • 00:02:59
    10 times faster than before but we won't
  • 00:03:01
    be able to reap these benefits right
  • 00:03:02
    away we're currently at typescript 5.8
  • 00:03:05
    but they're not going to release the new
  • 00:03:06
    compiler until typescript 7 and it will
  • 00:03:08
    likely take many months if not years to
  • 00:03:10
    get there now even though I'm still but
  • 00:03:12
    hurt that Microsoft kicked me out of the
  • 00:03:13
    MVP program I think they deserve a lot
  • 00:03:15
    of praise for the decision to go with go
  • 00:03:17
    they could have used one of Microsoft's
  • 00:03:18
    in-house languages they could have
  • 00:03:20
    jumped on the rust or Zig hype trains
  • 00:03:22
    but instead they put their egos aside
  • 00:03:24
    and use the best tool for the job but if
  • 00:03:25
    you're building a serious project with a
  • 00:03:27
    lot of code like this one thing's for
  • 00:03:29
    sure your code will break and the best
  • 00:03:31
    way to fix it faster is with Sentry the
  • 00:03:33
    sponsor of today's video their brand new
  • 00:03:35
    Trace Explorer lets you search filter
  • 00:03:37
    and visualize your span data across
  • 00:03:39
    multiple traces in your codebase is so
  • 00:03:41
    instead of just debugging one request at
  • 00:03:43
    a time you're able to easily spot
  • 00:03:45
    recurring issues in bottlenecks then
  • 00:03:47
    drill down to the exact span that's
  • 00:03:48
    causing trouble and make a quick fix you
  • 00:03:50
    can even calculate key metrics like 95th
  • 00:03:53
    percentile latency and turn them into
  • 00:03:55
    alerts and beautiful dashboards for
  • 00:03:56
    monitoring it's the tool of choice for
  • 00:03:58
    making your code not suck and trusted by
  • 00:04:00
    4 million developers myself included
  • 00:04:02
    give Sentry a try for free today with
  • 00:04:04
    the link below this has been the code
  • 00:04:05
    report thanks for watching and I will
  • 00:04:07
    see you in the next one
标签
  • TypeScript
  • Microsoft
  • Go
  • programming language
  • compiler
  • performance
  • development
  • programmers
  • Anders Hejlsberg
  • Sentry