What is SML used for?

CreamBun picture CreamBun · Apr 7, 2009 · Viewed 7.5k times · Source

What are the uses of SML in the real word?

Are its practical uses similar to that of Prolog?

Answer

Ville Laurikari picture Ville Laurikari · May 1, 2009

At work, we use SML in actual real-life software products which we ship to paying customers. We use MLton to compile our SML code to native code running on Windows, Linux, Solaris, AIX, and HP-UX. It works well, and we're happy with our choice.

I don't see SML as particularly suited to any clear niche. Indeed, SML is a very well-rounded general-purpose programming language. Prolog is well established in the logic programming/artifical intelligence/rule based system solving niche(s), but it's used for a lot of things besides these traditional domains.

For anyone who is considering using SML for a software project in the "real world", here are some of the advantages and disadvantages we've noticed so far:

  • SML is a very nice general programming language, especially the module system rocks
  • MLton optimizes so well that you can use abstractions freely without losing performance
  • Our old code is written in plain C. We can replace that piece by piece with SML, linking both C and SML code to the same executbles.
  • SML/NJ provides a repl for rapid development
  • Portable to all of our platforms

Disadvantages:

  • Miniscule user base
  • Lacking in the supporting tools area (IDE, code documentation, debuggers, etc.)
  • I had to actually port MLton myself to AIX and HP-UX