tarides / hackocaml

OCaml hacking ideas, small and large.
MIT License
19 stars 1 forks source link

Detect and throw Integer_overflow with OCaml #32

Open nikochiko opened 6 months ago

nikochiko commented 6 months ago

Notes from talking to KC:

Ideally, the compiler should spit out code to check the overflow flag (or whatever the condition would be - with calculations on the 31/63-bit ints), and throw an exception in that case. It would get pipelined and not cause a performance hit.