There is static analysis (i.e. determine ahead of time exactly what values variables may take), but it's certainly not a panacea: the analysis step is slow (probably too slow to fully integrate into a compiler), not everything can be solved, and most existing solvers are not free software as far as I am aware.
It could perhaps be used for a little optimisation and for proofs that overflow doesn't occur in some cases, but integrating a static analysis system with a compiler would be no easy task. Leon is the most advanced version I'm aware of (though it's not really my field): http://lara.epfl.ch/w/leon On Saturday 11 January 2014 11:18:41 Marijn Haverbeke wrote: > I am not aware of an efficient way to provide > automatic-overflow-to-bignum semantics in a non-garbage-collected > language, without also imposing the burden of references/move > semantics/etc on users of small integers. I.e. integers, if they may > hold references to allocated memory can no longer sanely be considered > a simple value type, which doesn't seem like it'd be a good idea for > Rust. > > If there is a good solution to this, I'd love to find out about it. > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
