Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect and throw Integer_overflow with OCaml #32

Open
nikochiko opened this issue Mar 11, 2024 · 0 comments
Open

Detect and throw Integer_overflow with OCaml #32

nikochiko opened this issue Mar 11, 2024 · 0 comments

Comments

@nikochiko
Copy link

nikochiko commented Mar 11, 2024

Notes from talking to KC:

  • OCaml has 31 and 63-bit signed integers - one bit (LSB) is always 1 to mark it as an integer (otherwise, it is considered to be a pointer by the GC)
  • OCaml also has int32 and int64 - boxed ints that are not cleared by the GC
  • We should want to do it without making an expensive external C call

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.

@nikochiko nikochiko changed the title Detect and throw IntegerOverflow with OCaml Detect and throw Integer_overflow with OCaml Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant