Penguin
Note: You are viewing an old revision of this page. View the current version.

(I'm not completely happy with this description, but I'm bored now and want to press Save --GlynWebster)

ML is a family of functional ProgrammingLanguages?. The other two widely used functional programming language families are LISP and Haskell.

Unlike LISP, ML all type checking is done at compile time. You don't need to declare the type of every variable though, an ML compiler can usually determine the variable's type bu analyzing how it is used. The type system is close to Haskell's. (It is "polymorphic" but does not have "type classes".)

ML has a vaguely Pascal-like syntax. It's not pretty, but it's not LISP.

Unlike Haskell, ML is not "lazy": functions evaluate their arguments before the function is called. This means you can predict the order that ML expressions will be evaluated in, ML can allow variables to be reassigned and the I/O system can be more conventional. It also means some of the fancier functional Haskell programming tricks that rely on delayed evaluation are ruled out, but if you've programmed in Haskell you're probably more relived than disappointed to here this.

There is a short history of the original ML on FOLDOC.

Ocaml vs SML

Ocaml? and SML are the two major variants of ML. They are fairly different.

  • SML has a cleaned up syntax, Ocaml's syntax is more traditional (Here's a comparison).
  • SML has very thorough standard library; Ocaml's is smaller but there are a lot of third party libraries.
  • Ocaml compiler has a small fast compiler that produce good native code,
  • Ocaml supports OOP and you can extend its syntax; so there's potentially more you can do with it.
  • SML has a standard which it conforms to, whereas OCaml does not. I've been told that OCaml adds features in a very hap-hazard way (although I cannot confirm this myself, as I haven't used it much at all) -- GianPerrone

There is a single OpenSource implementation of Ocaml. A large community of users who don't want their code broken pressure the team mantaining that implementation to keep new versions standard, or at least backwards compatible. Python and Perl are developed the same way. It's not ideal but it seems to work. --GlynWebster

--- Two in the morning.
I have ordered more cheese puffs
They will not arrive.