Zig vs Rust. Which one is going to be future?

I think about pros and cons and what to choose for the second (modern) language in addition to C.

@programming@programming.dev

  • GetOffMyLan@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    5 hours ago

    For me you really aren’t selling it.

    When the answer to major draw backs with a language is use it better that’s a dead end for me.

    Some of the greatest programming minds have been using c for a long time and we still have a huge amount of dangerous vulnerabilities all the time.

    The language is fundamentally flawed and other languages have demonstrated that you can get the same flexibility, expressiveness and performance without these flaws.

    Again with the lack of many standard lib constructs. I now have to trust that every lib i use was written by a serious expert. as they’ll need to implement so much themselves rather than trusting the core language team, who you hope would know it better than most.

    And again with OOP. Why hack it into a language rather than use a language that supports it.

    It’s beginning to feel like people are just clinging to c because it’s what they are used to. All I seem see are justifications of its flaws and not any reasons to actually use it.

    If it came out today you’d have an incredibly hard time convincing anyone to use it over other languages.

    • zirias (on snac)@snac.bsd.cafe
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      When the answer to major draw backs with a language is use it better that’s a dead end for me.

      Try browsing the list of somewhat recent #CVE rated critical, as I just did to verify. A majority of them is not related to any memory errors. Will you tell all them “just use a different programming language”?

      And again with OOP. Why hack it into a language rather than use a language that supports it.

      Have you seen existing C code? For anything non-trivial, most code uses some OOP, and it comes quite natural in C, certainly no “hacking”. You don’t need a class keyword to do that.

      If it came out today you’d have an incredibly hard time convincing anyone to use it over other languages.

      It doesn’t come out today, it’s been there for a long time, and it’s standardized, proven and stable. Sounds like you seriously misunderstood my points, which were, in a nutshell: For applications and similar, just use whatever suits you; for operating systems do experiments in lab/research projects (as was done with Unix), because existing and established ones are relied upon by lots of software. Just to make that perfectly clear, that doesn’t mean they should use C forever, it means they should wait for a potential replacement to reach a similar state of stability with independent standards and competing implementations.