Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: tim@fungible.com (Tim Freeman)
To: garrigue@kurims.kyoto-u.ac.jp
Cc: caml-list@inria.fr
Subject: [Caml-list] Type-safe backward compatibility for .so's
Date: Mon, 18 Mar 2002 08:51:13 -0700	[thread overview]
Message-ID: <4518-Mon18Mar2002090454-0800-tim@fungible.com> (raw)
In-Reply-To: <20020318142017J.garrigue@kurims.kyoto-u.ac.jp> (message from Jacques Garrigue on Mon, 18 Mar 2002 14:20:17 +0900)

From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
>Note that for C, compatibility policies generally allow adding extra
>functions to a library without changing the version number, since the
>problem, should it arise, can be detected at link time.

To use MD5 checksums to check the signatures, and support multiple
versions of a DLL safely, the language would need a new keyword, say
"version", that would be used to identify in the source code which
version of the library each identifier was introduced.  Suppose the
default version is 1.  The original version of a module might be:

   let bump_higher x = x + 1;;

and then after a revision you might have:

   let bump_higher x = x + 2;;  (* Bug fix *)
   version 2 let bump_float x = x + 0.1;;

This library would have two MD5 checksums, one for the type signature
of version 1 and one for the type signature of version 2.  Version 2
includes everything from version 1, since 2 > 1.  When the code is
linked in, old code searches the checksum list hoping to find the
checksum for version 1, and it finds it.  New code finds the checksum
for version 2 on the list and is happy.  Code that wants version 3
doesn't find the checksum it wants and aborts unless version 3 happens
to be identical to version 2.

-- 
Tim Freeman tim@fungible.com; formerly tim@infoscreen.com
-------------------
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:[~2002-03-18 17:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-16 16:05 [Caml-list] Big executables from ocamlopt; dynamic libraries again Tim Freeman
2002-03-18  1:12 ` Jacques Garrigue
2002-03-18  1:29   ` Tim Freeman
2002-03-18  5:20     ` Jacques Garrigue
2002-03-18 10:10       ` [Caml-list] Big executables from ocamlopt; dynamic librariesagain Warp
2002-03-18 13:14       ` [Caml-list] Big executables from ocamlopt; dynamic libraries again Sven
2002-03-18 15:51       ` Tim Freeman [this message]
2002-03-18 18:46       ` malc
2002-03-19 22:21       ` Johan Georg Granström
2002-03-20  2:46         ` Hashing research (was Re: [Caml-list] Big executables ...) Tim Freeman
2002-03-18 10:12     ` [Caml-list] Big executables from ocamlopt; dynamic libraries again Nicolas George
2002-03-18 13:11   ` Sven

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=4518-Mon18Mar2002090454-0800-tim@fungible.com \
    --to=tim@fungible.com \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    /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