← Back to context

Comment by api

1 month ago

It's like saying seat belts, air bags, and crumple zones do not prevent all automobile deaths. They don't, but they help a whole lot. Prevention of all bugs converges with artificial superintelligence and/or solving the halting problem (which is impossible).

There are formal languages that do more than Rust, but they're a lot less practical. Working on making a more practical one would be a useful exercise.

You can forbid unsafe at the Cargo.toml level in Rust. You can also just search a project for the keyword "unsafe" to subject all unsafe code to extra levels of scrutiny. Some orgs set commit rules where commits containing "unsafe" must be approved by more people or must pass through a security audit team.