Releases
The history of OCaml releases with a summary and a complete changelog, as well as the manual at that time.
34 Releases
Version
Date
Actions
- Syntax for deep effect handlers
- Restored MSVC port
- Re-introduced statistical memory profiling
- More space-efficient implementation of Dynarray
- utf-8 encoded Unicode source files and modest support of Unicode identifiers
- Improved metadata on the pairs of declarations and definitions for merlin.
- Around 20 new functions in the standard library
- Many fixes and improvements in the runtime
- Improved error messages for first-class modules, functors, labeled arguments,type clashes.
- Numerous bug fixes
- Bug fixes for 5.2.0
- Reintroduced GC compaction
- Restored native backend for POWER 64 bits
- Thread sanitiser support
- New Dynarray module
- New
-H
flag for hidden include directories - Project-wide occurrence metadata support for developer tools
- Raw identifiers
- Local open in type expressions
- Around 20 new functions in the standard library
- Many fixes and improvements in the runtime
- Many bug fixes
- Marshall.Compression flag removed from the standard library
- Bug fixes for 5.1.0
- Many runtime performance regression and memory-leaks fixes(dynlinking, weak array, weak hash sets, GC with idle domains, GC prefetching)
- Restored support for native code generation on RISC-V and s390x architectures
- Restored Cygwin port
- Reduced installation size (50% reduction)
- Compressed compilation artefacts (.cmi, .cmt, .cmti, .cmo, .cma files)
- 19 error message improvements
- 14 standard library functions made tail-recursive with Tail-Recursion-Modulo-Cons (TRMC), such as
List.append
andList.map
- 57 new standard library functions
- More examples in the standard library documentation
- 42 bug fixes
OCaml 5.0.0 introduces a completely new runtime systemwith support forshared memory parallelism andeffect handlers.
- Bug fixes for 4.14.1
- Bug fixes for 4.14.1
Some of the highlights in OCaml 4.14.0 are:
- Integrated support for "go to definitions" in Merlin.
- Standard library: new modules In_channel and Out_channel,many new functions in Seq module, UTF decoding and validation supportfor strings and bytes.
- Runtime optimisation: GC prefetching. Benchmarks show a speedup of around 20%in GC-heavy programs.
- Improved error messages in particular for module-level error.
- Deprecated functions and modules in preparation for OCaml 5.In particular, the Stream and Genlex modules are now deprecated.
- Type variables can be explicitly introduced in value and variant constructordeclarations. For instance,
can now be written asvalfold:('acc->'elt->'acc)->'acc->'eltlist->'acctypeshowable=Show:'a*('a->string)->showable
valfold:'acc'elt.('acc->'elt->'acc)->'acc->'eltlist->'acctypeshowable=Show:'a.'a*('a->string)->showable
- Tail-call with up to 64 arguments are now guaranteed to be optimizedfor all architectures.
- Experimental tail modulo cons (TMC) transformation
- Bug fixes for 4.13.0
- Safe points: a multicore prerequisite that ensures that ocamlopt-generated code can always be interrupted.
- The best-fit GC allocation policy is the now default policy (and many other GCs improvements.
- Named existential type variables in pattern matching
Showable (type a) (x, show : a * (a -> string))
. - Improved error messages for functor application and functor types.
- Let-punning for monadic let:
let* x = x in
can be shortened tolet* x in
. - Module type substitutions
SIG with module type T = F(X).S
. - Many other quality of life improvements
- Many bug fixes
- Bug fixes for 4.12.0
- Major progress in reducing the difference between the mainline andmulticore runtime
- A new configuration option
ocaml-option-nnpchecker
which emits an alarmwhen the garbage collector finds out-of-heap pointers that could cause a crashin the multicore runtime - Support for macOS/arm64
- Mnemonic names for warnings
- Many quality of life improvements
- Many bug fixes
- Bug fixes for 4.11.1
- Bug fixes for 4.11.0
- Statmemprof: a new statistical memory profiler
- A new instrumented runtime that logs runtime statistics in a standard format
- A native backend for the RISC-V architecture
- Improved backtraces that refer to function names
- Suppport for recursive and yet unboxed types
- A quoted extension syntax for ppxs.
- Many quality of life improvements
- Many bug fixes.
- Bug fixes for 4.10.1
- Bug fixes for 4.10.0
- A new best-fit allocator for the major heap which reducing both GC cost anmemory usage.
- Immutable strings are now enforced at configuration time
- User-defined indexing operators for multidimensional arrays
- Coming soon: statmemprof, a new statistical memory profiler. The external APIwill be release next version.
- Miscellaneous improvements to the manual
- A more precise exhaustiveness check for GADTs
- Many bug fixes
- Bug fixes for 4.09.0
- New optimisations, in particular for affine functions in matches, for instance
typet=A|B|Cletaffine=function|A->4|B->3|C->2
- The
graphics
library was moved out of the compiler distribution. - The
vmthread
library was removed. - Support for compiler plugins was removed.
- Many bug fixes.
- Bug fixes for 4.08.0
- Binding operators (
let*
,let+
,and*
, etc). They can be used tostreamline monadic code. open
now applies to arbitrary module expression in structures andto applicative paths in signatures.- A new notion of (user-defined) "alerts" generalizes the deprecatedwarning.
- New modules in the standard library:
Fun
,Bool
,Int
,Option
,Result
. - A significant number of new functions in
Float
, including FMA support,and a newFloat.Array
submodule. - Source highlighting for errors and warnings in batch mode.
- Many error messages were improved.
- Improved AFL instrumentation for objects and lazy values.
- Bug fixes for 4.07.0
- The standard library is now packed into a module called
Stdlib
, which isopen by default. This makes it easier to add new modules to the standardlibrary without clashing with user-defined modules. - The
Bigarray
module is now part of the standard library. - The modules
Seq
,Float
were added to the standard library. - Improvements to several error and warning messages printed by thecompiler make them much easier to understand.
- Many improvements to flambda.
- Removed the dependency on curses/terminfo/termcap.
- The SpaceTime profiler now works under Windows.
- Bug fixes for 4.06.0
Strings (type
string
) are now immutable by default. In-placemodification must use the typebytes
of byte sequences, which isdistinct fromstring
. This corresponds to the-safe-string
compile-time option, which was introduced in OCaml 4.02 in 2014, andwhich is now the default.Object types can now extend a previously-defined object type, as in
<t; a: int>
.Destructive substitution over module signatures can now express moresubstitutions, such as
S with type M.t := type-expr
andS with module M.N := path
.Users can now define operators that look like array indexing, e.g.
let ( .%() ) = List.nth in [0; 1; 2].%(1)
New escape
\u{XXXX}
in string literals, denoting the UTF-8encoding of the Unicode code pointXXXX
.Full Unicode support was added to the Windows runtime system. Inparticular, file names can now contain Unicode characters.
An alternate register allocator based on linear scan can be selectedwith
ocamlopt -linscan
. It reduces compilation time compared withthe default register allocator.The Num library for arbitrary-precision integer and rationalarithmetic is no longer part of the core distribution and can befound as a separate OPAM package.
- Some improvements in performance and usability.
- Many bug fixes
Exceptions can be declared locally within an expression, with syntax
let exception ... in ...
Optimized memory representation for immutable records with a singlefield, and concrete types with a single constructor with a singleargument. This is triggered with a
@@unboxed
attribute on the typedefinition.Support for the Spacetime memory profiler was added.
A new intermediate representation, called Flambda, was added to thenative-code compiler, along with several new optimizations over theFlambda representation, such as aggressive function inlining. (TheFlambda optimizer needs to be activated at configuration time by
./configure -flambda
.)New language feature: inline records as arguments to datatypeconstructors. This makes it possible to name the arguments of aconstructor, and use convenient record notation to access them,without the cost of declaring a separate record type for thearguments.
The
@unboxed
and@untagged
attributes are supported on externalfunction declarations to pass parameters and results to C stubfunctions in a more efficient way. Other attributes honored by thecompiler include@tailcall
and@inline
.Improvements to the garbage collector, resulting in better GClatency (shorter GC pauses).
Support for ephemerons, a more general form of GC finalization ofdata structures.
The runtime system is now compiled at higher levels of Coptimization, resulting in significant speedups for the bytecodeinterpreter.
New native code generators supporting the PowerPC 64-bitarchitecture (in big and little-endian modes) and the IBM zSystemarchitecture.
The whole code base (compilers, libraries and tools) is now licensedunder the LGPL v2.1 with static linking exception.
The ocamlbuild compilation manager was split off and lives as anindependent project.
In a first step towards making strings immutable, a type bytes ofmutable byte arrays and a supporting library module
Bytes
wereintroduced. By default,bytes
is a synonym forstring
, soexisting code that mutates values of typestring
still compiles,with warnings. Option-safe-string
separates the typesstring
andbytes
, making strings immutable.The
match
construct was extended to discriminate not just on thevalue of its argument expression, but also on exceptions arising outof the evaluation of this expression. This solves an old problem: inalet x = a in b
, catch exceptions raised bya
but not thoseraised byb
.Module aliases (giving an alternative name to an existing module orcompilation unit, as in
module M = AnotherModule
) are now trackedspecially by the type system and the compiler. This enables not onlymore precise typing of applicative functors, but also more precisedependency analysis at link-time, potentially reducing the size ofexecutables.Annotations can now be attached to most syntactic elements of OCamlsources (expressions, definitions, type declarations, etc). Theseannotations are used by the compiler (e.g. to warn on uses offunctions annotated as deprecated) but also by "ppx" preprocessors,to guide rewriting of abstract syntax trees.
Extensible data types can be declared (
type t = ..
) then laterextended with new constructors (type t += A of int
). Thisgeneralizes the handling of the exn type of exception values.Functors and functor applications can now take a special () argumentto force generativity of abstract types.
New toplevel directives
#show_type
,#show_modules
, etc, to querythe toplevel environment.Performance of
ocamlopt
-generated code is improved on someprograms through more aggressive constant propagation, two newoptimization passes (dead code elimination and common subexpressionelimination), better compilation of pattern-matching over strings,optimized representation of constant exceptions, and GC tuning forlarge memory heaps.The format strings argument of
printf
functions are nowrepresented as a GADT. This speeds up theprintf
functionsconsiderably, and leads to more precise typechecking of formatstrings.The native-code compiler now supports the AArch64 (ARM 64 bits)architecture.
The Camlp4 preprocessor and the Labltk library were split off thedistribution. They are now separate projects.
It is now possible to have several variant constructors or recordfields of the same name in scope, and type information will be usedto disambiguate which one is used -- instead of always using thelast one. Seethispostfor a more detailed description of the feature.
New warnings can be activated to warn about identifiers that areused after having been shadowed by an
open
construct. Theopen
keyword can be writtenopen!
to silence this warning (asmethod!
silences the method warning).The compiler now suggests possible typos on "unbound identifier" errors.
Infix application operators
(|>)
and(@@)
are added toPervasives
.The
-short-path
option changes the way the type-checker printstypes to pick a short representation (eg.string
instead ofStringSet.elt
).This release saw a lot of polishing with sets of changes in manyplaces: the type system for GADTs, compilation speed with
-bin-annot
, ocamlbuild, the test suite, low-level optimizations,etc.
The name the language is now officially "OCaml", and this name isused consistently in all the documentation and tool outputs.
Generalized Algebraic Data Types (GADTs): this is a powerfulextension of the type system that provides great flexibility andpower to the programmer.
A new and improved ARM back-end.
Changes to first-class modules: type annotations can now be omittedwhen packing and unpacking modules (and are inferred from contextwhenever possible), and first-class modules can now be unpacked bypattern-matching.
Support for randomized hash tables to avoid denial-of-servicevulnerabilities.
Installation of the compiler's internal libraries in
+compiler-libs
for easier access by third-party programming tools.
Polymorphic recursion is supported, using explicit type declarationson the recursively-defined identifiers.
First-class modules: module expressions can be embedded as values ofthe core language, then manipulated like any other first-classvalue, then projected back to the module level.
New operator to modify a signature a posteriori:
S with type t := tau
denotes signatureS
where thet
typecomponent is removed and substituted by the typetau
elsewhere.New notations for record expressions and record patterns:
{ lbl }
as shorthand for{ lbl = lbl }
, and{ ...; _ }
marks recordpatterns 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; suchtypes are treated like abstract types within the function body, andlike type variables (possibly generalized) outside.
The
module type of
construct enables to recover the module type ofa given module.Explicit method override using the
method!
keyword, withassociated warnings and errors.