Someone's feedback on OCaml

Here is one fellow’s feedback on OCaml.
It is balanced and seems useful, especially given that he links to his philosophy on languages, which appears to be a healthy one.

7 thoughts on “Someone's feedback on OCaml”

  1. This “feedback” is quite old and out of date.
    “No stack trace for natively compiled executables” -> false since ocaml 3.11
    “List.map is not tail-recursive!” -> but List.rev_map is. OCaml designer made a choice about this: if you make List.map tail recursive it will imply a List.rev and a double allocation of the list. This costs memory…
    “Arithmetic’s readability” give a try to pa-do
    http://pa-do.forge.ocamlcore.org
    All in all, a lot of things in this feedback has changed since it was written. I think you should avoid relying on it. To my mind this is really a matter of taste…

  2. “you cannot easily modify the behavior of a module outside of it”
    That’s not entirely true: if you link against the module name the linkage is static (and thus immutable). If you parameterize the name of the module (via a functor) then yes, you can modify a module:
    module MyTime = struct
    include Time
    let date_of_string s =
    if is_iso8601 s
    then date_of_iso8601 s
    else Time.date_of_string s
    end

  3. I wouldn’t simply dismiss it and say it’s old and out of date.
    A lot of things he says are still pertinent (especially the thing about macros that nobody seems to understand among caml developers, everybody is praising the horror that camlp4 is)
    But still, I think it helps to try to divide his comments into the following categories.
    1) comments that are out of date.
    2) comments that are about taste or design choices.
    3) comments that are the consequence of not having the same tastes.
    4) comments that are relevant.
    P.S. Regarding arithmetic readability you can also wait on ocaml 3.12 and make judicious use the let open in construct.

  4. Daniel Bünzli:
    Your classifications sound helpful.
    For new OCamlers who have surely also read that page; it might be nice to see a current response.
    (Thanks all for your responses here, too)

Leave a Reply

Your email address will not be published. Required fields are marked *