tags:

views:

551

answers:

6

Hello everyone,

What are the uses of SML in the real word?

Are its practical uses similar to that of Prolog?

A: 

I have only personally used it in university for a number theory course. I have to say I really enjoyed using it. It could handle huge numbers which was nice when dealing with cryptography.

If it matters I was using Moscow ML http://www.itu.dk/people/sestoft/mosml.html

Paul Whelan
+1  A: 

I haven't seen many commercial applications of ML, but this may be down to the available environments, rather than a reflection on the language. I've seen a number of banks using F# (which is the same family as ML) to process data streams, do matrix algebra and look for patterns. The fact that Microsoft have packaged it for .NET obviously helps no end.

dommer
+1  A: 

SML is used by compiler writers. Both Prolog and SML are used in theorem provers.

108
+1  A: 

Not SML, but closely related, is OCAML, which has been used for a number of things:

http://caml.inria.fr/about/successes.en.html

I rather like the "Faster Fourier Transform in the West" where ML is used to generate optimised C...

Paul
+2  A: 

ML is not directly comparable to Prolog. Prolog is a declarative logics programming language that is basically a theorem prover using Horn clauses. One of the nice characteristics of (non-pure Prolog) is that it will allow you to modify a program severely during compile or runtime. For instance, in most modern Prolog implementations you can directly write grammars using the DCG (definite clause grammar) formalism. Grammar rules using the '-->' operator are rewritten to Prolog clauses using term expansion. E.g.:

a(N) --> b, c(N).

Will be rewritten to:

a(P0,P2) --> b(P0,P1), c(N,P1,P2).

The use of position variables enforce adjacency of the daughters on the right hand side of the arrow. Since Prolog will try to prove the head of a clause by proving its daughters (by backtracking), you basically have a top-down left-right parser without any additional work. Another example of program modification is the assertion or retraction of (dynamic) facts or clauses, which can be used to modify the behavior of a program at runtime.

ML on the other hand is an impure functional language. The connection between Prolog and ML is that some theorem provers are written in ML. I'd say ML is far more general-purpose, but for its niches Prolog is a very convenient. Both are very useful to learn, even just for just widening your horizons.

danieldk
+4  A: 
Ville Laurikari