logoalt Hacker News

ori_byesterday at 11:24 PM2 repliesview on HN

By that token, Rust is also memory unsafe: array bounds checks and stack overflow are runtime checks.


Replies

p1neconetoday at 12:04 AM

Why are you talking like this is black and white? Many things being compile time checkable is better than no things being compile time checkable. The existence of some thing in rust that can only be checked at runtime does not somehow make all the compile time checks that are possible irrelevant.

(Also I think the commenter you're replying to just worded their comment innacurately, code that crashes instead of violating memory safety is memory safe, a compilation error would just have been more useful than a runtime crash in most cases)

DetroitThrowyesterday at 11:39 PM

There are several ways to safely provide array bounds check hints to the Rust compiler, in-fact there's a whole cookbook. But for many cases, yep, runtime check.