4 ms·
Whenever this comes up, the answer seems to be "for programming language research and proofs in academia" and not much else. It's a pity. SML is in many ways a
by cannam 8y ago
Whenever this comes up, the answer seems to be "for programming language research and proofs in academia" and not much else.
It's a pity. SML is in many ways a joy to work with. The language doesn't change, which is a nice thing in itself in the current climate, but it has many things people still look for in modern languages (type inference, pattern matching, a module system). Multiple compliant compilers are available that produce fast code. The syntax is delightful, relying on neither brace delimiters nor syntactic whitespace. The language and Basis library are small enough that a developer can realistically aim to learn the whole thing. It is a comfortably idiomatic general-purpose functional language: lacking object or procedural syntax but relaxed about side-effects and occasional use of mutable types.
There are problems. Everyone will have their own list of things they expect a language to have, that SML lacks (mine: a map container in the standard library; record updating without rebinding all the elements individually; universal printf/toString, no matter how hacky). There is no standard foreign-function interface for calling native libraries, and no standard memory model - each compiler has its own. There is no standard build system (though I dunno, maybe this is a good thing). Libraries are sorely lacking, although those written many years ago usually still work. Because the language is a stem for academic developments, there are several variations that are intriguing but not actually compatible - CakeML seems to be an example, as it doesn't support functors or records.
I find SML pretty nice for writing small command-line utilities - like a functional alternative to Go or Python.
- jcelerier 8y ago> It's a pity. SML is in many ways a joy to work with. The language doesn't change, which is a nice thing in itself in the current climate, but it has many things people still look for in modern languages (type inference, pattern matching, a module system). Multiple compliant compilers are available that produce fast code. The syntax is delightful, relying on neither brace delimiters nor syntactic whitespace. is it now ? Caml has been taught for a long time to a lot of to-be engineering students in france, and it was frankly almost universally hated ; likewise for people that are taught LISP.
- cannam 8y ago> is it now ? Well of course I think so, since I said it... But - > Caml has been taught for a long time to a lot of to-be engineering students in france, and it was frankly almost universally hated It's possible to wonder why a language like SML doesn't get more use outside academia, since so many people have been taught it as students. And it seems a reasonable explanation that many people who were taught these languages simply disliked the experience. If you're forced to learn a weird non-procedural language with no obvious application and a super-picky type checker that you can't understand, why would you like it? I had a vaguely similar experience myself, when taught SML as a student in the 90s. I enjoyed it as an exercise, but by the end of the course I still didn't have any useful intuition for how to write a whole program in it. Meanwhile over on the C++ course, the object/procedural mix seemed to make more obvious sense as a way to structure things. Now, after years working in C++, I think of SML as the easier language and in many ways more natural.