4 ms·
Agree with many of these, but >Cannot add an int to a float - need an explicit cast. This is an obvious deficiency is ridiculous. Implicit conversions cause h
by wyager 11y ago
Agree with many of these, but
>Cannot add an int to a float - need an explicit cast. This is an obvious deficiency
is ridiculous. Implicit conversions cause huge classes of errors in languages that support them. There's not even well-defined behavior for converting an integer that won't fit in the mantissa to a float.
My experience with OCaml is that it made too many concessions to imperative programming to be a particularly useful functional language and its type system is sorely lacking. Things like 31/63-bit integers for pointer tagging, binary "generic" comparison operators, ;-sequencing, etc. are terribly ugly hacks.
- ufo 11y agoI agree that the issues you mentioned are annoying warts for Ocaml but I'm not so sure that they are all concessions to imperative programming. The 31-bit ints have more to do with simplifying the garbage collector implementation. The "generic" comparison operators have more to do with the lack of type classes. This has a bit to do with the imperative bits of the language (which make implementing type classes a bit harder) but also has to do with conflics with the existing module system (ocaml Functors support type encapsulation and some other things that make it harder to add type classes to the language)