caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Goerzen <jgoerzen@complete.org>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: Eric Stokes <eric.stokes@csun.edu>, caml-list@inria.fr
Subject: Re: [Caml-list] Ocaml shared libraries
Date: Mon, 17 May 2004 08:45:44 -0500	[thread overview]
Message-ID: <20040517134544.GB6669@excelhustler.com> (raw)
In-Reply-To: <20040517102254.A22324@pauillac.inria.fr>

On Mon, May 17, 2004 at 10:22:54AM +0200, Xavier Leroy wrote:
> With shared libraries, any update on the shared lib would immediately
> invalidate all executables that use it.  This is the well-known "DLL
> hell" problem, just exacerbated by the very strict consistency
> checkings done by the OCaml linker.  So, feature 2- above is really
> not applicable to OCaml as it is today, and static linking is much
> more usable than dynamic linking of shared libs.

I'm not quite sure that conclusion follows from your premise.

Let's say we have an OCaml executable and needs to link with certain
OCaml libraries.  Couldn't the dynamic loader embedded in that
executable, whatever form it may take, check with the libraries it's
dynamically linking with to make sure the interfaces remain the same?

> As for feature 1- (smaller executables), I'm not convinced this is a
> major issue.  I'm old enough to remember the introduction of shared
> libraries in the Unix world (in SunOS 4).  At that time, the saving in
> disk space was significant: disks were small (a complete SunOS 4
> install could fit in as little as 100 Mb) and the size of executables
> wasn't negligible compared to the size of data files.  Times have
> changed, however: disk space has increased much faster than executable
> sizes, and the disks on a modern machine are mostly filled with data
> (think MP3 and movies :-), making executable sizes a non-issue.

There are plenty of situations where this is not the case.  For
instance:

1. Handheld devices (think Sharp Zaurus, re-flashed iPAQ, or other
   units that run Linux)

2. Other embedded systems

3. Limited-storage systems (thin clients, etc)

4. Limited-RAM systems

A little more on #4... on *nix platforms, at least, the code of a .so is
usually shared among all processes that use it.

> Feature 3- (dynamic code loading) is already available in bytecode
> through the Dynlink API.  I understand there's a demand for having it
> in native-code as well, and that might be possible without too much fuss,
> at least on selected operating systems.

It exists, but it's not exactly to the point where you can use it to
load in any arbitrary library; specifically, you can only load libraries
that are specifically written to register their functions with your app
somehow.

-- John

-------------------
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


  parent reply	other threads:[~2004-05-17 13:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-17  6:09 Eric Stokes
2004-05-17  7:46 ` skaller
2004-05-17  8:22 ` Xavier Leroy
2004-05-17 11:12   ` Michal Moskal
2004-05-17 13:45   ` John Goerzen [this message]
2004-05-17 14:27   ` Eric Stokes
     [not found]     ` <20040517.165146.60944531.andrieu@ijm.jussieu.fr>
2004-05-17 15:22       ` Eric Stokes

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=20040517134544.GB6669@excelhustler.com \
    --to=jgoerzen@complete.org \
    --cc=caml-list@inria.fr \
    --cc=eric.stokes@csun.edu \
    --cc=xavier.leroy@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).