caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anton Moscal <msk@post.tepkom.ru>
To: Don Syme <dsyme@microsoft.com>
Cc: caml-list@inria.fr
Subject: [Caml-list] RE: OCaml on CLR/JVM?
Date: Wed, 14 Feb 2001 20:24:30 +0300 (MSK)	[thread overview]
Message-ID: <Pine.LNX.4.21.0102111224360.20549-100000@kouzdra.glokaya> (raw)
In-Reply-To: <0C682B70CE37BC4EADED9D375809768A48FD31@red-msg-04.redmond.corp.microsoft.com>

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). And
only problem arisen is necessity of the explicit type specification in
some constructions.

O'Caml haven't overloading, but probably overloading can be implemented
in the same way as subtyping: by requirement of the explicit type
specifications in case of ambiguities (SML have some builtin
overloaded operators and resolve emerging problems in this way).

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.

Anton
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-02-14 22:15 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 ` Anton Moscal [this message]
2001-02-16 15:45   ` [Caml-list] " John Max Skaller
  -- 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=Pine.LNX.4.21.0102111224360.20549-100000@kouzdra.glokaya \
    --to=msk@post.tepkom.ru \
    --cc=caml-list@inria.fr \
    --cc=dsyme@microsoft.com \
    /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).