Some compelling reasons to learn and use OCaml:
Hybrid vigor. OCaml is a functional (applicative) programming language, but also an imperative language, and also an object-oriented language. This means you can mix and match paradigms at will. If you need extreme speed or frugal memory usage and the functional aspects are getting in your way, you can write an imperative function or two (not an option with a purely functional language like Haskell). And you needn't structure your entire application in an object-oriented fashion (the way you must with Java, for example) -- only the parts where that's appropriate.
Extremely efficient implementation. Different "scripting languages" (e.g., Perl, Python, Tcl, PHP) naturally differ in how fast they execute. But compared to C or C++, they are all so slow -- an order of magnitude slower -- that they can be considered together in one speed category. Why wait for your successful program, implemented in your favorite scripting language, to disappoint you by not scaling as your users push its boundaries? OCaml is basically as fast as C. Time for a powerful, high-level, type-safe language (i.e. not C or C++) that's truly fast.
Strong static typing with type inference. OCaml is a strongly-typed language (which means no core dumps and eliminates a large class of data corruption problems) which is statically typed (which means that OCaml detects type conflicts -- a large class of bugs -- at compile-time rather than at run-time, perhaps months after your application is in production) and polymorphically typed (meaning that you can write one function that manipulates a list (array, ...) regardless of what type (integers, strings, ...) that list contains). And it achieves this without requiring you to write type declarations for your variables or functions. More details.
Single-file Deployment. With its traditional compiler-and-linker technology, OCaml allows you to deploy your application as a single-file executable, with no prerequisites on the target system (such as an installed interpreter or installed third-party libraries). More details.
Extensive Libraries. OCaml comes with an extensive standard library with good data structures, POSIX system calls, and networking primitives. Third-party libraries contributed by the community support high-level network APIs, databases, XML, Unicode, and much more. More details.
True Static Scope with Closures. OCaml has true nested scope: in other words, you can define functions inside of other functions (recursively). This may not sound impressive -- after all, nested functions have been around since Algol 60 -- until you remember that C's "innovation" of not allowing nested functions was widely copied and many languages that were designed after C likewise disallow it.
Nested functions as an encapsulation technique gives you the most bang for the buck: it's dead simple, with no special syntax or semantic restrictions to learn, and yet lets you break your program down into many tiny little functions which are truly easy to debug (or just write correctly in the first place). OCaml's static scope lets you avoid passing dozens of parameters to these inner functions, and allows you to safely capture the local variables of enclosing functions, forming closures that replace many uses of:
for free. (Of course, OCaml has more powerful encapsulation techniques -- parameterized modules and true objects -- for when you need them; but with nested functions and static scope, you won't need them as often.)
Pattern Matching. OCaml allows you to use pattern matching in your function definitions. As a result, the structure of the function models the structure of the data it's processing, making it easy to see base cases and harder to miss a case, as you might using conditionals. In fact, OCaml's type checker can often warn you that you've left out a case. For example, this definition:
let rec listlength = function | car::cdr -> 1 + listlength cdr
results in this warning:
let rec listlength = function | car::cdr -> 1 + listlength cdr ;; Warning: this pattern-matching is not exhaustive. Here is an example of a value that is not matched: [] val listlength : 'a list -> int = <fun>
because I forgot to cover the case of the empty list ([]). (Pattern matching works both with the built-in data types and with user-defined data types.) Simultaneously, pattern matching eliminates the need for multiple-value returns, and serves as a general-purpose destructuring bind. Finally, many functional languages restrict pattern matching syntactically to function definitions; OCaml's pattern matching is an expression that can be used anywhere.
Parametric, Strongly-Typed, Separately-Compilable Module System. OCaml gives you namespaces, information hiding and abstract types via its module system. The module system is strongly and staticly typed, even across file boundaries, which allows separate compilation. More details.
Syntax Extension. OCaml allows you to arbitrarily extend the syntax of the language, achieving effects as with Lisp macros. This is done through the camlp4 Pretty-Printing Pre-Processor. When you use it, it completely replaces the parser component of the compiler and feeds a parse tree directly to the compiler for type checking and code generation. Amazingly (for a conventional compiled language), you can also use your revised syntax interactively in the top-level. Syntax extensions are separately-compiled into loadable modules; as a result many third-party extensions are available, ranging from syntactic-sugarings of regular expressions, interpolation of variables and expressions into strings (e.g. "Mr. $lastname has arrived."), and special XML syntax:
let mkHtm title body = XML { <HTML> <HEAD> <TITLE> title </> </> <BODY> body </> </> }
to complete re-workings of the syntax of the language.
Portability. OCaml is very portable. The byte-code interpreter compiles and runs on any POSIX-compliant system with an ANSI C compiler. The generated byte-code files are also completely portable across OS and CPU boundaries.
The most impressive thing is the wide variety of systems that OCaml's native-code compiler runs on (and generates code for). Under pretty much any Unix (BSD, Linux, Mac OS X, SunOS-4, SunOS-5, and more), it runs on Intel Pentiums, AMD 64, Alpha, Sparc, Mips, HP PA-RISC, PowerPC, Strong ARM, and Intel IA64 (Itanium). It also runs on Intel Pentiums under Windows (95, 98, NT, ME, 2000, XP). My only complaint is that the native-code compiler doesn't cross-compile.
Good Development Tools. The OCaml distribution comes with a very good suite of development tools. Of course you get the byte-code and native-code compilers, the byte-code interpreter and the interactive top-level. (Note that this means you can evaluate OCaml code interactively the way you would with Lisp or Tcl, as well as compile standalone executables linked with all your libraries, the way you would with C or C++.) But it also comes with a debugger and a profiler for the byte-code (native-code applications are profiled with gprof). The debugger deserves special mention: it's what is sometimes called a time travel debugger, in that you can not only step execution forward, but backwards -- going back in time to see previous values of variables. This is a real treat after years of stepping debuggers one step forward too many and then having to start over! I should also mention that the OCaml interactive top-level has a trace facility that's very easy to use and often obviates the need to use the debugger (at least when you have a reasonable idea of which function your bug is in).
Also included are a Makefile dependency generator (but I think there are better third-party tools) and a simple GUI environment with a syntax-highlighting editor, type-checker, and a browser (much like the class browser in an OO system) for browsing compiled modules (the browser is interesting, but Emacs or Xemacs makes a much more powerful development environment).
You also get a lexical-analyzer generator (like Unix's lex) and a parser generator (like Unix's yacc), and a documentation generator that produces documentation in many formats (HTML, LaTeX, etc) from stylized comments in your code.
An Emacs caml-mode is included, but I highly recommend you use Albert Cohen's stupendous tuareg-mode instead; it's probably the best language mode for Emacs I've ever used, and that's saying something. Full integration with the interactive top-level, the compilers, and the debugger, of course.
In addition there are loads of useful third-party development tools in the Humps.