Ocaml Versions Save

The core OCaml system: compilers, runtime system, base libraries

4.07.0

5 years ago
  • The standard library is now packed into a module called Stdlib, which is open by default. This makes it easier to add new modules to the standard library without clashing with user-defined modules.

  • The modules Seq (functional iterators) and Float (floating-point operations) were added to the standard library.

  • Improvements to several error and warning messages printed by the compiler make them easier to understand.

  • Many improvements to flambda. In particular, compilation times are reduced, as well as the size of the generated .cmx files when using the -Oclassic optimisation level.

  • The GC should handle the accumulation of custom blocks in the minor heap better; this solves some memory-usage issues observed by code which allocates a lot of small custom blocks, typically small bigarrays.

  • Removed the dependency on curses/terminfo/termcap.

  • The SpaceTime profiler now works under Windows.

  • The HTML manual was restyled and looks nicer.

See also: detailed list of changes

4.00.0

5 years ago
  • The name the language is now officially "OCaml", and this name is used consistently in all the documentation and tool outputs.
  • Generalized Algebraic Data Types (GADTs): this is a powerful extension of the type system that provides great flexibility and power to the programmer.
  • A new and improved ARM back-end.
  • Changes to first-class modules: type annotations can now be omitted when packing and unpacking modules (and are inferred from context whenever possible), and first-class modules can now be unpacked by pattern-matching.
  • Support for randomized hash tables to avoid denial-of-service vulnerabilities.
  • Installation of the compiler's internal libraries in +compiler-libs for easier access by third-party programming tools.

See also: detailed list of changes.

4.00.1

5 years ago

Bug fixes. See detailed list of changes.

4.01.0

5 years ago
  • 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 open construct. The open keyword 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 (|>) and (@@) are added to Pervasives.

  • The -short-path option changes the way the type-checker prints types to pick a short representation (eg. string instead of StringSet.elt).

  • 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.

See also: detailed list of changes.

4.02.3

5 years ago

Bug fixes. See detailed list of changes.

4.02.2

5 years ago
  • Add a new class of binary operators with the same syntactic precedence as method calls; these operators start with # followed by a non-empty sequence of operator symbols (for instance #+, #!?). It is also possible to use # as part of these extra symbols (for instance ##, or #+#); this is rejected by the type-checker, but can be used e.g. by ppx rewriters.
  • Add a nonrec keyword for type declarations, allowing to write type nonrec t = t.

See also: detailed list of changes.

4.02.1

5 years ago

Bug fixes. See detailed list of changes.

4.02.0

5 years ago

Some of the highlights in release 4.02 are:

  • In a first step towards making strings immutable, a type bytes of mutable byte arrays and a supporting library module Bytes were introduced. By default, bytes is a synonym for string, so existing code that mutates values of type string still compiles, with warnings. Option -safe-string separates the types string and bytes, making strings immutable.

  • The match construct was extended to discriminate not just on the value of its argument expression, but also on exceptions arising out of the evaluation of this expression. This solves an old problem: in a let x = a in b, catch exceptions raised by a but not those raised by b.

  • Module aliases (giving an alternative name to an existing module or compilation unit, as in module M = AnotherModule) are now tracked specially by the type system and the compiler. This enables not only more precise typing of applicative functors, but also more precise dependency analysis at link-time, potentially reducing the size of executables.

  • Annotations can now be attached to most syntactic elements of OCaml sources (expressions, definitions, type declarations, etc). These annotations are used by the compiler (e.g. to warn on uses of functions annotated as deprecated) but also by "ppx" preprocessors, to guide rewriting of abstract syntax trees.

  • Extensible data types can be declared (type t = ..) then later extended with new constructors (type t += A of int). This generalizes the handling of the exn type of exception values.

  • Functors and functor applications can now take a special () argument to force generativity of abstract types.

  • New toplevel directives #show_type, #show_modules, etc, to query the toplevel environment.

  • Performance of ocamlopt-generated code is improved on some programs through more aggressive constant propagation, two new optimization passes (dead code elimination and common subexpression elimination), better compilation of pattern-matching over strings, optimized representation of constant exceptions, and GC tuning for large memory heaps.

  • The format strings argument of printf functions are now represented as a GADT. This speeds up the printf functions considerably, and leads to more precise typechecking of format strings.

  • The native-code compiler now supports the AArch64 (ARM 64 bits) architecture.

  • The Camlp4 preprocessor and the Labltk library were split off the distribution. They are now separate projects.

See also: detailed list of changes.

4.03.0

5 years ago
  • A new intermediate representation, called Flambda, was added to the native-code compiler, along with several new optimizations over the Flambda representation, such as aggressive function inlining. (The Flambda optimizer needs to be activated at configuration time by ./configure -flambda.)
  • New language feature: inline records as arguments to datatype constructors. This makes it possible to name the arguments of a constructor, and use convenient record notation to access them, without the cost of declaring a separate record type for the arguments.
  • The @unboxed and @untagged attributes are supported on external function declarations to pass parameters and results to C stub functions in a more efficient way. Other attributes honored by the compiler include @tailcall and @inline.
  • Improvements to the garbage collector, resulting in better GC latency (shorter GC pauses).
  • Support for ephemerons, a more general form of GC finalization of data structures.
  • The runtime system is now compiled at higher levels of C optimization, resulting in significant speedups for the bytecode interpreter.
  • New native code generators supporting the PowerPC 64-bit architecture (in big and little-endian modes) and the IBM zSystem architecture.
  • The whole code base (compilers, libraries and tools) is now licensed under the LGPL v2.1 with static linking exception.
  • The ocamlbuild compilation manager was split off and lives as an independent project.

See also: detailed list of changes.

4.04.0

5 years ago
  • Exceptions can be declared locally within an expression, with syntax let exception ... in ...

  • Optimized memory representation for immutable records with a single field, and concrete types with a single constructor with a single argument. This is triggered with a @@unboxed attribute on the type definition.

  • Support for the Spacetime memory profiler was added.

See also: detailed list of changes.