• stetech@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    21 days ago

    You cannot make a safe yet universal cutting tool.

    I’m neither language designer or crustacean advocate, but from what can be read, Rust seems to have managed just fine. The trick is probably to allow removing the cover of the sharp edge when needed (execute unsafe).

    • Fonzie!@ttrpg.network
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 days ago

      Also, Rust allows “unsafe” code for when it’s absolutely necessary; you DO need to add a line that basically says “I know compiler, don’t stop me”. To keep up the metaphor; Rust allows you to cut yourself with the knife, but ensures you’re fully aware of what you’re doing.