logoalt Hacker News

LoganDark • yesterday at 10:30 PM • 1 reply • view on HN

Curious, how does Rust give up raw speed? Are you talking just about runtime bounds checks, or is there more?


Replies

zem • yesterday at 10:54 PM

bounds checks are one, yeah, but I was also thinking about the tricks c++ could play with optimising undefined behaviour, as well as unsafe patterns involving shared access and pointer aliasing that a human could determine was safe in that specific case but that the rust compiler would balk at. and maybe it wasn't actually safe in which case the rust code would have the last laugh.