Skip to content

Detect and throw Integer_overflow with OCaml #32

@nikochiko

Description

@nikochiko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions