Hacker News new | past | comments | ask | show | jobs | submit
And memory safety doesn't prevent logic errors (or using 4 as a private key for that matter)
No, but type safety does. You can't forget to lock an object before using it when that lock is part of the type. Or pass a raw user controlled path to a function that expects a validated one. If you want to do it on purpose you need to write unsafe code that's clearly visible to anyone reviewing your patch.
This said memory unsafe code just likely has more bugs because of all the footguns it has on top of all the other security work you need to do with it.