Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] OCaml 3.01 released
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: [Caml-list] OCaml 3.01 released
Version 3.01 of the Objective Caml system is now available from the
usual places:

No major novelties in this release (see detailed list below), but a
few convenience features were added:

  - variables in "or" patterns, as in "match l with [t] | [_;t] -> ... t ...";
  - "include" in structures to reexport all components of a structure
    inside another structure;
  - variance annotations on abstract type declarations;
  - the bytecode interpreter can print a call stack backtrace when
    an uncaught exception aborts the program;
  - option "-I +<subdir>" to refer to a subdirectory of the standard library

In addition, compilation of pattern-matching was revised and generates
much better code on complex matchings, especially those involving "or"
patterns.  Finally, the system was ported to Cygwin (Cygnus/RedHat's
Unix compatibility environment for Windows), and Cygwin binaries are
distributed along with the previous native Win32 port.

For general info on Objective Caml, see  Bug
reports go to, questions to,
and general discussions to the mailing-list or the newsgroup.

- Xavier Leroy, for the Objective Caml team.

Objective Caml 3.01:

New language features:
- Variables are allowed in "or" patterns, e.g.
     match l with [t] | [_;t] -> ... t ...
- "include <structure expression>" to re-export all components of a
  structure inside another structure.
- Variance annotation on parameters of type declarations, e.g.
    type (+'a,-'b,'c) t (covariant in 'a, contravariant in 'b, invariant in 'c)

New ports:
- Intel IA64/Itanium under Linux (including the native-code compiler).
- Cygwin under MS Windows.  This port is an alternative to the earlier
  Windows port of OCaml, which relied on MS compilers; the Cygwin
  Windows port does not need MS Visual C++ nor MASM, runs faster
  in bytecode, and has a better implementation of the Unix library, 
  but currently lacks threads and COM component support.

- Relaxed "monomorphic restriction" on type constructors in a 
  mutually-recursive type definition, e.g. the following is again allowed
    type u = C of int t | D of string t and 'a t = ...
- Fixed name-capture bug in "include SIG" and "SIG with ..." constructs.
- Improved implicit subtypes built by (... :> ty), closer to intuition.
- Several bug fixes in type-checking of variants.
- Typing of polymorphic variants is more restrictive:
   do not allow conjunctive types inside the same pattern matching.
   a type has either an upper bound, or all its tags are in the lower bound.
  This may break some programs (this breaks lablgl-0.94).

Both compilers:
- Revised compilation of pattern matching.
- Option -I +<subdir> to search a subdirectory <subdir> of the standard
  library directory (i.e. write "ocamlc -I +labltk" instead of 
  "ocamlc -I /usr/local/lib/ocaml/labltk").
- Option -warn-error to turn warnings into errors.
- Option -where to print the location of the standard library directory.
- Assertions are now type-checked even if the -noassert option is given,
  thus -noassert can no longe change the types of modules.

Bytecode compiler and bytecode interpreter:
- Print stack backtrace when a program aborts due to an uncaught exception
  (requires compilation with -g and running with ocamlrun -b or

Native-code compiler:
- Better unboxing optimizations on the int32, int64, and nativeint types.
- Tail recursion preserved for functions having more parameters than
  available registers (but tail calls to other functions are still
  turned off if parameters do not fit entirely in registers).
- Fixed name-capture bug in function inlining.
- Improved spilling/reloading strategy for conditionals.
- IA32, Alpha: better alignment of branch targets.
- Removed spurious dependency on the -lcurses library.

Toplevel environment:
- Revised handling of top-level value definitions, allows reclaimation
  of definitions that are shadowed by later definitions with the same names.
  (E.g. "let x = <big list>;; let x = 1;;" allows <big list> to be reclaimed.)
- Revised the tracing facility so that for standard library functions,
  only calls from user code are traced, not calls from the system.
- Added a "*" prompt when within a comment.

Runtime system:
- Fixed portability issue on bcopy() vs memmove(), affecting Linux RedHat 7.0
  in particular.
- Structural comparisons (=, <>, <, <=, >, >=, compare) reimplemented
  so as to avoid overflowing the C stack.
- Input/output functions: arrange so that reads and writes on closed
  in_channel or out_channel raise Sys_error immediately.

Standard library:
- Module Gc: changed some counters to float in order to avoid overflow;
    added alarms
- Module Hashtbl: added Hashtbl.replace.
- Module Int64: added bits_of_float, float_of_bits (access to IEEE 754
    representation of floats).
- Module List:  List.partition now tail-rec; 
    improved memory behavior of List.stable_sort.
- Module Nativeint: added Nativeint.size (number of bits in a nativeint).
- Module Obj: fixed incorrect resizing of float arrays in Obj.resize.
- Module Pervasives: added float constants "infinity", "neg_infinity", "nan";
    added a "classify_float" function to test a float for NaN, infinity, etc.
- Pervasives.input_value: fixed bug affecting shared custom objects.
- Pervasives.output_value: fixed size bug affecting "int64" values.
- Pervasives.int_of_string, {Int32,Int64,Nativeint}.of_string:
  fixed bug causing bad digits to be accepted without error.
- Module Random: added get_state and set_state to checkpoint the generator.
- Module Sys: signal handling functions are passed the system-independent
  signal number rather than the raw system signal number whenever possible.
- Module Weak: added Weak.get_copy.

Other libraries:
- Bigarray: added Bigarray.reshape to take a view of the elements of a
  bigarray with different dimensions or number of dimensions;
  fixed bug causing "get" operations to be unavailable in custom
  toplevels including Bigarray.
- Dynlink: raise an error instead of crashing when the loaded module
  refers to the not-yet-initialized module performing a dynlink operation.
- Bytecode threads: added a thread-safe version of the Marshal module;
    fixed a rare GC bug in the thread scheduler.
- POSIX threads: fixed compilation problem with threads.cmxa.
- Both thread libraries: better tail-recursion in Event.sync.
- Num library: fixed bug in square roots (Nat.sqrt_nat, Big_int.sqrt_big_int).

- ocamldep: fixed missing dependencies on labels of record patterns and
    record construction operations

Win32 port:
- Unix.waitpid now implements the WNOHANG option.

Mac OS ports:
- Mac OS X public beta is supported.
- Int64.format works on Mac OS 8/9.
To unsubscribe, mail  Archives: