The OCaml system is open source software: the compiler is distributed under the terms of the Q Public License, and its library is under LGPL; please read the license document for more details. A BSD-style license is also available for a fee through the OCaml Consortium.
This page describes OCaml version 4.01.0, released on 2013-09-12. Go here for a list of all releases.
Some of the highlights in release 4.01 are:
It is now possible to have several variant constructors or record fields of the same name in scope, and type information will be used to disambiguate which one is used -- instead of always using the last one. See this post for a more detailed description of the feature.
New warnings can be activated to warn about identifiers that are used after having been shadowed by an
openkeyword can be written
open!to silence this warning (as
method!silences the method warning).
The compiler now suggests possible typos on "unbound identifier" errors.
Infix application operators
(@@)are added to
-short-pathoption changes the way the type-checker prints types to pick a short representation (eg.
This release saw a lot of polishing with sets of changes in many places: the type system for GADTs, compilation speed with
-bin-annot, ocamlbuild, the test suite, low-level optimizations, etc.
For more information, please consult the comprehensive list of changes.
- Source tarball (.tar.gz) for compilation under Unix (including Linux and MacOS X) and Microsoft Windows (including Cygwin).
- Also available in .tar.xz format.
- OPAM is a source-based distribution of OCaml and many companion libraries and tools. Compilation and installation are automated by powerful package managers.
- You also have read-only SVN access to the working sources and to all previous public releases.
The INSTALL file of the distribution provides detailed compilation and installation instruction.
Precompiled binaries for Linux
Precompiled binaries for MacOS X
Binary package compiled on Mac OS 10.7.5 with XCode tools 4.6.3 (probably not compatible with earlier versions of Mac OS X):
- for 64-bit Intel (4.01.0)
Precompiled binaries for Microsoft Windows
- Cygwin-based native Win32 port (4.00.0). A self installer. The interactive loop comes with a simple graphical user interface. Some features require the Cygwin environment, which the installer can fetch for you. However, the compilers are, and generate true Win32 executables, which do not require Cygwin to run.
- Microsoft-based native Win32 port. No binary distribution available yet; download the source distribution and compile it.
- Cygwin-based port. Requires Cygwin. No
graphical user interface is provided. The compilers generate
executables that do require Cygwin. The precompiled binaries are
part of the Cygwin distribution; you can install them using the
setuptool. Alternatively, download the source distribution and compile it under Cygwin.
- Microsoft-based native Win64 port Same features as the Microsoft-based native Win32 port, but generates 64-bit code. No binary distribution available yet; download the source distribution and compile it.
Precompiled binaries for Solaris
Available at sunfreeware.com.
Additionally, the following projects allow you to compile OCaml code to targets traditionally associated with other languages:
- The ocaml-java project, an OCaml to Java compiler (stable)
The user's manual for OCaml can be: