← Back to context

Comment by ravi-delia

2 months ago

The usual int type is 63 bits. You can get a full 64 bit int, it just isn't the default.

The docs say, "one bit is reserved for the OCaml runtime", so doesn't that mean that one of the bits (likely the high bit) are unavailable for the programmer's use?

I mean, I understand "reserved" to mean either "you can't depend upon it if you use it", or "it will break the runtime if you use it".

  • So the "one bit" you refer to is what makes the standard int 63 bits rather than 64. If you could do things with it it would indeed break the runtime- that's what tells it that you're working with an int rather than a pointer. But full, real, 64-bit integers are available, in the base language, same goes for 32.

    • And that means that the OCaml runtime is not compatible with systems-level programming.

      If something is "available", it should mean that it can be used to its full capacity. One of those bits are definitely not available.

      8 replies →