Hi! I’ve created this page to showcase the features of Mint (since there are so many) and their corresponding versions in other similar languages.

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    5 days ago

    TS as a statically typed language is not what I would call it. It’s a language with enforced type annotations but can be circumvented pretty easily. For example when receiving a JSON from an http request a string field can be just whatever.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      5 days ago

      That’s nitpicking. It is statically typed. Is Dart not statically typed because it has dynamic.

      You could call it “gradually typed” if you want to be pedantic.

      can be circumvented pretty easily

      That means it isn’t sound.

      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        4 days ago

        Gradually typed is a great description because it’s neither fully static or dynamic. TS does allow you to circumvent the types too easily to be called statically typed.

        const strings: string[] = ([1] as any[])
        

        Is ok in TS land so the type of strings is not really static so to speak because you can assign whatever to it. Writing this in Dart would give

        error - The argument type 'List<dynamic>' can't be assigned to the parameter type 'List<string>'. - argument_type_not_assignable
        

        if I’m not mistaken.

        • hikaru755@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          4 days ago

          I get your point, but that’s not a great example. Kotlin is a statically typed language, and this compiles (and runs!) just fine:

          val test: List<String> = listOf(1) as List<String>
          println(test) // prints "[1]"
          

          Even val test: String = 1 as String will compile, but at least gives you an exception at runtime, which the equivalent typescript wouldn’t.

            • hikaru755@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              4 days ago

              Unfortunately not. You do get a warning that it’s an unchecked cast at least.

              Granted, the issue here is generic type erasure, which was a tradeoff that was decided on for backwards compatibility when generics were first introduced to Java, so it’s not like an actually desirable feature of the language. But the point is that this wouldn’t be reason for anyone to not call Java and Kotlin not statically typed, their type system is just a bit weaker than others in certain aspects

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    9
    ·
    5 days ago

    Why is single line comments listed when it’s green for all of them? Do they not have multi-line comments?

    • 0xDREADBEEF@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      I love that little language. I learned ReasonML for fun and built a few toy apps a long time ago, but ReScript has been cool to watch

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    5 days ago

    Interesting, but the colours for exceptions are inverted. One of the features that Elm touts on its front page is that it doesn’t have exceptions.

    Structural equality is also debatable.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      5 days ago

      Languages well suited for client side web code. Most of these (maybe all?) compile to JavaScript and are designed for the web.

      • Kissaki@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 days ago

        Web is just one kind of frontend though. And there’s more ways to target web with JavaScript interfacing than transpiling to JavaScript.

        • FizzyOrange@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          4 days ago

          Sure, but without further context, “frontend” means the web. And “frontend language” means languages that were designed for the frontend. You can write a website fromtend in Python, but you absolutely shouldn’t!

          You can use languages like Java and Rust too which are more reasonable options, but they aren’t “frontend languages”.