Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2002-03-18 (17:07)
From: tim@f...
Subject: [Caml-list] Type-safe backward compatibility for .so's
From: Jacques Garrigue <>
>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; formerly
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: