• dreugeworst@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    2 days ago

    sure, maybe, but performance doesn’t matter for deciding if a language is memory-safe or not. And C++ isn’t memory-safe by any commonly used interpretation of that word.

    You may of course decide that the downsides of memory-safety aren’t worth it for your use-case, that is a separate issue

    • Zacryon@feddit.org
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      I think it boils down, how we define “memory safe”. C++ is perfectly memory safe, if you know what you’re doing. A lot of people don’t. Which is why Rust was born. that doesn’t make C++ a memory-unsafe language. It just demands more responsibility from the user. A design philosophy that comes with a lot more flexibility than Rust can offer.

      Which is fine. Both languages have their perks. But saying C++ isn’t memory safe, while Rust is, is in my opinion just plainly wrong. Besides, with “unsafe” Rust inherently already the door for memory issues.

      Modern C++ practises and dev patterns can handle most memory issues in C++ pretty easily. Consider smart pointers for example, or RAII.

      It’s not the language’s fault if it is used wrong.