TypeScript just changed forever

00:20:02
https://www.youtube.com/watch?v=3-W95H5_lX0

概要

TLDRToday, Microsoft announced a remarkable native port of the TypeScript type checker, promising around 10x speed improvements and better scalability for large codebases. This shift from TypeScript to Go aims to simplify syntax and enhance concurrency in type checking. The implementation addresses long-held performance issues while still supporting the core TypeScript functionalities. While JSX is not yet supported, the team plans previews by mid-2025, ultimately aligning TypeScript across platforms and improving developer experiences significantly. This change positions TypeScript well in the evolving landscape of development tools, particularly with increased relevance of AI integration.

収穫

  • 🚀 Microsoft revealed a native port of TypeScript's type checker.
  • ⚡ 10x speed improvement over the previous version.
  • 🛠️ Go was chosen for its simpler syntax and concurrency benefits.
  • 📅 Preview expected by mid-2025.
  • 👨‍💻 Enhanced developer experience for large codebases.
  • 🔍 Improved editor performance with the new type checker.
  • 📊 Real-world tests showed significant performance gains.
  • ⚖️ JSX support is not ready yet.
  • 🤖 AI tools can benefit from quicker type checking.
  • 📈 Long-term goal is to integrate TypeScript more seamlessly across platforms.

タイムライン

  • 00:00:00 - 00:05:00

    Today marks a significant development in web development with Microsoft's announcement of a native port for the TypeScript type checker. This project promises to bring substantial improvements to the TypeScript ecosystem, being around 10 times faster than the current system. This port is more than just a compiler; it includes the type checker essential for verifying type accuracy in codebases. The speaker expresses excitement and anticipates sharing insights about this project and its implications for developers.

  • 00:05:00 - 00:10:00

    Convex is introduced as a solution for backend development tailored to React applications, addressing the complexities of API management. The sponsor explanation highlights how Convex simplifies backend operations, making it easier for developers to focus on building efficient applications without the typical challenges associated with backend integration. This offers a type-safe and synchronized backend experience, making reactive development far more efficient and user-friendly compared to traditional methods.

  • 00:10:00 - 00:15:00

    The performance benefits of the new TypeScript implementation are showcased through a comparison of compilation times on large codebases, significantly reducing total time from minutes to seconds. The transition to Go for the type checker is discussed in detail, indicating how this decision serves to enhance performance and IDE integration while maintaining TypeScript's core principles. The implementation promises improvements across various development environments due to the adherence to established protocols for language server interactions.

  • 00:15:00 - 00:20:02

    The conversation concludes with a discussion on future developments and the role of TypeScript in managing large-scale applications. It highlights the importance of focusing on developer experience, scaling solutions for vast codebases, and the evolution of development tools. The anticipation for the full release of a native implementation in 2025 sets a forward-looking tone, reinforcing TypeScript's commitment to improving developer lifecycle and integrating advanced features into existing systems.

もっと見る

マインドマップ

ビデオQ&A

  • What was announced by Microsoft today regarding TypeScript?

    Microsoft announced a native port of the TypeScript type checker.

  • How much faster is the new TypeScript type checker?

    It is around 10x faster than the previous version.

  • Why did Microsoft choose Go over Rust for the TypeScript type checker?

    Go was chosen for its simpler syntax, better concurrency support, and overall performance benefits for the type-checking process.

  • When is the preview release expected for the TypeScript Go implementation?

    A preview release is expected by mid-2025.

  • What major advantage does the new implementation offer for developers?

    It significantly improves developer experience, especially for large codebases.

  • Is the JSX syntax currently supported in the new TypeScript implementation?

    No, JSX syntax support is not ready yet.

  • How has the performance changed in real-world tests?

    In tests, performance improved from 77 seconds to 7.5 seconds for compilation on large codebases.

  • Does this project also improve editor performance?

    Yes, it enhances IDE performance as it utilizes the new type checker.

  • What is a key benefit of the new TypeScript implementation for AI tools?

    The improved performance allows AI tools to check types and make code changes more efficiently.

  • What is the long-term goal for TypeScript following this update?

    To align the TypeScript in JavaScript version with the Go version and ensure scalability for large applications.

ビデオをもっと見る

AIを活用したYouTubeの無料動画要約に即アクセス!
字幕
en
オートスクロール:
  • 00:00:00
    today's a massive day in the world of
  • 00:00:01
    web development the title is not
  • 00:00:03
    clickbait at all it's so real that I
  • 00:00:05
    woke up at 7:00 a.m. today just to make
  • 00:00:07
    this happen and if you know my sleep
  • 00:00:08
    schedule you know how absurd that is
  • 00:00:11
    today Microsoft announced something I
  • 00:00:12
    never thought I would see a native Port
  • 00:00:15
    of the typescript type Checker and to be
  • 00:00:17
    clear this isn't just the compiler it's
  • 00:00:18
    not just the part that converts your
  • 00:00:19
    typescript to JS we've seen that done in
  • 00:00:21
    other languages before this is the type
  • 00:00:23
    Checker the thing that makes sure each
  • 00:00:25
    type in your code base is accurate and
  • 00:00:26
    correct that has historically been
  • 00:00:28
    nearly impossible to do in other
  • 00:00:30
    languages I went as far as to say it is
  • 00:00:32
    impossible I've been proven wrong this
  • 00:00:34
    is an incredible project I'm lucky
  • 00:00:36
    enough the typescript team reached out
  • 00:00:38
    to me early to take a look and I am so
  • 00:00:40
    excited to share all the things I've
  • 00:00:41
    learned about this project typescript go
  • 00:00:44
    is a massive change for the entire
  • 00:00:45
    typescript ecosystem and you definitely
  • 00:00:47
    want to know everything you can about
  • 00:00:49
    this if you're curious about how much
  • 00:00:50
    faster it is it's around 10x faster and
  • 00:00:52
    if you're curious why they didn't use
  • 00:00:53
    rust you're going to have to wait till
  • 00:00:54
    after the sponsor I think it's fair to
  • 00:00:56
    say that react made it way way easier to
  • 00:00:58
    build apps well half of them at least
  • 00:01:00
    you know the front end half it doesn't
  • 00:01:02
    help a whole lot with the API side we've
  • 00:01:04
    tried to solve it with stuff like you
  • 00:01:05
    know graphql but let's be real that
  • 00:01:08
    hasn't helped a whole lot that level of
  • 00:01:10
    abstraction does not make your code
  • 00:01:12
    better it actually makes it a lot worse
  • 00:01:14
    we've also seen people try to make these
  • 00:01:15
    fancy uis where you can check boxes to
  • 00:01:17
    generate an API that's even worse let's
  • 00:01:21
    let's take ourselves seriously for a
  • 00:01:23
    second we want to make things easier we
  • 00:01:24
    need to really rethink what the back end
  • 00:01:26
    looks like and that's what today's
  • 00:01:28
    sponsor convex is here to do they call
  • 00:01:29
    call themselves The Missing half of your
  • 00:01:31
    react app and honestly I agree it's the
  • 00:01:33
    first backend solution I felt really
  • 00:01:35
    understands react and makes it easier to
  • 00:01:37
    make reactive applications even
  • 00:01:39
    something like a to-do list can actually
  • 00:01:40
    be a lot easier I know it seems like the
  • 00:01:42
    simplest thing ever go add the backend
  • 00:01:44
    to it and make sure it handles when
  • 00:01:46
    something's checked in one place and not
  • 00:01:47
    in another with proper updates it's not
  • 00:01:50
    as easy as it might seem unless you're
  • 00:01:52
    using convex then it's literally just
  • 00:01:54
    one line of code here to set this to
  • 00:01:57
    true or false and this set complete
  • 00:01:59
    function that you define in your convex
  • 00:02:01
    folder is actual code in your code base
  • 00:02:04
    that you can import on the client that
  • 00:02:05
    does what you expect it to do fully type
  • 00:02:07
    safe back to front with Live Sync by the
  • 00:02:10
    way do you know how hard it is to get
  • 00:02:11
    live syncing for stuff like this working
  • 00:02:14
    not fun don't deal with it if you don't
  • 00:02:16
    have to literally just count to-dos is
  • 00:02:18
    usequery api. too. list looks just like
  • 00:02:21
    trpc but the whole back end is already
  • 00:02:24
    built normally you'd have to worry about
  • 00:02:25
    lockin but not with convex it's fully
  • 00:02:27
    open source and they just put out a
  • 00:02:29
    bunch of guides to selfhosted too if
  • 00:02:30
    you're tired of figure out all the
  • 00:02:32
    pieces of your backend from off to file
  • 00:02:34
    hosting to databases to server functions
  • 00:02:36
    to websockets to live updates convex is
  • 00:02:39
    the easiest cheapest fastest way to get
  • 00:02:42
    going and not have to worry about that
  • 00:02:44
    if you want to build a great UI for your
  • 00:02:45
    users stop worrying about all that stuff
  • 00:02:47
    try out convex and you'll be moving
  • 00:02:49
    faster than ever check them out today at
  • 00:02:50
    so. l/c convex I love that Anders is the
  • 00:02:53
    one who wrote this he also did a cute
  • 00:02:55
    YouTube video there will be little clips
  • 00:02:56
    and moments from this shared throughout
  • 00:02:58
    but when you're done watching this I'd
  • 00:02:59
    highly recommend watching and's video
  • 00:03:00
    it's really good the core value
  • 00:03:02
    proposition of typescript is an
  • 00:03:03
    excellent developer experience as your
  • 00:03:04
    codebase grows so does the value of TS
  • 00:03:06
    itself but in many cases typescript has
  • 00:03:08
    not been able to scale up to the very
  • 00:03:09
    largest code bases I I read an early
  • 00:03:12
    copy of this blog post and the
  • 00:03:13
    formatting is so much better it gave a
  • 00:03:14
    bit of feedback and it's cool that see
  • 00:03:15
    it all integrated the thing we actually
  • 00:03:17
    care about here though is this guy
  • 00:03:19
    testing on the vs code code base they
  • 00:03:21
    saw a performance change from 77 seconds
  • 00:03:23
    for a compilation down to 7.5 seconds on
  • 00:03:26
    a codas like playright it went from 11
  • 00:03:28
    seconds down to 1. 1 second I also love
  • 00:03:31
    the trpc shout out here that the trpc
  • 00:03:33
    client is 9.1 X faster if you've used
  • 00:03:36
    big code bases with trpc you know how
  • 00:03:38
    much a game changer this is going to be
  • 00:03:39
    I'm so excited they do call out that
  • 00:03:41
    this isn't feature complete but that
  • 00:03:42
    doesn't mean you can't run it on real
  • 00:03:44
    code right now they haven't distributed
  • 00:03:46
    a binary but I already set up go so I
  • 00:03:48
    could compile it locally and show you
  • 00:03:49
    just how powerful it is this doesn't
  • 00:03:51
    just affect your build and type check
  • 00:03:53
    times either this helps your editor
  • 00:03:54
    performance a ton your IDE actually uses
  • 00:03:57
    TSC when you're doing all the intell
  • 00:03:59
    ense stuff when you hover over something
  • 00:04:00
    to see what type it is that is using TSC
  • 00:04:03
    under the hood in order to know what
  • 00:04:04
    your types are it's also the reason you
  • 00:04:06
    can edit your code without having to
  • 00:04:07
    save and still see the types that have
  • 00:04:09
    changed and what might be right or wrong
  • 00:04:11
    in your code that is not an easy thing
  • 00:04:13
    to do much less run performant they've
  • 00:04:15
    already gotten this working in vs code
  • 00:04:17
    and there's one other really nice detail
  • 00:04:19
    here where they are moving to a
  • 00:04:21
    traditional LSP LSP is language server
  • 00:04:24
    protocol it's the concept that VSS code
  • 00:04:26
    built in order to make it easier to
  • 00:04:27
    integrate other programming languages
  • 00:04:29
    with a protocol to track what those
  • 00:04:31
    languages are giving for feedback to the
  • 00:04:33
    editor typescript was invented before
  • 00:04:35
    the LSP was so typescripts kind of built
  • 00:04:38
    into VSS code now they're going to treat
  • 00:04:40
    typescript more traditionally the way
  • 00:04:42
    every other language is no more special
  • 00:04:43
    treatment the LSP is the standard way to
  • 00:04:46
    do things and it also means all the
  • 00:04:48
    benefits to this rework are going to be
  • 00:04:49
    seen in other editors as well so you
  • 00:04:51
    neoven people you should be pretty hyped
  • 00:04:53
    the first test I tried to run was the
  • 00:04:55
    typescript code base calling uh TSC with
  • 00:04:57
    the Diagnostics call so we can see what
  • 00:04:59
    it thinks the reported time is and we
  • 00:05:00
    can run it ourselves as well right after
  • 00:05:02
    as we see here it ran in about 60
  • 00:05:04
    seconds of like user facing time 40
  • 00:05:08
    seconds proper total wall clock time if
  • 00:05:11
    we compare this to the new stuff though
  • 00:05:13
    we get an error but despite getting the
  • 00:05:15
    error we actually blast through this in
  • 00:05:17
    1.56 seconds of user time so that was
  • 00:05:20
    instant for me this felt like 60 seconds
  • 00:05:23
    this felt like two it's pretty nuts
  • 00:05:25
    sadly I have not been able to get
  • 00:05:27
    playright compiling without a bunch of
  • 00:05:28
    type errors when we run it through the
  • 00:05:30
    official TSC it takes about 4
  • 00:05:32
    seconds the new version takes .5 seconds
  • 00:05:36
    that's insane this one has a few more
  • 00:05:38
    type errors but not a lot more when you
  • 00:05:40
    consider that it's a raw Port it found
  • 00:05:41
    213 instead of 190 that's nuts it's
  • 00:05:45
    actually really close is it sad that I
  • 00:05:47
    can't Repro the exact test they showed
  • 00:05:48
    there yeah but the fact that I can run
  • 00:05:51
    it at all is nuts in and of itself and
  • 00:05:53
    these numbers have panned out from
  • 00:05:55
    everything I've seen so far it does
  • 00:05:57
    pretty consistently hit a 10x
  • 00:05:59
    performance WI in order to get
  • 00:06:00
    performance differences like this there
  • 00:06:01
    must be some crazy stuff going on on the
  • 00:06:03
    rewrite right like they must have
  • 00:06:04
    entirely Rewritten and rethought all the
  • 00:06:06
    logic no it's actually a big part of why
  • 00:06:09
    they chose go if we look at the Checker
  • 00:06:11
    code here and by the way Checker is the
  • 00:06:13
    main typescript file that defines
  • 00:06:15
    everything for the typescript Checker
  • 00:06:16
    which obviously is written in typescript
  • 00:06:17
    this is a 50,000 plus line of code file
  • 00:06:20
    I'm just going to pick this particular
  • 00:06:21
    function because I think it's a good
  • 00:06:22
    example get type of symbol it's a very
  • 00:06:25
    commonly called function that's used to
  • 00:06:27
    determine with a given symbol in the
  • 00:06:29
    what should that be this function looks
  • 00:06:32
    like this relatively simple and readable
  • 00:06:35
    let's compare it to the same function in
  • 00:06:37
    go
  • 00:06:38
    huh you might notice something here
  • 00:06:42
    these are basically identical the
  • 00:06:44
    typescript team went out of their way to
  • 00:06:47
    find the language that would allow them
  • 00:06:49
    the best performance on Native platforms
  • 00:06:51
    with concurrency and parallelism without
  • 00:06:53
    having to meaningfully change the way
  • 00:06:56
    the language is written most of the code
  • 00:06:58
    for this initial verse
  • 00:07:00
    was processed and transformed overa a
  • 00:07:02
    script they wrote a script to Port the
  • 00:07:05
    typescript code over to go obviously it
  • 00:07:07
    was far from perfect it got the syntax
  • 00:07:09
    right so it would compile but it didn't
  • 00:07:11
    get the behaviors quite right so they've
  • 00:07:12
    had to massage it a ton since they've
  • 00:07:14
    done it though but as a result here it's
  • 00:07:18
    relatively easy for a Dev who's been
  • 00:07:19
    working on the typescript code base for
  • 00:07:20
    a while to come over and make these
  • 00:07:23
    changes not to say that any random one
  • 00:07:25
    of us even I could do this like no the
  • 00:07:28
    work on the typescript compiler in the
  • 00:07:29
    typescript version is insanely difficult
  • 00:07:32
    and the things they did to make that
  • 00:07:33
    perform and to their knowledge of the
  • 00:07:35
    JavaScript VM and all the hacks they
  • 00:07:37
    made to make that work are unbelievable
  • 00:07:39
    but they did it and the performance they
  • 00:07:42
    got out of the typescript version in and
  • 00:07:43
    of itself was pretty nuts but a raw Port
  • 00:07:46
    over with no changes made to optimize
  • 00:07:48
    performance has already seen a massive
  • 00:07:51
    win and I have to point this out if you
  • 00:07:53
    go to that Checker TS file on GitHub it
  • 00:07:55
    won't render it cuz the file is too big
  • 00:07:57
    it's 3 megabytes of just one typescript
  • 00:08:00
    file that's why I had it in my editor
  • 00:08:02
    it's time to talk about the question
  • 00:08:03
    everyone is asking everywhere why not
  • 00:08:06
    rust I'm going to quote myself first and
  • 00:08:08
    foremost here go is probably the right
  • 00:08:10
    language for most JavaScript build and
  • 00:08:12
    Dev tooling I said this back in February
  • 00:08:14
    of last year over a year ago aged pretty
  • 00:08:17
    well if I say so myself why though I'll
  • 00:08:20
    be honest I've tempted to make this its
  • 00:08:21
    own whole video so I'm going to give you
  • 00:08:23
    the overview here and if you guys want
  • 00:08:25
    more info on this we'll break it down
  • 00:08:27
    more in depth later first main point is
  • 00:08:29
    obviously simpler syntax that's more
  • 00:08:33
    like JS we saw that with the example I
  • 00:08:35
    just gave another probably much more
  • 00:08:37
    important piece is more flexible
  • 00:08:40
    structures and type system one of the
  • 00:08:43
    reasons that typescript was really hard
  • 00:08:45
    to write in a language that wasn't
  • 00:08:46
    js-based is because JS itself is so
  • 00:08:49
    flexible you can just kind of add
  • 00:08:50
    properties to anything at any point if
  • 00:08:52
    you have an object you can just add
  • 00:08:53
    another key and it will handle it
  • 00:08:55
    because of that the type checking step
  • 00:08:57
    has to have similar flexibility so if
  • 00:08:58
    your tooling is prepared for that good
  • 00:09:00
    luck have fun but there's another really
  • 00:09:03
    big piece concurrency
  • 00:09:06
    parallelism JavaScript is a
  • 00:09:08
    single-threaded language people like to
  • 00:09:10
    point at that as the reason typescript
  • 00:09:11
    and JavaScript are so slow they actually
  • 00:09:13
    tend to be fast for a lot of application
  • 00:09:16
    code though the magic of V8 which is the
  • 00:09:18
    main JavaScript runtime is that that
  • 00:09:19
    thread can perform incredibly well due
  • 00:09:21
    to the event Loop when something is
  • 00:09:23
    blocked on iO or other background
  • 00:09:26
    processes be it you're waiting for a
  • 00:09:27
    database call or you're waiting for for
  • 00:09:29
    some file to load you can do other
  • 00:09:31
    things in the process so the user can
  • 00:09:33
    type and get a response immediately
  • 00:09:35
    while you're waiting for other things in
  • 00:09:36
    the background but it cannot do multiple
  • 00:09:39
    things at once this is fine for stuff
  • 00:09:42
    like web servers because a web server is
  • 00:09:44
    mostly waiting for random things to
  • 00:09:46
    happen and it can process requests and
  • 00:09:48
    responses very quick that's why node's
  • 00:09:50
    actually a pretty good backend language
  • 00:09:51
    what it is not good at is workloads that
  • 00:09:54
    benefit greatly from multi-threading
  • 00:09:56
    like you know compiling and don't take
  • 00:09:58
    my word for it this is Andrew halberg
  • 00:10:01
    lead architect of the typescript project
  • 00:10:03
    you know the JavaScript runtime platform
  • 00:10:06
    is really optimized for UI and browser
  • 00:10:09
    usage and not so much for compute
  • 00:10:11
    intensive workloads like compilers and
  • 00:10:14
    system level tools and we've likely
  • 00:10:16
    reached the limit of what we can squeeze
  • 00:10:18
    out of uh out of JavaScript as much as I
  • 00:10:21
    like to crap on go and believe me I am
  • 00:10:23
    not a fan of goang I hated writing it so
  • 00:10:25
    much that I accidentally became a front
  • 00:10:26
    inev so I could avoid it at twitch it is
  • 00:10:28
    really good for this because it has
  • 00:10:30
    parallelism built in as like a language
  • 00:10:33
    primitive any function can defer at any
  • 00:10:35
    point it's very easy to split things up
  • 00:10:37
    and share memory across them you can do
  • 00:10:39
    web workers in JavaScript but those
  • 00:10:41
    workers can't share memory they have to
  • 00:10:43
    pass things over an event bus as Json
  • 00:10:46
    and the serializing and deserializing of
  • 00:10:47
    that Json makes the performance
  • 00:10:49
    characteristics worse than if they just
  • 00:10:51
    did it single-threaded so the biggest
  • 00:10:53
    win apparently greater than 50% of the
  • 00:10:56
    perf win comes from the ability to run
  • 00:10:58
    this parallel type checking in parallel
  • 00:11:01
    isn't as trivial as it sounds by the way
  • 00:11:03
    because any one file in your system that
  • 00:11:05
    you're type checking could be referenced
  • 00:11:07
    in lots of other places so the
  • 00:11:09
    parallelism is actually doing a ton of
  • 00:11:10
    redundant work where any set of threads
  • 00:11:12
    might be checking the same files even if
  • 00:11:14
    they started somewhere different this
  • 00:11:16
    ends up working out okay though because
  • 00:11:18
    they can dup the errors once they
  • 00:11:19
    collect them all at the end and only
  • 00:11:21
    show you the ones that are unique so if
  • 00:11:23
    it checks the same file 15 times on
  • 00:11:25
    different threads you'll still only get
  • 00:11:26
    one error and since it's so much faster
  • 00:11:28
    it ends up being better regardless the
  • 00:11:31
    one cost there is memory usage and
  • 00:11:33
    memory is higher than if they didn't
  • 00:11:35
    recheck things but it's still about 50%
  • 00:11:38
    less memory usage than it was in the JS
  • 00:11:40
    version and that's without any work put
  • 00:11:42
    into optimizing memory by the way kind
  • 00:11:44
    of nuts there is one last piece here I
  • 00:11:46
    want to very briefly touch on the if I
  • 00:11:48
    do a video on this it's basically going
  • 00:11:50
    be dedicated to this point garbage
  • 00:11:52
    collection garbage collection is a
  • 00:11:54
    strategy for managing memory and
  • 00:11:56
    applications generally speaking GC is a
  • 00:11:58
    process C that goes through and sees
  • 00:12:00
    what stuff isn't being used anymore and
  • 00:12:02
    cleans it up from memory to free up that
  • 00:12:04
    memory in languages like rust you have
  • 00:12:07
    to manage your memory yourself but rust
  • 00:12:09
    also has the borrow Checker which makes
  • 00:12:10
    it a lot easier to know what is or isn't
  • 00:12:12
    in use so it's trivial to keep things
  • 00:12:14
    free however you have to be constantly
  • 00:12:16
    checking what is accessing what memory
  • 00:12:18
    which makes writing it significantly
  • 00:12:19
    harder if you're optimizing for the
  • 00:12:21
    Perfect Memory footprint and making sure
  • 00:12:23
    you never have to take a break from
  • 00:12:24
    processing in order to clear out your
  • 00:12:26
    memory that's a great win but if you're
  • 00:12:28
    building something like a compiler where
  • 00:12:30
    you don't care about the latency at any
  • 00:12:32
    given moment having to take a break to
  • 00:12:34
    do garbage collection is actually pretty
  • 00:12:37
    nice and allows you to write code in a
  • 00:12:38
    much simpler greedier fashion garbage
  • 00:12:41
    collection is good for a lot of things
  • 00:12:44
    in particular I think this use case is
  • 00:12:46
    very good for it it might hurt on
  • 00:12:47
    something like a web server because if a
  • 00:12:49
    user is making a request while you're
  • 00:12:50
    doing GC that request is going to take
  • 00:12:53
    much longer to resolve than it would
  • 00:12:54
    otherwise you'll get crazy latency
  • 00:12:56
    spikes but if the process is going to
  • 00:12:58
    take multiple seconds ways and it does
  • 00:13:00
    hit a GC who cares yeah rust is a
  • 00:13:04
    phenomenal pick for this quick thoughts
  • 00:13:07
    from the lead of the typescript team
  • 00:13:09
    thank you Ryan for dropping this as
  • 00:13:10
    quickly as you did when this all came
  • 00:13:11
    out we definitely knew when we chose go
  • 00:13:13
    there would be people questioning why we
  • 00:13:15
    didn't choose rust or others funny
  • 00:13:16
    enough if you didn't know this Andre
  • 00:13:18
    sellberg the creator of typescript also
  • 00:13:20
    created C so they explored that as well
  • 00:13:22
    but their conclusion is that go is the
  • 00:13:24
    right call for a combination of its
  • 00:13:25
    portability because it will work on
  • 00:13:27
    multiple systems apparently Go's Windows
  • 00:13:29
    support hasn't historically been great
  • 00:13:31
    but I am sure Microsoft will fix that in
  • 00:13:33
    all of the demos they used windows so
  • 00:13:36
    makes sense it's even possible that the
  • 00:13:37
    issues I was having are because I'm on
  • 00:13:39
    Mac not Windows also going to hit
  • 00:13:41
    subscribe on the MSD Channel because if
  • 00:13:42
    they're going to post stuff like this I
  • 00:13:43
    want to keep an eye on it they explored
  • 00:13:45
    lots of options to try and make this
  • 00:13:46
    work in Rust but all of them either had
  • 00:13:48
    unacceptable trade-offs between perf and
  • 00:13:49
    ergonomics or they developed into some
  • 00:13:51
    crazy writey own garbage collection
  • 00:13:53
    strategy some of those came close but
  • 00:13:55
    they resulted in lots of unsafe code and
  • 00:13:58
    it didn't seem like something like rust
  • 00:14:00
    had The Primitives to do the ergonomic
  • 00:14:01
    flexible thing they needed to to handle
  • 00:14:04
    all this JS code pretty unsurprising
  • 00:14:06
    when phrased this way most languages
  • 00:14:07
    don't prioritize making it easy to Port
  • 00:14:08
    from JS or typescript in the end we have
  • 00:14:11
    two options do a complete from scratch
  • 00:14:12
    rewrite and rust which could take years
  • 00:14:14
    and yield an incompatible version of
  • 00:14:15
    typescript that no one could actually
  • 00:14:16
    use or we could just do a port and go
  • 00:14:18
    and have something usable in a year
  • 00:14:20
    hopefully you understand here I love
  • 00:14:22
    this joke too it's not even super clear
  • 00:14:24
    what the upside of doing this in Rust
  • 00:14:26
    would be apart from not having to deal
  • 00:14:27
    with so many why didn't you choose rust
  • 00:14:29
    questions and not to on the rust
  • 00:14:32
    guys as much as I believe me I love to I
  • 00:14:34
    just need you guys to see how many of
  • 00:14:35
    these we got leave it to Microsoft to
  • 00:14:37
    not pick rust why do you think they
  • 00:14:39
    didn't choose rust in before all the
  • 00:14:41
    people say why not rust why didn't they
  • 00:14:43
    choose rust we WR the rust compiler and
  • 00:14:46
    go good joke rust enters the chat room
  • 00:14:49
    why not rust though go is cool and all
  • 00:14:51
    but then it would be a 100 times fast no
  • 00:14:53
    no not at all even just getting the
  • 00:14:56
    parallelism working here in Rust would
  • 00:14:58
    be miserable rust's concurrency layer is
  • 00:15:00
    something left for you to deal with
  • 00:15:03
    yourself there's a reason why Tokyo is
  • 00:15:04
    as popular as it is I I've gone too far
  • 00:15:06
    down this tangent I didn't want the
  • 00:15:07
    whole video to be why not Russ dedicated
  • 00:15:09
    video probably coming soon just wanted
  • 00:15:10
    to express some frustration as well as
  • 00:15:12
    support for the go team even though I'm
  • 00:15:14
    not the biggest fan of go it was the
  • 00:15:15
    right call for this project I am hyped
  • 00:15:18
    that they picked it I hyped that it's
  • 00:15:19
    going as far as it is as quickly as it
  • 00:15:20
    is and I am beyond hyped to share the
  • 00:15:23
    planned release date they expect to have
  • 00:15:26
    a full preview of a native
  • 00:15:27
    implementation of TSC ready for you to
  • 00:15:29
    install and run in command line by mid
  • 00:15:31
    2025 this year and they also expect to
  • 00:15:34
    have a full project build and language
  • 00:15:36
    service working by the end of the year
  • 00:15:38
    that means ready for vs code by end of
  • 00:15:40
    year you can do it right now though even
  • 00:15:42
    my dumbass is able to figure this out so
  • 00:15:44
    it can't be too too hard they have
  • 00:15:46
    instructions in the repo for how to set
  • 00:15:48
    everything up you can even run it as an
  • 00:15:50
    LSP already I have time to set this up
  • 00:15:53
    just yet before recording so definitely
  • 00:15:54
    check this out if you're curious it
  • 00:15:55
    looks really really cool I love that
  • 00:15:57
    they're using the debug options nvs code
  • 00:15:59
    to trigger it awesome stuff here the
  • 00:16:01
    biggest catch though and this is the one
  • 00:16:03
    that's made it a lot harder for me to
  • 00:16:04
    test jsx is not ready yet jsx is the
  • 00:16:08
    syntax used for those little react
  • 00:16:10
    component looking HTML things in our
  • 00:16:12
    react code that's not supported just yet
  • 00:16:15
    it's still supporting a lot of stuff but
  • 00:16:17
    it means I can't run this on my code
  • 00:16:18
    basis to see the performance win yet
  • 00:16:20
    because almost all of my code bases have
  • 00:16:21
    jsx of some form in them they also
  • 00:16:23
    confirmed their plan for the Brad map
  • 00:16:25
    which is that typescript 6.0 will
  • 00:16:28
    introduce some deprecation and breaking
  • 00:16:29
    changes in order to align the typescript
  • 00:16:31
    in JS version with the typescript in Go
  • 00:16:34
    version and then typescript V7 will be
  • 00:16:36
    the official version where everything
  • 00:16:38
    moves over to go by default awesome plan
  • 00:16:41
    to get this rolled out they want to make
  • 00:16:42
    sure everybody with giant typescript
  • 00:16:44
    code bases is able to benefit from these
  • 00:16:46
    wins and it makes a lot of sense the
  • 00:16:48
    goal of typescript from day one was to
  • 00:16:49
    make it so that JavaScript could scale
  • 00:16:51
    to companies in codebases the size of
  • 00:16:53
    places like Microsoft when Microsoft
  • 00:16:55
    tried to write JavaScript code they ran
  • 00:16:57
    into the absolute that was trying
  • 00:16:59
    to keep it working when lots of devs are
  • 00:17:01
    contributing to lots of files and lots
  • 00:17:02
    of places typescript was written by
  • 00:17:04
    unders to solve this problem and despite
  • 00:17:06
    solving it really well it introduced a
  • 00:17:08
    new problem which is when we have these
  • 00:17:10
    giant code bases the performance of the
  • 00:17:11
    type Checker goes to now they have
  • 00:17:14
    solved it and once again typescript is
  • 00:17:16
    the solution for Gigantic applications
  • 00:17:19
    that work on every platform written by
  • 00:17:21
    big companies while providing incredible
  • 00:17:23
    developer experience the typescript team
  • 00:17:25
    has historically focused on developer
  • 00:17:27
    experience first and formost most and I
  • 00:17:29
    think this is the right path for them to
  • 00:17:31
    really improve that DX one last thought
  • 00:17:34
    because it's a thing I've been thinking
  • 00:17:34
    about a lot and I do think it fits here
  • 00:17:37
    the future of Dev tools I have a video
  • 00:17:38
    coming out soon that's already recorded
  • 00:17:40
    called uh react is the last framework
  • 00:17:44
    the hypothesis here is that we have all
  • 00:17:46
    these AI tools that have been trained on
  • 00:17:47
    the existing data there is so much data
  • 00:17:49
    for things like react and typescript
  • 00:17:51
    that introducing a new framework or
  • 00:17:52
    language is a hard thing to sell because
  • 00:17:55
    your AI will be worse at writing those
  • 00:17:57
    things because there just aren't as many
  • 00:17:58
    examp examples and this doesn't just
  • 00:17:59
    affect other Frameworks and other
  • 00:18:01
    languages trying to catch on it affects
  • 00:18:03
    react and typescript too the big thing
  • 00:18:05
    that I've been seeing is that react and
  • 00:18:07
    typescript can't really add big new apis
  • 00:18:10
    as easily because the likelihood that
  • 00:18:11
    the education materials that exist the
  • 00:18:13
    existing code bases that are referenced
  • 00:18:15
    in the AI that we're using to write all
  • 00:18:16
    the stuff we'll even know about those
  • 00:18:18
    features is near zero which is why we
  • 00:18:20
    saw the react compiler which was an
  • 00:18:23
    attempt to take your existing react
  • 00:18:24
    syntax and spit out faster code it's
  • 00:18:26
    also why we now have the typescript go
  • 00:18:29
    compiler because it doesn't change our
  • 00:18:31
    syntax at all but still gives us a
  • 00:18:33
    massive win and I think the future of
  • 00:18:35
    our Dev tools is going to be stuff that
  • 00:18:36
    looks more and more like this stuff like
  • 00:18:38
    UV in the python World which makes it
  • 00:18:40
    way faster to scaffold and set up your
  • 00:18:42
    development environment in Python also
  • 00:18:44
    things like Mojo which is in the python
  • 00:18:46
    World a way to write python looking code
  • 00:18:48
    that compiles to much faster C I think
  • 00:18:51
    these tools are examples of where we're
  • 00:18:54
    going with software where instead of
  • 00:18:55
    changing the syntax and ergonomics of
  • 00:18:57
    how we work on and write soft where
  • 00:18:59
    we're going to get tools that improve
  • 00:19:00
    the existing way we do things and it's
  • 00:19:02
    so cool to see Microsoft embracing this
  • 00:19:04
    as hard as they have there are lots of
  • 00:19:06
    other benefits in the AI World here in
  • 00:19:08
    particular when you have typechecking
  • 00:19:09
    performance that's this much better it
  • 00:19:11
    becomes significantly easier for things
  • 00:19:12
    like an AI bot to use a tool to check
  • 00:19:15
    your types as it is working on writing
  • 00:19:18
    code if it had to wait 30 plus seconds
  • 00:19:20
    before it could continue before not
  • 00:19:22
    great now if it has to wait under 3
  • 00:19:24
    seconds suddenly these tools become more
  • 00:19:26
    and more useful for getting an AI to
  • 00:19:28
    make make changes to a giant code base
  • 00:19:30
    and check along the way if those changes
  • 00:19:32
    are right or not so cool there are so
  • 00:19:35
    many ways a project like this could have
  • 00:19:36
    gone wrong and it's incredible to see
  • 00:19:38
    the typescript team avoid all of them in
  • 00:19:40
    the process I'm super Hy about this
  • 00:19:42
    project I think it's as an incredible
  • 00:19:43
    precedent for what we should expect from
  • 00:19:45
    Dev tools in the future huge shout out
  • 00:19:47
    to Anders huge shout out to Danny Rosen
  • 00:19:49
    waser and everyone on the typescript
  • 00:19:50
    team both for pulling me in early taking
  • 00:19:52
    my feedback and making all of this
  • 00:19:54
    happen I couldn't be more hyped to be a
  • 00:19:55
    typescript developer and you guys keep
  • 00:19:58
    making it worth it let me know what you
  • 00:19:59
    guys think and until next time keep typ
  • 00:20:01
    checking
タグ
  • TypeScript
  • Microsoft
  • Go
  • Performance
  • Development
  • AI
  • Concurrency
  • JSX
  • Compiler
  • Type Checking