caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Max Skaller <skaller@ozemail.com.au>
To: Anton Moscal <msk@post.tepkom.ru>
Cc: Don Syme <dsyme@microsoft.com>, caml-list@inria.fr
Subject: Re: [Caml-list] RE: OCaml on CLR/JVM?
Date: Sat, 17 Feb 2001 02:45:24 +1100	[thread overview]
Message-ID: <3A8D4B14.218137E3@ozemail.com.au> (raw)
In-Reply-To: <Pine.LNX.4.21.0102111224360.20549-100000@kouzdra.glokaya>

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 <x: 'a; ..> -> '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


  reply	other threads:[~2001-02-17  6:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-09 22:05 Don Syme
2001-02-14 17:24 ` [Caml-list] " Anton Moscal
2001-02-16 15:45   ` John Max Skaller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-05  6:00 Arturo Borquez
2001-02-23 16:33 Chris Tilt
2001-02-24 12:02 ` John Max Skaller
2001-02-16 19:06 Dave Berry
2001-02-16 21:16 ` Marcin 'Qrczak' Kowalczyk
2001-02-16 18:38 [Caml-list] " Dave Berry
2001-02-15  9:33 [Caml-list] " Fabrice Le Fessant
2001-02-15 10:19 ` Fabrice Le Fessant
2001-02-16 16:54 ` John Max Skaller
2001-02-14  7:31 Don Syme
2001-02-14 19:44 ` Xavier Leroy
2001-02-09 15:49 Dave Berry
2001-02-14 19:30 ` [Caml-list] " Xavier Leroy
2001-02-15 12:12   ` Sven LUTHER
2001-02-06  0:03 OCaml on CLR/JVM? (RE: OCaml <--> ODBC/SQL Server) Don Syme
2001-02-08 19:03 ` OCaml on CLR/JVM? Xavier Leroy
2001-02-09  9:06   ` David Mentre
2001-02-14 19:32     ` [Caml-list] " Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A8D4B14.218137E3@ozemail.com.au \
    --to=skaller@ozemail.com.au \
    --cc=caml-list@inria.fr \
    --cc=dsyme@microsoft.com \
    --cc=msk@post.tepkom.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).