caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Jeff Henrikson <jehenrik@yahoo.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] The DLL-hell of O'Caml
Date: Tue, 12 Mar 2002 23:00:47 +0100	[thread overview]
Message-ID: <20020312230047.M1173@ice.gerd-stolpmann.de> (raw)
In-Reply-To: <000d01c1c95b$866bc060$0b01a8c0@mit.edu>; from jehenrik@yahoo.com on Tue, Mar 12, 2002 at 01:19:07 +0100


On 2002.03.12 01:19 Jeff Henrikson wrote:
> > In O'Caml replacing library X by a newer version usually means that
> > all libraries Y that depend on X must be recompiled. And there is no
> > guarantee that Y can be compiled at all. I do not see any chance to
> > change this, it is a consequence of strict typing.
> 
> I don't see this.  I can believe that consequences of implementation choices which have been made prohibit this.  For hypothetical
> example, inlining behavior which could not be disabled on public interfaces would be a problem.  (I don't think this particular
> thing happens in ocaml.)  But I certainly don't see "a consequence of strict typing."  Can you give a specific example?

Usually, a new version of a library modifies the signature. Ok, these are often only minor
modifications: some new functions, new optional arguments etc., and normally the new version
is "source-level" compatible with the old version. "Source-level" means that "normal" usage
does not cause incompatibilities.

An example: The old version defines a function 

(* OLD: *) val f : int -> int

and the new version changes the signature into

(* NEW: *) val f : ?option:bool -> int -> int

If "normal usage" means that f is only applied, the new version will be backwards compatible.
But there are cases where the compiler indicates a typing error:

- You can pass f as such around. This makes a difference because the type of f is different
  and the deduced types will be different, and it may happen that the deduced types cannot
  be accepted, because sometimes the optional argument is automatically dropped and sometimes
  not.
- The module defining f can be used as parameter of a functor. The new version has a different
  signature, and is not accepted as parameter any more.

So one precondition of replacing the library is that the signatures are identical. Even small
changes cannot be tolerated.

I am not an expert, and I do not know how the optional arguments exactly work, but it is
possible that the representation of the closure f has changed, too. In general, I expect
that "source-level" compatible modifications may change the representation of values.

Inlining is another reason (only for ocamlopt), but this can be turned off.

Gerd
-- 
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 45             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany                     
----------------------------------------------------------------------------
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-03-12 22:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11  4:28 Mark D. Anderson
2002-03-11  7:12 ` Mattias Waldau
2002-03-11 12:15 ` Gerd Stolpmann
2002-03-12  0:19   ` Jeff Henrikson
2002-03-12 22:00     ` Gerd Stolpmann [this message]
2002-03-20 11:20       ` Fergus Henderson
2002-03-20 11:43         ` Jacques Garrigue
2002-03-20 17:16           ` Fergus Henderson
2002-03-20 12:53         ` Gerd Stolpmann
2002-03-20 13:05           ` Johan Georg Granström
2002-03-20 13:40             ` Gerd Stolpmann
2002-03-20 19:46               ` Alain Frisch
2002-03-20 20:39               ` Xavier Leroy
2002-03-20 21:16                 ` Markus Mottl
2002-03-21  9:07                 ` Warp
2002-03-21 10:18                 ` Christopher Quinn
2002-03-21 18:13                   ` Xavier Leroy
2002-03-21 14:13                 ` Jeff Henrikson
2002-03-21 14:13                   ` [Caml-list] Type-safe DLL's with OO (was DLL-hell of O'Caml) Tim Freeman
2002-03-21 18:10                   ` [Caml-list] The DLL-hell of O'Caml Xavier Leroy
2002-03-21 18:39                     ` Sven
2002-03-21 19:22                     ` james woodyatt
2002-03-21 19:43                     ` Jeff Henrikson
2002-03-22  2:02                     ` Brian Rogoff
2002-03-22 10:11                     ` Warp
2002-03-21 18:50                 ` Sven
  -- strict thread matches above, loose matches on Subject: below --
2002-03-22 10:24 Dave Berry
2002-03-22 10:14 Dave Berry
2002-03-02  0:11 [Caml-list] troubleshooting problem related to garbage collection james woodyatt
2002-03-02  7:57 ` [Caml-list] The DLL-hell of O'Caml Mattias Waldau
2002-03-02 11:56   ` Markus Mottl
2002-03-02 21:40     ` Alexander V. Voinov
2002-03-02 14:46   ` Alain Frisch
2002-03-02 19:00     ` Chris Hecker
2002-03-02 19:42       ` Mattias Waldau
2002-03-02 22:41         ` Chris Hecker
2002-03-03 15:56           ` Vitaly Lugovsky
2002-03-04  9:57         ` Sven
2002-03-04 12:20   ` Jacques Garrigue

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=20020312230047.M1173@ice.gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=jehenrik@yahoo.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).