• @pHr34kY@lemmy.world
    link
    fedilink
    48 days ago

    I thought the idea of TS is that it strongly types everything so that the JS interpreter doesn’t waste all of its time trying to figure out the best way to store a variable in RAM.

    • @Feyd@programming.dev
      link
      fedilink
      98 days ago

      TS is compiled to JS, so the JS interpreter isn’t privy to the type information. TS is basically a robust static analysis tool

    • @Colloidal@programming.dev
      link
      fedilink
      58 days ago

      The code is ultimately ran in a JS interpreter. AFAIK TS transpiles into JS, there’s no TS specific interpreter. But such a huge difference is unexpected to me.