Mitch Pronschinske is the Lead Research Analyst at DZone. Researching and compiling content for DZone's research guides is his primary job. He likes to make his own ringtones, watches cartoons/anime, enjoys card and board games, and plays the accordion. Mitch is a DZone Zone Leader and has posted 2577 posts at DZone. You can read more from them at their website. View Full User Profile

OCaml, Where Art Thou?

  • submit to reddit
A new point release for Objective Caml, the main implementation of Caml, has arrived this month with a surprising amount of new features.  OCaml combines functional, imperative, and object-oriented programming under an ML-like type system.  Languages such as F# and Scala were influenced by OCaml.

Here are some of the main new features in OCaml 3.12

  • Polymorphic recursion is now supported by using explicit type declarations on the recursively-defined identifiers.
  • First-class module support: module expressions can be embedded as values of the core language, and then manipulated like any other first-class value.  They are then projected back to the module level.
  • New operator to modify a signature a posteriori: S with type t := tau denotes signature S where the t type component is removed and substituted by the type tau elsewhere.
  • New notations for record expressions and record patterns: { lbl } as shorthand for { lbl = lbl }, and { ...; _ } marks record patterns where some labels were intentionally omitted.
  • Local open let open ... in ... now supported by popular demand.
  • Type variables can be bound as type parameters to functions; such types are treated like abstract types within the function body, and like type variables (possibly generalized) outside.
  • The module type of construct enables to recover the module type of a given module.
  • Explicit method override using the method! keyword, with associated warnings and errors.

Features like first class modules and the destructive signature operations should both make it easier to write libraries in OCaml.  You can find more changes in the compiler and libraries here.

The source and binaries are available here.  Binaries are available for Windows, Mac OS X, Linux, and Solaris.


Otengi Miloskov replied on Tue, 2010/08/17 - 2:35pm

Ocaml could be a good alternative to replace Oracle Java in the enterprise. Ocaml is true opensource as Ruby or Python but with lots of execution power and awesome syntax.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.