Based on the experience with the tracer, overflow checks aren't really crazy expensive and we can optimize them quite well. It probably depends on how well LLVM understands them. I know it has intrinsics for it.
Andreas On Apr 16, 2011, at 1:14 AM, Brendan Eich wrote: > On Apr 16, 2011, at 8:22 AM, Patrick Walton wrote: > >> On 04/15/2011 11:20 PM, Patrick Walton wrote: >>> This area seems promising enough that I was wondering if there was >>> interest in something like this for Rust. There's no harm in having the >>> programmer explicitly be able to turn off the checking at the block or >>> item level; some algorithms, such as hashing algorithms, rely on the >>> overflow semantics, after all. But it seems in the spirit of Rust (at >>> the risk of relying on a nebulous term) to be as safe as possible by >>> default, and so I'd like to propose exploring opt-out overflow checking >>> for integers at some point in the future. >> >> To be clear: I'm not proposing that we promote to bignums or anything like >> that. Most likely we'd just fail on integer overflow by default. > > Yes, we've talked about this in the past with roc -- failure would be better > than wrapping around. > > /be > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
