• ultimate_worrier@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    1 day ago

    Typescript doesn’t have linear types. Not even Haskell has linear types (correction GHC has had LT by extension since 9.0). Give Rust some credit for having linear types (AKA borrow checker).

    Ps. Typescript doesn’t have dependent types and their type system is a joke even compared to Purescript. Here’s a little writeup about it: https://lemmy.dbzer0.com/post/66729809

      • ultimate_worrier@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Thanks. I think it’s most fair to count what a language has without extensions but thanks for the correction. To that end, Haskell basically has Dependent Types now too if you pile 10 extensions together (singletons, linear types, and others) and squint a little. It’ll easily be the first production-grade language to do so.

        • gedhrel@lemmy.world
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          19 hours ago

          That’s not realistic or “fair” - most Haskell projects will use a dozen or so extensions easily. GHC has been a platform for language experimentation for a long time; standardisation efforts keep on cropping up in annual surveys. (Eg, swapping in Text for String in base is long overdue, but it’s a hold over from days where FP pedagogy was seen as more important.)