4 ms·
> and not so good at floating point computations What does this mean? I was under the impression the OCaml compiler did a decent number of floating point speci
by oconnor0 8y ago
> and not so good at floating point computations
What does this mean? I was under the impression the OCaml compiler did a decent number of floating point specific optimizations, like unboxed arrays and what not.
- noir_lord 8y agoSurprised me as well janestreet are a well known user of ocaml and I can't imagine they don't use a lot of floats.
- pjmlp 8y agoI guess it is the typical complain about using separate operators for ints and floats. It never bothered me in Caml Light, let alone when Objective Caml was introduced.
- oconnor0 8y agoAh, maybe, perhaps I am in the minority that liked the different operators for ints and floats. :D
- andrepd 8y agoYou can write floating point operators in several different ways. You can write with the normal floating point operators x *. y +. z or, since `Float.(+) = (+.)`, `Float.() = (.)`, etc, let open Float in x * y + z or simply Float.(x * y + z)
- xyproto 8y agoThat is pretty neat. Does it mean that one could do something similar for vectors and quaternions? let open Quaternion in x * y + x
- rixed 8y agoSymbols (variants with our without parameters) and integers are unboxed, while floats are not (but in a few specific cases such as arrays of floats, and iiuc that's an inelegant special case on its way out, as it prevents other optimisations).