
3 Jun
2013
3 Jun
'13
10:05 p.m.
On 3/06/2013, at 6:58 PM, Carter Schonwald wrote:
If the Int type had either of these semantics by default, many many performance sensitive libraries would suddenly have substantially less compelling performance. Every single operation that was branchless before would have a branch *every* operation..... this would be BAD.
Actually, the x86 can be configured to trap integer overflows, so on that not entirely unpopular platform, there need be NO extra branches. Alternatively, and more portably, there could be separate Int and UnsafeInt types, and the performance sensitive libraries could be rewritten to use UnsafeInt. For just one week, I had the joy of using a C compiler where signed integer overflow was trapped. It was *wonderful*.