Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Big executables from ocamlopt; dynamic libraries again
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tim@f...
Subject: [Caml-list] Type-safe backward compatibility for .so's
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