• fubarx@lemmy.world
    link
    fedilink
    arrow-up
    46
    ·
    4 months ago

    So many system bugs are because of unclear memory ownership, buffer overflows, and race conditions. C/C++ don’t help you avoid any of these footguns. Any other system that relies on GC is non-deterministic and prone to mystery hiccups, which is why OS and driver tech has been pretty much the same foundation since the 70s.

    Rust lets you avoid 2 of those 3 issues (thread race conditions are still a thing). And being compiled, instead of interpreted bytecode means you can get reasonable performance on smaller machines. No wonder these OS guys are so excited.

    • BartyDeCanter@piefed.social
      link
      fedilink
      English
      arrow-up
      17
      ·
      4 months ago

      Yup. Most of my career has been working on embedded realtime software, so interpreted languages are right out and really only C and a subset of C++ are available. I’ve now been using Rust in that way for about nine months now and while the syntax is sometimes silly feeling, being able to not worry about some many other issues has made development much better.

      • fubarx@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        4 months ago

        Yes, but nobody in their right mind will use boost at OS kernel or driver level. Also, using C++ has vtable/exception overhead. No-go.

        I worked at companies that tried both. They no longer exist.

        • Zamundaaa@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          1
          ·
          4 months ago

          Also, using C++ has vtable/exception overhead. No-go.

          That’s just nonsense. The kernel and most other big C projects are full of structs with manual re-implementations of vtables.

          If you don’t want exceptions (I don’t either), C++ doesn’t require you to use them. KDE software builds without them.