3 ms·
https://ocaml.org/manual/5.3/api/Int64.html https://ocaml.org/manual/5.3/api/Int64.html
by lapinot 2y ago
https://ocaml.org/manual/5.3/api/Int64.html https://ocaml.org/manual/5.3/api/Int64.html
- MrMcCall 2y agoI see, now. From that doc: > Performance notice: values of type int64 occupy more memory space than values of type int I just couldn't even imagine that a 64-bit int would require MORE memory than an int that is one bit less (or 33 bits less if on a 32-bit architecture). It really makes absolutely no sense discussing OCaml as a possible systems-level programming language.
- MrMcCall 2y agoSorry, I should have said that an Int64 shouldn't take more memory on a 64-bit system where the default int is 63 bits, because of the "reserved bit". It was early this morning.
- mbac32768 2y agobruh, it's just saying single scalar Int64 types are boxed. This is totally normal thing that happens in garbage collected languages. There's no semantic loss. OCaml does this 63-bit hack to make integers fast in the statistically common case where people don't count to 2^64 with them. The top bit is reserved to tell the GC whether it manages the lifetime of that value or not. For interoperating with binary interfaces you can just say `open Int64` at the top of your file and get semantic compatibility. The largest industrial user of OCaml is quant finance shop that binds all kinds of kernel level drivers with it. (and yes, 64-bit non-boxed array types exist as well if you're worried about the boxing overhead)