Python is memory safe? Can’t you access/address memory with C bindings?

  • vext01@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    I agree for the most part, but writing data structures with shared mutable state can be a total pain in Rust.

    • Fal@yiffit.net
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      1
      ·
      6 months ago

      How so? That’s like, the thing that makes rust awesome to write.

      • vext01@lemmy.sdf.org
        link
        fedilink
        arrow-up
        0
        ·
        6 months ago

        It’s hard to get those kinds of data structures through the borrow checker.

        Try writing a doubly linked list.

        • Fal@yiffit.net
          link
          fedilink
          English
          arrow-up
          0
          arrow-down
          1
          ·
          6 months ago

          It’s because it’s hard to make them correct. It’s not any harder to write it in rust than in C. Just C lets you do it wrong