Thursday, 9 April 2009

OCaml 3.11 moves into Debian testing!

The highly-anticipated OCaml 3.11 just made it into the current Debian testing distribution, codename Squeeze. Debian is a famously-robust Linux distribution with a superb packaging system and an army of expert package maintainers. Debian-based distributions such as Ubuntu account for over 70% of all Linux users. So this is excellent news for the tens of thousands of OCaml programmers who rely on Debian packages for their OCaml distribution!

This new version of OCaml includes several important improvements. Perhaps the most notable of which is the new support for lazy patterns that force lazy values only when they are required by the pattern matcher. This makes it easy to dissect lazy data structures such as lazy sequences using pattern matching and, consequently, will spark a marked change in data structure APIs. For example, it is now easy to expose a lazy sequence interface to a set data structure and use that to detect sets that contain exactly three elements. Previously, that would have been done by beginning a fold and terminating when three elements had been visited.

Another important new feature is native-code support for the Dynlink module that handles dynamically-loaded OCaml libraries or plugins.

Thank to everyone involved for making this happen! Needless to say, all of the new features provided by OCaml 3.11 will be covered in detail in The OCaml Journal.