From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA08077; Mon, 18 Mar 2002 18:07:21 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA08620 for ; Mon, 18 Mar 2002 18:07:20 +0100 (MET) Received: from lobus.fungible.com (adsl-64-161-114-6.dsl.snfc21.pacbell.net [64.161.114.6]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g2IH7JH26913 for ; Mon, 18 Mar 2002 18:07:19 +0100 (MET) Received: by lobus.fungible.com (Postfix, from userid 1000) id 803F87F48; Mon, 18 Mar 2002 09:04:54 -0800 (PST) Message-Id: <4518-Mon18Mar2002090454-0800-tim@fungible.com> X-Mailer: emacs 21.1.1 (via feedmail 8 I) Date: Mon, 18 Mar 2002 08:51:13 -0700 From-Tims-Fingers: true To: garrigue@kurims.kyoto-u.ac.jp Cc: caml-list@inria.fr In-reply-to: <20020318142017J.garrigue@kurims.kyoto-u.ac.jp> (message from Jacques Garrigue on Mon, 18 Mar 2002 14:20:17 +0900) Subject: [Caml-list] Type-safe backward compatibility for .so's References: <9601-Sat16Mar2002094255-0800-tim@fungible.com> <20020318101225C.garrigue@kurims.kyoto-u.ac.jp> <1191-Sun17Mar2002193326-0800-tim@fungible.com> <20020318142017J.garrigue@kurims.kyoto-u.ac.jp> From: tim@fungible.com (Tim Freeman) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 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