• sus@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      3 months ago

      every single language (except V 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
        0
        ·
        3 months 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
          0
          ·
          3 months 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.

  • davidagain@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Elm, which is the loveliest language ever.

    But I’m not sure if compiles to javascript counts as compiled, in which case haskell, which is considerably less lovely but still good.

    Roc isn’t finished, but it might turn out lovely, I don’t know.

    • FizzyOrange@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Its definitely best to try and avoid raw pointers, but even if you try really hard I found it’s not really possible to get a Rust-like experience with no UB.

      Even something as simple as std::optional - you can easily forget to check it has a value and then boom, UB.

      The C++ committee still have the attitude that programmers are capable of avoiding UB if they simply document it, and therefore they can omit all sanity checks. std::optional could easily have thrown an exception rather than UB but they think programmers are perfect and will never make that mistake. There are similar wild decisions with more recent features like coroutines.

      They somehow haven’t even learnt the very old lesson “safe by default”.

      If I wanted memory unsafety I think I would consider Zig instead of C++ at this point.

      • cinnamon_tea@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        I recently got bitten by exactly that std::optional UB and here I was thinking 🤔 after 12+ years in the industry starting all the way back in the day with C++03 that modern C++ was supposed to make things better.😐

  • cinnamon_tea@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 months ago

    You forgot that beauty - “undefined behavior”!

    Memory-safety can guarantee only so much safety! C++ can still blow up in your face, even with all the alleged memory-safety built into C++, thanks to all the UB traps in C and C++.

    Rust is the closest language that has no such “gotchas”.

  • hessnake@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I started learning Go about 3 months ago and it quickly became one of my favorite languages. It feels like C with a bunch of Python niceties thrown in. And performance isn’t super critical in my work so being garbage collected is fine with me.

  • I Cast Fist@programming.dev
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Nim. Small compiler, small executables, easy to understand (except the macros, I still can’t get my head around them).

    FreePascal. Yeah yeah, Pascal’s dead, etc etc, but it being so verbose and strict certainly help programmers (or at least me) keeping things somewhat tidy.

    Also shoutout to V

  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    3 months 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.

    • Hundun@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      What’s so bad about the Rust compiler? I know it’s slow, but given all the analysis it’s doing, it makes sense. And, from my own experience, setting correct optimization levels for dependencies along with a good linker makes incremental builds plenty fast.

        • PushButton@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          I don’t know what you are talking about?

          Rust is such an amazing language, it’s so safe and clean and beautiful and simple and clear to read and such wow community that are making amazing crates for cargo because cargo is so cool I like it so much so easy to…

          Oh, and your fav lang sux alot!1 lolololllll

  • Prison Mike@links.hackliberty.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 months ago

    Crystal, but only because I’m a full time Ruby on Rails (and sometimes Hanani!) programmer.

    It’s fantastic, and I had an excuse to use it at work when we needed to gather PHP Watchdog logs from a MySQL database and format, output them to STDOUT in a Kubernetes environment. (This was necessary for our log monitoring tools expecting data in a standard way, AKA not connecting to a database. 🤦‍♂️)

    I know there are perhaps better options out there (Go, Rust, etc.) but from a Rubyist’s point of view Crystal gives you that “flow” from working in a beautiful language but with the performance boost of compiled software.

  • Lambda@lemmy.ca
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Ada, hands down. Every time I go to learn Rust I’m disappointed by the lack of safety. I get that it’s miles ahead of C++, but that’s not much. I get that it strikes a much better balance than Ada (it’s not too hard to get it to compile) but it still leaves a lot to be desired in terms of safe interfacing. Plus it’s memory model is more complicated than it needs to be (though Ada’s secondary stack takes some getting used to).

    I wonder if any other Ada devs have experience with rust and can make a better comparison?

    • refalo@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      I would use Ada or Spark in a heartbeat if there was an easy-to-use, mature cross-platform GUI library for it.

    • collapse_already@lemmy.ml
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      I have done quite a bit of C, C++, Ada, and Pascal development. I recently got into Rust. I am still getting used to Rust, but it feels a bit like someone tried to apply Ada to C++. I like the modern development environment, but I am slower writing code than I would be in Ada or C++. The one feature of Ada that I really like and want other languages to adopt is the Rep spec. I write driver code and being able to easily and explicitly identify which symbol corresponds to which bit is really good.

    • sus@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

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

    • paperplane@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

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