From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id HAA10687; Sat, 17 Feb 2001 07:25:01 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id HAA10716 for caml-list@pauillac.inria.fr; Sat, 17 Feb 2001 07:25:01 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA20752 for ; Fri, 16 Feb 2001 16:50:25 +0100 (MET) Received: from localhost.localdomain (jimbo179.zip.com.au [202.7.88.179]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f1GFoMT27998 for ; Fri, 16 Feb 2001 16:50:22 +0100 (MET) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id CAA29231; Sat, 17 Feb 2001 02:45:26 +1100 Message-ID: <3A8D4B14.218137E3@ozemail.com.au> Date: Sat, 17 Feb 2001 02:45:24 +1100 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Anton Moscal CC: Don Syme , caml-list@inria.fr Subject: Re: [Caml-list] RE: OCaml on CLR/JVM? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Anton Moscal wrote: > > On Fri, 9 Feb 2001, Don Syme wrote: > > > Java/.NET component building seriously right from the start I feel you're > > always just going to end up with a bit of a hack - an interesting, usable > > hack perhaps, but not a really _good_ language. > > > > Probably the greatest recurring technical problem that I see in this kind of > > work is that of type inference, and the way both the Java and .NET models > > rely on both subtyping and overloading to help make APIs palatable. Type > > inference just doesn't work well with either subtyping or oveloading. This > > is a great, great shame, as it's obviously one of the main things ML has to > > offer to improve productivity. > > I think, subtyping probably isn't serious problem: O'Caml already have > subtyping relations (between objects and also between variant types). > I think, there is more serious problem: > > O'Caml have structural subtyping relation between objects, whereas .NET > type system have subtyping relation based on explicitly declared > inheritance: > ---------------------- > class point1 (x:int) = object method x = x end > class point2 (x:float) (y:float) = object method x = x method y = y end > > let get_x p = p#x > > let _ = Printf.printf "%d\n" (get_x (new point1 1)) > let _ = Printf.printf "%g\n" (get_x (new point2 10.0 20.0)) > ---------------------- > > function get_x has type -> 'a and can works with the any > object, which have method "x". I see no ways to map this into .NET > framework except using reflection (which is overkill). > Also, point2 is subtype of point1, but there isn't explicit > inheritance declaration here. Moreover point1 and point2 can be defined > in independent modules and don't know each other. The converse problem is to reflect the C++ signature matching in Ocaml, which may be required to access C++ libraries. 1. 'Const' is probably impossible to model in the Ocaml type system, (does .NET support that?) 2. multiple inheritance may be possible with polymorphic variants (?) -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr