caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: Alain Frisch <alain@frisch.fr>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Ocaml and the Fragile Base Class Problem
Date: Thu, 1 Sep 2011 08:39:58 +0900	[thread overview]
Message-ID: <364C2CE8-55FB-4050-8BBC-D59B03F9E59F@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <4E5EA894.9060607@frisch.fr>

On 2011/09/01, at 6:33, Alain Frisch wrote:
>> Also, for various reasons, objects are not beginner friendly.
>> I think the main problem is that they don't fit that well with type inference:
>> both subtyping and polymorphic methods require explicit type annotations.
> 
> Time to advertise the implicit-subtyping branch?

Indeed the implicit-subtyping branch helps: if the compiler knows all the types,
it doesn't force you to write a coercion by hand.
On the other hand, this is only a partial solution, as my comment was on the
lack of principality: you still need type annotations in many cases.
Constraint-based type inference might recover this principality, but since the types
inferred get even worse than with structural object types, I'm afraid this is not
really practical. (It might work better with nominal subtyping.)

Jacques Garrigue

  reply	other threads:[~2011-08-31 23:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 10:53 Chris Yocum
2011-08-27 11:24 ` Jacques Garrigue
2011-08-27 15:06 ` Gerd Stolpmann
2011-08-27 16:59   ` David Baelde
2011-08-27 19:37     ` Gerd Stolpmann
2011-08-27 20:21       ` Jeff Meister
2011-08-27 23:08         ` Gerd Stolpmann
2011-08-28  9:31           ` Andreas Rossberg
2011-08-28 10:04             ` Guillaume Yziquel
2011-08-28 10:11             ` Gerd Stolpmann
2011-08-28 10:50               ` Andreas Rossberg
2011-08-29  3:35           ` Jacques Garrigue
2011-08-29 11:19             ` Chris Yocum
2011-08-29 11:47               ` Guillaume Yziquel
2011-08-29 12:03                 ` Chris Yocum
2011-08-31 21:33             ` Alain Frisch
2011-08-31 23:39               ` Jacques Garrigue [this message]
2011-08-28 17:58       ` Julien Signoles

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=364C2CE8-55FB-4050-8BBC-D59B03F9E59F@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    /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).