• brian@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    I mean, tsc without any of the backporting functionality is still a transpiler since it goes from a high level language(ts) to another high level language(js). Transpilation as a concept doesn’t imply that it is for backporting language features or that the source and destination languages are the same, just that it is a transformation from source code to a similar or higher abstraction level language source code

    • fidodo@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      Yes, it’s still a transpiler, I’m not saying it isn’t, but what I mean is that it doesn’t add any functionally specific to the typescript language. There’s a transpiler for TS that doesn’t even do any type checking at all and just does the type stripping and back porting. But of course, that’s not why people use typescript. All the features that are actually important to typescript could be done through a linter instead. If type annotations were added to JavaScript you could get most of typescript’s features with linting rules and just handle back porting in a more standard way.