News for hackers. Stuff that matters.
Re:Don’t assume that safety comes for free: a Swift case study by Animats on Tuesday December 06, 2016 @03:05PM (#13117822)
Now that more languages are checking for integer overflow, it's time for integer overflow exceptions to re-appear in hardware. DEC VAX machines had this, but C didn't use them. With the hardware doing the checking in parallel, there's no performance penalty.

If you want wrap-around arithmetic (which is rare) you should have to write something like

    unsigned short i,j;
    i = (i + j) % 65536;
which the compiler should optimize into a no-check add. This gets you the same answer on all platforms.
Re:Don’t assume that safety comes for free: a Swift case study by gok on Tuesday December 06, 2016 @09:02PM (#13119933)
Do you find a shorthand for wraparound math (like Swift's &+) so bad?