| SML records are structurally typed and may be anonymous which makes a lot of things easier to write. I've heard Ocaml has been attempting to tack that on, but that leads to the next point of Ocaml syntax being a complete mess. Ocaml needs keyword arguments, but in SML, structural typing gives named arguments without all the extra syntax. I find the `ref` syntax of SML much nicer to use than the mutable record syntax in Ocaml. SML doesn't have all the dotted math operators for floats. SML strings are immutable which lends itself to a lot of potential optimizations (and there's always byte arrays if you actually need to mutate). Ocaml let vs let expressions are annoying to me. SML has a standard. "The implementation is the spec" in my observation always leads to problems. My wishlist for SML: FIX USE COMPATIBILITY. It's intentionally not specified by the standard. This makes portable code very hard. I'd love to see an approach more like JS, but without dynamic imports (useless) and with support for something like GO_PATH plus maybe the ability to recognize and import from URLs (especially .git and .sml). JS style template strings with interpolation (the type system is at least smart enough to convert primitives to strings) and multi-line capabilities. This would also be an easy backward-compatible way to add support for unicode. Guarantee the ability to implement them as UTF-32 with the knowledge that an advanced compiler could choose to internally represent them as UTF-16 or even Latin1 to save space (JS implementations have optimized to convert their ropes from UCS-2 to latin1 when possible with huge memory savings as even Chinese sites are 90+% ASCII). Module Typeclasses should keep typeclasses from happening everywhere (looking at you Haskell) while still allowing them to be used for more than equality. Unofficial first-class functor support needs to be made official. Pick one of the 4-5 slightly different concurrency models and standardize it. Things I want that are in SuccessorML: Guards, "OR" shorthand, optional leading pipe in matches Line comments Record punning, extending, and "updating" do declaration shorthand |
Maybe I'm missing something in SML, but OCaml has `ref` as well and it works just like SML's?
> SML strings are immutable which lends itself to a lot of potential optimizations (and there's always byte arrays if you actually need to mutate).OCaml's strings are also immutable. They have been immutable by default since 2017 and prior to that one could opt into this behavior via a compiler flag.