The History of Standard ML [audio]
pldi21.org
pldi21.org
It's the pragmatic ML. Unlike Haskell, it believes in side effects, optional mutation, and eager evaluation, but within a type system that is much more sound than the ones used in any of the most common languages.
It was designed with students and student implementors in mind, so is quite easy to learn (and implement). Despite this, it has the potential to be very fast with MLton compiling fast code (I'd say about as fast as golang).
It's also interesting in being pretty much the only unpopular language with very good threading support. Perhaps this is due to academic use, but CML (or PolyML's version) are very powerful, but decently easy to use (and I'd consider them a straight upgrade from golang's version of channels).
If a major company invested in the SML ecosystem, it would take over the programming world.
I like SML both out of nostalgia and for its actual merits, but I don't think that's true. SML was far ahead of its time, but it's showing its age now. Its simplicity is also correlated with an absence of handy features (e.g. ad-hoc polymorphism). Many companies invest in OCaml, which is slightly more crufty but with a (much) more healthy ecosystem, yet it hasn't taken over the world.
I do wonder what would have happened if SML had "won". In many ways it was pragmatically engineered in the early 90s, at a time where no other functional language was comparable (except maybe Caml). Its much-vaunted formal specification does leave a few pragmatics-shaped holes, however. For example, SML has no standardised way of splitting programs into multiple files. Each compiler does their own thing (although at least MLton and MLKit both support MLB files).
We haven't hit the limits of what the language is capable of and a major investment would drastically speed up the process.
I agree. I think about this a lot, and the hard part is that you need to either have an already existing ecosystem, or to have the resources to build one. If you want to leverage an existing ecosystem, the best bet would be Go I think, as .Net already has F#, Java has Scala (they are not the same but too close and would eat each other), JS has TS, some OCaml, Purescript. The other option could be to have an easy interop with Rust, as it's becoming quite big too, and perhaps fits SML more.
Investing in the ecosystem (tooling, VSCode support, packages) would vastly improve it, but it still has some warts compared to Haskell - no ability to auto derive implementations (like debugging/printing structures!), and lack of typeclasses can be painful at times.
I really like Rust because of how similar it is to what I believe SML could be - just take away ownership and change the syntax, and bam!
For a recap of the current state of Standard ML (also surprisingly active), here's a roundup from last year: https://notes.eatonphil.com/standard-ml-in-2020.html.
I loved SML; a language designer would do well to internalize its module signature design. One wants to do at least this well, while incorporating current ideas.
The main thing that SML brings to the table IMO is its definition. This specifically forces things to be well-defined, and hence well-thought-out, and thus prevents the adding of a bunch of bad features that later need to be maintained for the lifetime of the language.
There are many areas in which I think formal methods are overkill, but PLs are one of the exceptions. Any mistakes early on in the language are usually VERY hard to resolve.
Maybe it'll even be named OCaml if the efforts to bring effect typing into it are eventually merged :-).
> Maybe it'll even be named OCaml if the efforts to bring effect typing into it are eventually merged :-).
From what I read recently that's the plan, although they'll focus first on domains for 5.0, and merge the effects later.
> From what I read recently that's the plan, although they'll focus first on domains for 5.0, and merge the effects later.
Yes indeed! The timeline for typed effects is not clear to me, it might take a long time, especially with the stringent constraints of backward compatibility.
That said I'm not an expert, I'm just very hyped :-)
> The timeline for typed effects is not clear to me, it might take a long time, especially with the stringent constraints of backward compatibility.
From what I understand, the "long time" will be probably less than modular implicits, which are estimated at at least a few years away. There are a few informations here https://discuss.ocaml.org/t/multicore-ocaml-may-2021/7990 and here https://discuss.ocaml.org/t/multicore-ocaml-june-2021/8134, where at least we can see that the effect branch is up to date with 4.12. The performance seems really good, I can't find it anymore but they had the same performance as Go's net/http with http/af. It's a very exciting space!
the big issue is that you have to do a LOT of complex shuffling of types and values in order to deal with effects.
You can actually avoid a ton of this by thinking about purity in a less expression-level way, like how Koka does it. And, I think I'd probably try implementikng something like it (or eff) in my language.
You can always replicate laziness by making your own thunks. But this just isn't as convenient.
(I am not affiliated with Flix. I started following its development recently because it looked interesting.)
https://github.com/yallop/effects-bibliography
Lots of information on varieties of effect systems