Hacker News new | ask | show | jobs
by angelsl 2511 days ago
That's because you are supposed to do bounds-checking yourself in Rust, not because they don't want to handle it gracefully.

It's like happens when you read out of bounds in C, except it fails more reliably.

1 comments

You're supposed to write correct code in Java as well. The reality is that it doesn't always happen. C doesn't claim to handle the issue at all, and doesn't verify it, which is at least a performance gain. Rust does verify it, but issues an error type that is not guaranteed to be recoverable at all.