• demesisx@infosec.pub
    link
    fedilink
    English
    arrow-up
    12
    ·
    11 hours ago

    As others have said, Haskell and Rust are pretty great. A language that hasn’t been mentioned that I REALLY want to catch on, though, is Unison.

    • sus@programming.dev
      link
      fedilink
      arrow-up
      27
      arrow-down
      1
      ·
      edit-2
      14 hours ago

      every single language (except Vlang of course) is memory safe if you program it perfectly.

      Very, very few humans are capable of doing that, especially with C.

      • WolfLink@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        arrow-down
        2
        ·
        7 hours ago

        You can still make stupid mistakes in Rust. It may make it harder to make the most common mistakes, but pretending the guardrails are prevent any type of mistake is asking for a problem to happen.

        • pathief@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 hours ago

          The only one pretending mistakes can’t happen is the person I replied to. Mistakes definitely can happen and no programming language is fool proof.

          Continuing my car analogy, would you rather drive a car with airbags and seatbelts or one without them? Of course you can still have a fatal accident, but it’s nice to have safety features that make it as unlikely as possible.

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    1 hour ago

    C++, with some Skill

    /s

    but seriously, I don’t know any language with a good, C/Cpp-like Syntax (so not Rust), with a good compiler (again not Rust). So I’m sticking to Cpp.

  • mox@lemmy.sdf.org
    link
    fedilink
    arrow-up
    28
    arrow-down
    2
    ·
    11 hours ago

    With no context, this could be an honest attempt to learn about different tools, a thinly veiled set-up to promote a specific language, or an attempt to stir up drama. I can’t tell which.

    It’s curious how such specific conditions are embedded into the question with no explanation of why, yet “memory safe” is included among them without specifying what kind of memory safety.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      Yeah, arguably the only answer to this question is Rust.

      Java/C#/etc. are not fully compiled (you do have a compilation step, but then also an interpretation step). And while Java/C#/etc. are memory-safe in a single-threaded context, they’re not in a multi-threaded context.

          • nous@programming.dev
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 hours ago

            I don’t think data races are generally considered a memory safety issue. And a lot of languages do not do much to prevent them but are still widely considered memory safe.

            • Ephera@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              55 minutes ago

              Yeah, that is why I prefixed that whole comment with “arguably”.

              I feel like the definition of memory safety is currently evolving, because I do think data races should be considered a memory safety issue.
              You’ve got a portion of memory and access to it can be done wrongly, if the programmer isn’t careful. That’s what memory safety is supposed to prevent.

              Rust prevents that by blocking you from passing a pointer for the same section of memory into different threads, unless you use a mutex or similar.
              And because Rust sets a new safety standard, I feel like we’ll not refer to Java and such as “memory-safe” in twenty years, much like you wouldn’t call a car from the 90s particularly safe, even though it was at the time.

    • Buttons@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      1
      ·
      8 hours ago

      The question mine as well be “what is your favorite compiled language?”. There is a lot of overlap between the possible answers.

    • paperplane@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      44 minutes ago

      Not that specific tbh, most newer native languages these days are compiled and memory safe (Rust, Swift, Go, Kotlin Native, etc)

    • sus@programming.dev
      link
      fedilink
      arrow-up
      26
      arrow-down
      2
      ·
      13 hours ago

      Garbage collection is still allowed, and technically JIT languages are still compiled so it really isn’t that restrictive

        • Traister101@lemmy.today
          link
          fedilink
          arrow-up
          2
          ·
          3 hours ago

          No python is statically typed. You have type hints, which makes the language tolerable but like their name implies it’s a hint at the type. You can perfectly legally pass in something completely different that doesn’t conform whatsoever.

          The primary thing static languages provide is static typing, that being the ability to determine before runtime that all the types are valid. A good example of this is how C++ programs will refuse to compile if you try to invoke a method that doesn’t exist on the type. That’s because it’s statically typed. At compile time you know that the code is wrong. Dynamic languages fundamentally don’t work like that. You cannot know until runtime if the method you called or the field you are trying to touch exists or not. Again type hints help a lot with this but that doesn’t change how the language actually operates.

  • UFO@programming.dev
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    10 hours ago

    Scala 3 native. If the compiler was faster I’d be even happier. Curious to try Ada