From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA22453 for caml-redistribution; Wed, 21 Apr 1999 18:50:23 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA18174 for ; Tue, 20 Apr 1999 15:33:52 +0200 (MET DST) Received: from morgon.inria.fr (morgon.inria.fr [128.93.8.33]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id PAA09726; Tue, 20 Apr 1999 15:33:46 +0200 (MET DST) Received: (from remy@localhost) by morgon.inria.fr (8.8.7/8.8.7) id OAA23931; Tue, 20 Apr 1999 14:38:07 +0200 Message-ID: <19990420143806.33996@morgon.inria.fr> Date: Tue, 20 Apr 1999 14:38:06 +0200 From: Didier Remy To: Giuseppe Castagna Cc: caml-list@inria.fr, mottl@miss.wu-wien.ac.at Subject: Re: subtyping and inheritance Reply-To: Didier.Remy@inria.fr References: <3715D924.F50D6586@ens.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85e In-Reply-To: <3715D924.F50D6586@ens.fr>; from Giuseppe Castagna on Thu, Apr 15, 1999 at 02:18:44PM +0200 Organization: INRIA, BP 105, F-78153 Le Chesnay Cedex Phone: (33) 1 3963 5317 -- Sec: (33) 1 3963 5570 -- Fax: (33) 1 3963 5684 Web: http://cristal.inria.fr/~remy Sender: weis Dear Beppe, > Surely, it would require some modifications to the compiler, but all it > would have to do is to mark some particular methods and all the objects > that could call these methods by a natural number (for those who know, > some sort of De Brujin notation, that a purist may consider as dynamic > type information). How to do it in practice is described for the language > O2 in [1] (but without the natural numbers since in O2 the dynamic type > information is available). This is obtained by simply modifying the > compiler without affecting the language. > ... The works [1] and [2] that you cite apply to the languages O2 and Java. However, both languages have a very weak type system. In particular, neither one supports polymorphic types (hence parametric classes) or self types. Thus, I don't think that your experiences with O2 and Java can immediately be transfered to Ocaml. In particular, adding dynamics types in the presence of polymorphism is much more complex than the simple sketch above. Also, regarding type checking, you probably need the higher-order version of lambda-&, which is much more difficult than the first-order version that you are using in [1] and [2]. Of course, type inference is likely to be another complication... So I do not think that applying [1] or [2] to Ocaml is an implementation exercise. It certainly remains an interesting, but serious and probably difficult, research project. -Didier