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).
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.
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).
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.