caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Objective Caml 2.00 released
@ 1998-08-19  8:26 Xavier Leroy
  1998-08-27 12:22 ` Thierry Bravier
  0 siblings, 1 reply; 2+ messages in thread
From: Xavier Leroy @ 1998-08-19  8:26 UTC (permalink / raw)
  To: caml-list

It is my pleasure to announce the release of Objective Caml 2.00.

In addition to a number of enhancements and bug fixes (see detailed
list below), the main novelty of this release is the introduction of a
new class language (designed and implemented by Jérôme Vouillon).

The driving idea is to have a small language of class expressions to
manipulate classes, just like we have a small language of module
expressions to manipulate base modules (structures).

Class expressions are generated from base classes (definitions of
methods and instance variables) by adding initialization parameters,
applying (partially) those initialization parameters, putting class
type constraints to hide certain methods and instance variables, etc.

(Similarly, module expressions are generated from base modules
struct...end by functor abstraction, functor application, signature
constraints, etc.)

In addition to making the handling of classes more regular and
logical, the new class language is much more convenient than the OCaml
1.0 classes for controlling class initialization.

For more information on the new class language, see the tutorial
at http://caml.inria.fr/ocaml/htmlman/node3.html and the
reference manual at http://caml.inria.fr/ocaml/htmlman/node5.10.html

The downside of all this is that OCaml 2.00 is not upwards compatible
with OCaml 1.07 (hence the new major version number): the syntax of
classes has changed significantly, requiring some intervention on your
sources.  These changes should affect very little programs that do not
use classes.

A semi-automatic translator from OCaml 1.07 to OCaml 2.00 is available at
ftp://ftp.inria.fr/lang/caml-light/bazar-ocaml/ocaml1to2-1.00.tar.gz

Objective Caml 2.00 is available from ftp://ftp.inria.fr/lang/caml-light/
in the following files:

        ocaml-2.00.tar.gz       Source distribution (Unix, Windows, Mac)
        ocaml-2.00-1.i386.rpm   Binaries for Linux RedHat 5.1 / Intel
        ocaml-2.00-win.zip      Binaries for Windows 95 and NT
        ocaml-2.00-refman.*     Documentation, in various formats
                                (HTML, PDF, Postscript, DVI, plain text)

For general info on Objective Caml, see http://caml.inria.fr/ocaml/

Please direct queries and bug reports to caml-light@inria.fr
and general discussions to the mailing-list caml-list@inria.fr or the
comp.lang.ml newsgroup.

- Xavier Leroy, for the Objective Caml team.

------------------------------------------------------------

Objective Caml 2.00:
--------------------

* Language:
  - New class language.  See http://caml.inria.fr/ocaml/refman/
    for a tutorial (chapter 2) and for the reference manual (section 4.9).
  - Local module definitions "let module X = <module-expr> in <expr>".
  - Record copying with update "{r with lbl1 = expr1; ...}".
  - Array patterns "[|pat1; ...;patN|]" in pattern-matchings.
  - New reserved keywords: "object", "initializer".
  - No longer reserved: "closed", "protected".

* Bytecode compiler:
  - Use the same compact memory representations for float arrays, float
    records and recursive closures as the native-code compiler.
  - More type-dependent optimizations.
  - Added the -use_runtime and -make_runtime flags to build separately
    and reuse afterwards custom runtime systems
    (inspired by Fabrice Le Fessant's patch).

* Native-code compiler:
  - Cross-module constant propagation of integer constants.
  - More type-dependent optimizations.
  - More compact code generated for "let rec" over data structures.
  - Better code generated for "for" loops (test at bottom of code).
  - More aggressive scheduling of stores.
  - Added -p option for time profiling with gprof
    (fully supported on Intel x86/Linux and Alpha/Digital Unix only)
    (inspired by Aleksey Nogin's patch).
  - A case of bad spilling with high register pressure fixed.
  - Fixed GC bug when GC called from C without active Caml code.
  - Alpha: $gp handling revised to follow Alpha's standard conventions,
    allow running "atom" and "pixie" on ocamlopt-generated binaries.
  - Intel x86: use movzbl and movsbl systematically to load 8-bit and 16-bit
    quantities, no more hacks with partial registers (better for the
    Pentium Pro, worse for the Pentium).
  - PowerPC: more aggressive scheduling of return address reloading.
  - Sparc: scheduling bug related to register pairs fixed.

* Runtime system:
  - Better printing of uncaught exceptions (print a fully qualified
    name whenever possible).

* New ports:
  - Cray T3E (bytecode only) (in collaboration with CEA).
  - PowerMac under Rhapsody.
  - SparcStations under Linux.

* Standard library:
  - Added set_binary_mode_in and set_binary_mode_out in Pervasives
    to toggle open channels between text and binary modes.
  - output_value and input_value check that the given channel is in
    binary mode.
  - input_value no longer fails on very large marshalled data (> 16 Mbytes).
  - Module Arg: added option Rest.
  - Module Filename: temp_file no longer loops if temp dir doesn't exist.
  - Module List: added rev_append (tail-rec alternative to @).
  - Module Set: tell the truth about "elements" returning a sorted list;
    added min_elt, max_elt, singleton.
  - Module Sys: added Sys.time for simple measuring of CPU time.

* ocamllex:
  - Check for overflow when generating the tables for the automaton.
  - Error messages in generated .ml file now point to .mll source.
  - Added "let <id> = <regexp>" to name regular expressions
    (inspired by Christian Lindig's patch).

* ocamlyacc:
  - Better error recovery in presence of EOF tokens.
  - Error messages in generated .ml file now point to .mly source.
  - Generated .ml file now type-safe even without the generated .mli file.

* The Unix library:
  - Use float instead of int to represent Unix times (number of seconds
    from the epoch).  This fixes a year 2005 problem on 32-bit platforms.
    Functions affected: stat, lstat, fstat, time, gmtime, localtime,
    mktime, utimes.
  - Added putenv.
  - Better handling of "unknown" error codes (EUNKNOWNERR).
  - Fixed endianness bug in getservbyport.
  - win32unix (the Win32 implementation of the Unix library) now has
    the same interface as the unix implementation, this allows exchange
    of compiled .cmo and .cmi files between Unix and Win32.

* The thread libraries:
  - Bytecode threads: bug with escaping exceptions fixed.
  - System threads (POSIX, Win32): malloc/free bug fixed; signal bug fixed.
  - Both: added Thread.wait_signal to wait synchronously for signals.

* The graph library: bigger color cache.

* The str library: added Str.quote, Str.regexp_string,
  Str.regexp_string_case_fold.

* Emacs mode:
  - Fixed bug with paragraph fill.
  - Fixed bug with next-error under Emacs 20.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Objective Caml 2.00 released
  1998-08-19  8:26 Objective Caml 2.00 released Xavier Leroy
@ 1998-08-27 12:22 ` Thierry Bravier
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Bravier @ 1998-08-27 12:22 UTC (permalink / raw)
  To: caml-list

Xavier Leroy wrote:
> 
> It is my pleasure to announce the release of Objective Caml 2.00.
> 
> Objective Caml 2.00:
> --------------------
> 
> * Language:
>   - Local module definitions "let module X = <module-expr> in <expr>".

Thank you and congratulations for this release.

The local module feature is, I think, really fine and useful
it will allow (in my case) a much bigger use of the module system.

Here are a few suggestions for related issues.

Of course, I might have neglected theoretically bad consequences
of my suggestions. I would like to have opinions about the
implied coding style and its usefulness in ocaml.

Cheers.

TYPE PARAMETERS SCOPE:
(* ================================================================== *)
let remove_duplicates_string comparison_fun =
  let module StringSet =
    Set.Make
      (struct
         type t = string
         let compare = comparison_fun end) in
    fun string_list ->
      StringSet.elements
        (List.fold_right StringSet.add string_list StringSet.empty)
(*
  val remove_duplicates_string :
  (string -> string -> int) -> string list -> string list
*)
 
let remove_duplicates_string_std = remove_duplicates_string compare
let _ = remove_duplicates_string_std ["a"; "b"; "a"; "c"]
let _ = remove_duplicates_string_std ["a"; "c"]
 
(* ================================================================== *)
(*
(*
  Next part will not compile with ocaml-2.00
  but, in my opinion would be nicer/better code, if allowed.
*)
 
let remove_duplicates_any (comparison_fun : 'any -> 'any -> int) =
  let module AnySet =
    Set.Make
      (struct
         type t = 'any
 (*
   ocaml-2.00 error message is: "Unbound type parameter any"
 *)
         let compare = comparison_fun end) in
    fun any_list ->
      AnySet.elements (List.fold_right AnySet.add any_list AnySet.empty)
(*
  val remove_duplicates_any : ('a -> 'a -> int) -> 'a list -> 'a list
*)
 
let remove_duplicates_any_std = remove_duplicates compare
let _ = remove_duplicates_any_std ['a'; 'b'; 'a']
let _ = remove_duplicates_any_std ["Hello"; "World"]
*)
(* ================================================================== *)


ANONYMOUS MODULES:
(* ================================================================== *)
module type CMP = sig
  type t
  val  compare : t -> t -> int
end
 
(* ================================================================== *)
module Lexico (C1 : CMP) (C2 : CMP with type t = C1.t)
  : (CMP with type t = C1.t) = struct
    type t = C1.t
    let compare x y =
      let compare1 = C1.compare x y in
        if compare1 != 0 then compare1 else C2.compare x y
  end
 
(* ================================================================== *)
let combine compare1 compare2 =
  let module L =
    Lexico
      (struct type t = int let compare = compare1 end)
      (struct type t = int let compare = compare2 end) in
    L.compare
 
(* ================================================================== *)
(*
(*
  Next part will not compile with ocaml-2.00
  but, in my opinion would be nicer/better code, if allowed.
*)
 
let combine_nicer compare1 compare2 =
  Lexico
    (struct type t = int let compare = compare1 end)
    (struct type t = int let compare = compare2 end).compare
 (*
   ocaml-2.00 error message is: "Syntax error"
 *)
*)
(* ================================================================== *)


MODULES SCOPE:
(* ================================================================== *)
type nat = Z | S of nat
 
let make_nat () =
  let module N = struct
    type t = nat
    let z = Z
    let s n = S n
    let rec int = function
      | Z -> 0
      | S n -> succ (int n)
  end in
    (N.z, N.s, N.int)
 
(*
  As it is make_nat is not very useful because construction and direct
access
  to nat values through constructors Z and S is possible.
*)
 
(* ================================================================== *)
(*
(*
  Next part will not compile with ocaml-2.00
  but, in my opinion would be nicer/better code, if allowed.
*)
 
let make_nat () =
  let module N = struct
    type t = Z | S of t
    let z = Z
    let s n = S n
    let rec int = function
      | Z -> 0
      | S n -> succ (int n)
  end in
    (N.z, N.s, N.int)
 (*
   ocaml-2.00 error message is: 
   This `let module' expression has type N.t * (N.t -> N.t) * (N.t ->
int)
   In this type, the locally bound module name N escapes its scope
 *)
 
  (*
    What I would like here is getting an abstract type "make_nat.t" that
    could only be created and accessed through the offered interface
    functions, that is z, s and int
  *)
*)
(* ================================================================== *)

-- 
Thierry Bravier                     Dassault Aviation - DGT / DPR / DESA
78, Quai Marcel Dassault              F-92214 Saint-Cloud Cedex - France
Telephone : (33) 01 47 11 53 07          Telecopie : (33) 01 47 11 52 83
E-Mail :                     mailto:thierry.bravier@dassault-aviation.fr





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-08-27 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-19  8:26 Objective Caml 2.00 released Xavier Leroy
1998-08-27 12:22 ` Thierry Bravier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).