caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Patrick M Doane <patrick@watson.org>
To: Eric Newhuis <enew@starband.net>
Cc: Caml <caml-list@pauillac.inria.fr>
Subject: Re: [Caml-list] Dynamic vs. Static
Date: Fri, 9 Nov 2001 13:15:09 -0500 (EST)	[thread overview]
Message-ID: <20011109130158.O80907-100000@fledge.watson.org> (raw)
In-Reply-To: <003001c1693c$6c1e3dc0$d0c201cf@XENO>

The compelling argument to me in this paper is the example regarding
collections and Java.  The type for the method

  public boolean AbstractCollection::removeAll(Collection c)

is obviously too restrictive.  The argument in favor of it was to reduce
the number of interfaces in the standard library.  There is good reason
for limiting this in Java because subtyping is directly related to
inheritance.  To introduce a new interface would require figuring out how
to compose all of these pieces together.

Caml doesn't suffer from this particular problem because subtyping is not
related to inheritance. It would be trivial to create a new class type
that is used in various type signatures that specify exactly the set of
methods that are required.

C++ templates have a similar kind of freedom in that the types in that the
types needed to compile a function are inferred directly from the
definition of that function.

The problem with a system like C++ and also with the dynamic approach (as
far as I know - please correct me if this is wrong) is that there are
times when it is useful to constrain a type by more than what is required
for a particular implementation.  I've seen several cases of STL container
objects in C++ that work for one implementation of the standard algorithms
but fail to work with a different implementation.  Now the author had made
a mistake with respect to the documentation, although everything was legal
from the compiler's viewpoint.

It's also worth noting that, for whatever reason, Caml does not have a
very good collection library. The modules indivually are quite good but
they lack the unification that allows a developer to easily plug in a new
implementation as needed.

Patrick


On Fri, 9 Nov 2001, Eric Newhuis wrote:

> Would anyone care to read this and comment on it w.r.t. Caml/ML/etc?
>
> http://wiki.cs.uiuc.edu/VisualWorks/Mark+Fussell+Dynamic-vs-Static+Typing+Message
>
>

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  parent reply	other threads:[~2001-11-09 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-09 16:34 Eric Newhuis
2001-11-09 17:31 ` David McClain
2001-11-09 18:15 ` Patrick M Doane [this message]
2001-11-09 18:31 ` Pixel

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=20011109130158.O80907-100000@fledge.watson.org \
    --to=patrick@watson.org \
    --cc=caml-list@pauillac.inria.fr \
    --cc=enew@starband.net \
    /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).