Hey all, this has been a lively discussion, but I fear that it’s long past feeling like a bit of a pile-on (albeit a very civil one
), with @viraltux being the sole person arguing on one side and all the rest of us on the other side, which just doesn’t feel like a nice dynamic. Some very good points have been made:
-
@viraltux has pointed out, quite rightly, that integer overflow can lead to program errors, which can be a concern and that it would be nice to be able to do something like
--check-overflowto make sure that integer overflow errors aren’t happening in programs. - It looks like a very limited version of this checking is probably going to happen by default in a future Julia version for
Int^Int. This is nice because^is one of the operators that is most likely to cause an integer overflow and for which it is unlikely that the user actually wanted native integer modular behavior. - Implementing
--check-overflowfor other arithmetic operations is more difficult because Julia has been ambiguous about whetherInt+Intand similar operations are intended to do wrapping arithmetic or not. Before we could usefully introduce overflow checks, we’d need+ₘetc. operators that are explicitly wrapping.
The rest of the discussion is much more subjective and reasonable people can disagree on how dangerous integer overflow is versus floating point error. But it seems like enough points have been made all around, so lest this seem like too much of a pile-on—and it may be too late, with apologies to @viraltux—let’s call it a day.