Monolune

Is Standard ML dead?

The typical feature of a mainstream programming language is a lively community that writes lots of code using that language, and produces tools and libraries. The quantity and maturity of tools and libraries are what programmers now consider to be the most important criteria for choosing a language to use in production. Standard ML neither has a lively community nor does it have tons of libraries and a mature ecosystem to make it attractive to newcomers (not to mention experienced programmers).

A quick browse at the Standard ML subreddit reveals a tiny community of users, and Stack Overflow's Standard ML tag seems to be mostly used by students who need to solve their homework problems. The library situation is not any better either. Yes, there is the Basis Library, which is great for what it does, but it's too minimal for what most projects may need. Open source libraries on GitHub are almost non-existent. The most popular Standard ML repositories on GitHub seem to be compilers and theorem provers. Those are certainly fine projects, but they can hardly be relied on to push Standard ML more into the mainstream. What more people need are JSON parsers, web servers, Unicode support, libraries to interact with the outside world, etc. Sure, Standard ML is an old language whose latest standard predates the Unicode standard, but the lack Unicode support is a huge turnoff for most enterprise applications. Nowadays, built-in first class Unicode support is essential, but Standard ML does not have it.

This is all a shame because enterprise software can greatly benefit from type-safe programs which saves a lot of head scratching. Standard ML is far more capable of abstraction and composition than usual, with functions as first class values. It is easier to express many things in Standard ML that would be clumsy (or even unimaginable) in mainstream imperative languages. The language was made for theorem proving, and its use may encourage enterprises to pay more attention to the correctness of at least a subset of the programs they write. A world with less potential software bugs is a better one.

There are some bright spots in all this. Standard ML is still being used to teach introductory programming, or introductory courses that explore programming paradigms. This is a testament to Standard ML's simplicity and power of expression. It is an easy language to think in, and that makes it appealing for educational use. One could experience strongly typed functional programming using OCaml or Haskell, but Standard ML is by far the simplest. With the resurgence of interest in functional programming, I often wonder why Standard ML is not usually one of the languages being considered for learning. For educational use, the lack of libraries may actually be a benefit. There are no distractions, and most of the community is focussed on computer science instead of chasing the next big software engineering trend. The University of Cambridge still uses Standard ML for its introductory computer science course. I hope the educational use continues.

Lots of people are able to see the benefits of languages like Standard ML, but it's frustrating to not be able to use these languages in production. There is always OCaml, but after experiencing Standard ML, OCaml feels heavy and the syntax looks less beautiful. I guess you can't always have everything you want. What we need is an update to the Standard ML standard to make the language more relevant for the uses of this century, but unfortunately, that is not likely to happen. I hope Standard ML lives a long life even as it fades into obscurity. Maybe Standard ML will always live, at least in the ideas that it has passed on to other languages, and in the memory of those who have used it to reach greater heights in understanding computer science.