Skip to content

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.

6 Comments

  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…

    Monday, April 12, 2010 at 16:37 | Permalink
  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

    Monday, April 12, 2010 at 17:05 | Permalink
  3. Grant wrote:

    Thanks guys.

    Monday, April 12, 2010 at 19:55 | Permalink
  4. 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.

    Tuesday, April 13, 2010 at 01:26 | Permalink
  5. roy_hu wrote:

    Regarding List.map, OCaml Street uses a different strategy in their Core library: http://ocaml.janestreet.com/?q=node/71

    Tuesday, April 13, 2010 at 10:09 | Permalink
  6. Grant wrote:

    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)

    Tuesday, April 13, 2010 at 13:42 | Permalink

One Trackback/Pingback

  1. […] This post was mentioned on Twitter by Planet Scheme. Planet Scheme said: Grant Rettke: Someone’s feedback on OCaml http://bit.ly/cs1EO4 […]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*