News for hackers. Stuff that matters.
Re:Curl is C by anp on Monday March 27, 2017 @10:26AM (#13967952)
By default rust doesn't allow out of bounds indexing (indexing and iteration are checked, although bounds checks are often optimized out), you have to explicitly write unsafe code to read off the end of an array or vector.
Re:Curl is C by caconym_ on Monday March 27, 2017 @04:51PM (#13971650)
Can you elaborate on bounds checks being optimized out? Is it only in certain situations where compiler can prove that they are completely unnecessary? Otherwise, they can't be relied on, so what's the point of having them at all?
Re:Curl is C by steveklabnik on Monday March 27, 2017 @04:56PM (#13971702)
Yes, if the compiler can prove they're not needed, then it can remove the checks. But it has to prove it.