OCaml as a scripting language
ocaml.janestreet.com
ocaml.janestreet.com
It is quite nice for Unix development, due to some concessions to "impure" practices. I use the Unison file synchronization tool at work, and used to run mldonkey in my wild file-sharing days… That area is mostly dominated by C tools, as scripting languages are either too slow / memory intensive or carry a lot of baggage with their runtimes and libraries. And for a long time, OCaml was one of the few (open source) compilers at all that could produce fast and small (i.e. no full images) code for the free Unix variants.
But yeah, that article would have been better with some simple examples. Hope they're going to share one of these toplevels.
1. Eliminating runtime errors(type mismatches, segmentation faults, and null pointer exceptions are a few problems that have been hammered on a lot and in some languages eliminated entirely). 2. Being able to manage a large project effectively. Things like build systems, code editors, debuggers, and perhaps most of all, access to libraries/hardware for the problem domain.
Newer general-purpose languages(under ~5-10 years) tend to offer compelling features in the first case, but almost nothing in the second, which makes a commercial project in them an expensive prospect.
OCaml vs Scheme is harder for me to answer I haven't used Scheme that much. Static typing if you like that sort of thing.
As for usage scenarios: Compared to Scheme, you might like the syntax more, it's statically typed and has a very fast compiler that doesn't even need to use C as an intermediate language. Haskell is much more pure regarding its functional nature and thus its way of interacting with a state-ful world can seem a bit intimidating. If you don't have a lot of math under your belt, Caml's way of interpreting code is a bit easier to mentally model.
I've always thought of ML as the C to Haskell/Miranda's Pascal, for better or worse…
Library-wise, Caml has a very good foundation for writing Unix software. Haskell has made major steps in catching up, Scheme is still a bit balkanized (going from your teaching language to the Chicken/Gambit/PLT infrastructure is not much easier thank taking up Common Lisp).
I'm still surprised at how far Haskell has come in recent years in getting more libraries. It used to be slightly below Common Lisp in that regard, if my memory serves me. Now Hackage is huge. GHC always was a pretty good compiler, so nothing major about the language or its implementation changed. I also know of no big poster boy use cases, compared to e.g. Erlang. Linux hackers impressed by xmonad?
OCaml is a reasonable middle path. It has a lot in common with Haskell (H-M typing, ML syntax, pattern matching) and is largely pure, but doesn't absolutely force purity on a language level the same way Haskell does. Strictness is the default, with laziness as an option, so there are no surprising space leaks. IO is performed with IO functions, not with some bizarre monad that is the description of an action that would be performed.