1. 28
  1. 11

    ehhhh as a research language it’s not dead yet.

    But if you think a language (spec) should continue to be updated (which is fair; even C and even Fortran get more spec revisions than Standard ML has), then yeah that part of it doesn’t seem likely to come alive anytime soon.

    This post also talks about syntax and semantics as its flaws. I think that’s completely untrue. It hasn’t sprouted because it doesn’t have a major any industry backer like OCaml has in Jane Street.

    1. 8

      I’m not sure if it’s fair to call Jane Street the main backer of OCaml. They are definitely a big backer and they are vocal about their use of OCaml, but they aren’t alone. OPAM is maintained by OCamlPro, for example, which is a consulting company.

      It’s also interesting to note that SML did have commercial users and backers. AT&T (if I’m not mistaken, or another big telecom company) had a big SML codebase. Harlequine Software was selling a commercial IDE for it (MLWorks).

      I mostly support the OCaml side in the debate about int/float problem and other issues mentioned, but I’m not ready to give any answer as to why the OCaml community is much bigger than that of SML now. All I can say for myself is that the existing community of OCaml and the languages features not available in SML tip the scales towards OCaml for me all the time. I want to write programs and make it easier for other people to write in an ML, and OCaml is the one ML that makes it easier for me.

      Also, fun fact: MLton has a way to use overloading in your own code, even though you need to explicitly enable it in the compiler options.

      1. 2

        I didn’t call it the main backer of OCaml; but I would call it that now that you mention it. “Main” doesn’t mean they’re the only one. They seem to be the biggest one though.

      2. 6

        As a research and education language SML is still hanging around, true, but as an industry language, let’s face it, it’s dead.

        It hasn’t sprouted because it doesn’t have a major any industry backer like OCaml has in Jane Street.

        Difficult to say, is OCaml successful because of Jane Street backing or is Jane Street backing it because it’s a viable language? I think there are multiple factors involved. Personally I think the fact that they have a single (main) implementation, with a simple C-like native executable compiler, helped a lot.

        1. 8

          Personally I think the fact that they have a single (main) implementation, with a simple C-like native executable compiler, helped a lot.

          Agreed. SML has some excellent compilers, but the flagship (SML/NJ, flagship due to its prevalence in education) is not friendly to shipping executables. MLton, the excellent whole-program optimizing compiler, is not friendly to interactive development. Ocaml’s single implementation definitely helps.

          I think the big thing (possibly a side-effect of above) is SML and Ocaml’s library situations. SML has the Basis library, which is a standard library in a very early 90’s way (simple data types, socket-level networking). And it’s not actually a library, it’s a set of definitions and interfaces that are implemented by different SML implementors (much like the language itself). It took years for the committee to finalize the Basis, and that was quicker than standardizing the language.

          Ocaml, on the other hand, has the one implementation, by Inria, with a standard library that doesn’t take a multilateral committee to update. Still, the standard library is also fairly spare. But the library actually changes over time, which is not nothing, and it includes important bits like a parser library. Between that, and pretty good C interoperability, Ocaml has much more out of the box.

          Jane Street can then build a layer of different library bundles on top of that, and because they work with all of the Ocaml implementations (just the one), they gain a lot of traction in the community. That centralization allows a standard package manager (opam). Which is easy enough to add to that it grows.

          Pretty soon, SML is nowhere near Ocaml.

          1. 4

            but the flagship (SML/NJ, flagship due to its prevalence in education)

            Yes it’s common in education but I really wouldn’t call this the flagship at all. MLton and Poly/ML are the only ones I’d recommend to anyone for serious use.

          2. 4

            As a research and education language SML is still hanging around, true, but as an industry language, let’s face it, it’s dead.

            Yup I agree.

            Difficult to say, is OCaml successful because of Jane Street backing or is Jane Street backing it because it’s a viable language? I think there are multiple factors involved. Personally I think the fact that they have a single (main) implementation, with a simple C-like native executable compiler, helped a lot.

            Maybe, but it seems overall completely arbitrary to me. And that’s fine, most successful things in life are arbitrarily successful.

        2. 5

          Not sure that nitpicking the OCaml asides is really on topic here, but that is the part I know anything about, so:

          After this article was published, Akiva Leffert reminded me that SML later settled on a third fix to this problem, the “value restriction”

          OCaml also uses the value restriction and it’s…basically fine? Sometimes you have to eta-expand things. That’s not usually a problem because most OCaml code I’ve seen will prefer fully eta-expanded definitions as a stylistic choice anyway.

          The only example I know where it’s a real problem was for implementing lenses. I think they ended up writing a ppx to do all the eta expansion automatically.

          Also, wow, he’s been away from ML a long time if the value restriction happened “later.”

          Here, OCaml’s +. trick was unworkable. You cannot have a different identifier for equality comparisons at every different type.

          Why not? In OCaml you can have String.(=), Int.(=), and Bool.(=). You can even have String.(=) and String.Caseless.(=), because some strings are case sensitive and others aren’t.

          The ability to define custom comparisons is crucial for stuff like

          type user = {
            display_name : string; (* not necessarily unique *)
            id : int;              (* use this for comparison *)
            }
          

          (Well, I guess crucial is hyperbole. JavaScript has no way to specify custom comparisons for keys of maps and that hasn’t stopped the entire internet from getting stuff done.)

          1. 5

            SML still uses a stronger than really necessary version of the value restriction. OCaml makes the user eta-expand much less often thanks to that work by Jacques Garrigue et al.

            Regarding Int.(=) and similar, I think the reason they weren’t used is that they would be really annoying to use, especially before local module opens.

            1. 3

              It also seems like OP isn’t aware of local opens and the operator-overloading pattern that they enable.