What are the uses of SML in the real word?
Are its practical uses similar to that of Prolog?
What are the uses of SML in the real word?
Are its practical uses similar to that of Prolog?
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:
Disadvantages:
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(N,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.
SML is used by compiler writers. Both Prolog and SML are used in theorem provers.
The FoxNet project from Carnegie Mellon Univ is built using SML.
Jane Street Proprietary trading company, use the O'Caml for their own in-house built software.
Laurance C. Paulson, the author of ML for the Working Programmer, used SML to build Isabell, an LCF theorem prover.
Philip Wadler, a professor and Haskell expert, maintains a list of real world projects that use Functional Programming, among these projects are ones that use ML, located at http://homepages.inf.ed.ac.uk/wadler/realworld/
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
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.
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...
© 2022 - 2024 — McMap. All rights reserved.