News for hackers. Stuff that matters.
Re:Nearly All Binary Searches and Mergesorts are Broken (2006) by sanderjd on Thursday July 09, 2015 @07:46PM (#9861467)
The Rust community had a series of long discussions about this earlier this year (see [0] and [1] mainly), and I came out of it thinking that a more perfect world would have arbitrary sized integers by default and convenient types for explicitly choosing wrapping, error-ing, or undefined behavior for overflow and underflow. But there are lots of reasons why that world is hard to achieve (for instance, arbitrarily sized integers require heap allocation and indirection, which makes them quite a different beast), and while I think the compromise Rust came to is fairly awkward, the trade-offs seem pretty tough and the path to an optimal solution is not at all obvious.

[0]: https://github.com/rust-lang/rfcs/blob/master/text/0560-inte... [1]: https://internals.rust-lang.org/t/on-casts-and-checked-overf...

There are no comments on this comment yet.