Remix.run Logo
porcoda a day ago

For those interested in the Standard ML compilers, Mlton is another one worth checking out. Standard ML of New Jersey (smlnj) is another interesting one although it tends to be more of a research vehicle than polyml or mlton. If you are inclined toward verification, the cakeml project is quite cool as well. For those unfamiliar with standard ML, if you’ve heard of ocaml or F#, they’re relatives in the ML language family.

wk_end a day ago | parent | next [-]

> Standard ML of New Jersey (smlnj) is another interesting one although it tends to be more of a research vehicle than polyml or mlton.

This is interesting! My impression was that SML/NJ was the de facto "standard" Standard ML implementation (maybe analogous to SBCL in the Lisp world), and (FWIW) Gemini agrees, describing it as "the oldest and most widely used". So I'm surprised to see someone stick it in the rear behind Poly/ML and MLton.

I don't really know what to make of that, except that I guess there's a surprisingly vibrant SML ecosystem and don't listen to any one person (myself included) about it: try them all and see which SML implementation is right for you :)

porcoda a day ago | parent | next [-]

I think mlton is the one to reach for if you want strict conformance to the SML'97 definition [1]. There's a page on the MLton site that describes where SMLNJ deviates from SML'97 [2].

I'm surprised Gemini says SML/NJ its the most widely used. I've been an active Standard ML user for close to 30 years, and while that was certainly true for the first half of that time, I found most projects around me drifted to defaulting to want to compile with mlton or polyml. SML/NJ's heap2exec was a bit clunky compared to the others. It's great that they're slowly moving it over to LLVM.

[1] http://www.mlton.org/Features

[2] http://mlton.org/guide/20051202/SMLNJDeviations

momentoftop a day ago | parent [-]

I understood that MLton was mostly about performance. It does whole program optimisation and is prepared (or does?) monomorphise just about everything, and applies all of your functors at compile time, so that you've got something more like C++ templates but well-typed.

> SML/NJ's heap2exec was a bit clunky compared to the others.

Unlike the others, SML/NJ implements call/cc, so it's going to need to do something funkier.

   SMLofNJ.Cont.callcc

   > val it = fn : ('a ?.Cont.cont -> 'a) -> 'a
Dacit a day ago | parent | prev [-]

>(FWIW) Gemini agrees

LLM hallucination: Poly/ML has been in use since at least 1986 (see e.g. Paulsons preliminary user's manual for Isabelle).

erk__ a day ago | parent | prev | next [-]

There is also MLKit which is pretty interesting in how it handles memory, it is region based with some fallback to garbage collection.

https://elsman.com/mlkit/

anta40 a day ago | parent | prev [-]

OCaml seems nice for doing real world app development (e.g) web backend, and not limited only for prog lang research.

Hmmm....