4 ms·
Ok let me say it. The implementation of ints in computers is plain stupid. I am not sure why we have been trying to convince ourselves otherwise for decades. S
by whatever1 2y ago
Ok let me say it. The implementation of ints in computers is plain stupid. I am not sure why we have been trying to convince ourselves otherwise for decades.
So many programs are wrong because of this and they are just ticking bombs.
- Y_Y 2y agoWhat would you have done? I don't disagree, but I'm not sure what would have been better either.
- whatever1 2y agoInt as a type serves different purposes. Counting, indexing, rounding floats, exact arithmetic etc. These have completely different requirements and edge cases. It was a mistake trying to tackle all of these with a singular type.
- Y_Y 2y agoNot to mention bools, bitarrays, error codes...
- toast0 2y agoI think you'd have better responses if you said the implentation of ints in most programming languages is plain stupid. Processors are doing a reasonable job, but there's certainly things they could do differently. Some languages have pretty specific integer types. And then you have C. Java at least makes all the integer widths consistently sized on all platforms, but neither provides good ways to express and manage overflow or carry. And the architects of Java decided that developers aren't qualified to use unsigned types, which makes a lot of tasks much harder.