From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by pauillac.inria.fr; Mon, 21 Mar 94 17:11:11 +0100 Received: by pauillac.inria.fr; Mon, 21 Mar 94 17:10:44 +0100 Received: by pauillac.inria.fr; Sat, 19 Mar 94 21:31:00 +0100 From: Pierre Weis Message-Id: <9403192031.AA05235@pauillac.inria.fr> Subject: Re: The unsound type checker of Caml Light. To: mael@id.dth.dk (Martin Elsman) Date: Sat, 19 Mar 1994 21:31:00 +0100 (MET) Cc: xleroy@pauillac.inria.fr (Xavier Leroy), weis@pauillac.inria.fr (Pierre Weis) In-Reply-To: <199403191657.RAA08113@idfs3.id.dth.dk> from "Martin Elsman" at Mar 19, 94 05:57:34 pm X-Mailer: ELM [version 2.4 PL21] Content-Type: text Sender: weis@pauillac.inria.fr It is well known that the Caml Light typechecker is unsound for mutable objects. It is clearly mentioned in the man page: BUGS ... Polymorphic references, and more generally mutable concrete types, are not safe: it is possible to create polymorphic refer- ences through a functional encoding. That's clear: functional_ref is a functional encoding that create polymorphic references. As far as I know there is no working versions of Caml featuring the kind of type systems described in Xavier's thesis. They are sound and powerful, but may be too complex for common usage. Nevertheless we definitively have to fix these bugs of the typechecker. We probably have to switch to the simple scheme proposed by the FX communauty in 1987 and shown to be pratical by Wright in 1993: restrict type generalisation to pure expressions (or non-expansive expressions), or to values in Wright's terminology. This is clearly correct, though it has somme drawbacks, since it forbids some styles of programming, which intensively relies on polymorphism obtained by partial applications of polymorphic functionals. Hope this helps, Pierre Weis ---------------------------------------------------------------------------- Cristal Project INRIA, BP 105, F-78153 Le Chesnay Cedex (France) E-mail: Pierre.Weis@inria.fr Telephone: +33 1 39 63 55 98 ----------------------------------------------------------------------------