Don’t discount Standard ML and OCaml. Maybe they’re not shiny new and hip, but these are educational and industrial workhorses for decades now.
Standard ML is an elegant, feel-nice language like Elm (though, as a matter of taste, the syntax might not feel as elegant as Elm’s). It being academically focused, available learning/reference material for industrial application will likely be more scarce and less approachable to someone coming from “Elm as a first ML language”.
From a “become a better programmer” standpoint, knowing SML is knowing the languages you mentioned (the “ML family”), and grokking where their inspiration came from. Once you master SML, there are a bunch of interesting ML variants to look into, like ConcurrentML (exploring synchronous message-passing, similar to Erlang), Poly/ML (standalone executables, multi-threading, ffi), MLton (whole program optimization, small and fast standalone executables), etc. IIRC, some Roc optimizations are implementations of research originally implemented and tested on MLton and OCaml.
I vaguely remember one of Evan’s speeches about enjoying Standard ML at school and wanting to convey that feeling of joy to Elm programmers. Might be mis-remembering that, though.
For learning SML, one approach is to go through ML for the Working Programmer. If you happen to prefer a university-level course with video lectures, there’s UW CSE341, among many others.
–
OCaml is a true industry-grade language, with a long history of successes. When I think of what programming languages were used to make stuff that keeps our modern society function, OCaml is certainly there together with C, C++, Erlang. (Albeit no C# and Java–those make our society dysfunction. In any case, don’t want to get into that discussion, this is a personal view).
Again as a matter of taste, OCaml syntax might not feel as elegant as Elm’s, but you can deliver production grade applications and system code with ease. Due to its long history, it offers more than you might need, but you’re not obliged to take it all.
To start exploring OCaml, start with version 5. Expect a bit steeper learning curve and some confusion while the legacy baggage around tooling is cleaned up. OCaml community has a solid momentum in the past few years, with clear focus towards modernizing both the language and the dx and the processes around it. The canonical starting point is ocaml.org.
Plenty of learning resources for OCaml, but most are pre-v5, thus good for language basics, but not necessarily getting up to speed with the latest developments (algebraic effects, eio, …). When learning concurrency, ignore lwt
and Async
and soldier through eio
.
Of course, you won’t be worse off if you first learn SML and then go for OCaml, or do both in parallel.
(History note: F# was originally envisaged “to bring the benefits of OCaml to .NET and .NET to OCaml.”).