From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id 109AF5D4 for ; Mon, 24 Aug 2020 08:51:59 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.76,347,1592863200"; d="scan'208";a="464440738" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 24 Aug 2020 10:51:58 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 61740E0C56; Mon, 24 Aug 2020 10:51:58 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id DF4ECE01C5 for ; Mon, 24 Aug 2020 10:51:55 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=francois.bobot@cea.fr; spf=Pass smtp.mailfrom=francois.bobot@cea.fr; spf=None smtp.helo=postmaster@cirse-smtp-out.extra.cea.fr IronPort-PHdr: =?us-ascii?q?9a23=3Ax1h9yxI8HCc71wSqUdmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgfL/nxwZ3uMQTl6Ol3ixeRBMOHsqwC0rOJ+PG5EUU7or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRp?= =?us-ascii?q?OOv1BpTSj8Oq3Oyu5pHfeQpFiCe8bL9oMRm6sAfcusYSjId/N6081gbHrnxUdu?= =?us-ascii?q?pM2GhmP0iTnxHy5sex+J5s7SFdsO8/+sBDTKv3Yb02QaRXAzo6PW814tbrtQTY?= =?us-ascii?q?QguU+nQcSGQWnQFWDAXD8Rr3Q43+sir+tup6xSmaIcj7Rq06VDi+86tmTgLjhT?= =?us-ascii?q?wZPDAl7m7Yls1wjLpaoB2/oRx/35XUa5yROPZnY6/RYc8WSW9HU81MVSJOH5m8?= =?us-ascii?q?YpMSAeQfM+ZWr4rzqVUAohSxBwajGOzhxyRUhnL1x6A2z/gtHA/E0QEmAtkAsG?= =?us-ascii?q?7UrNLwNKoKUe611rPHzTPbaPNR2Df985DHfw0mof6XWrJwbdfaxE4hFwPflFqQ?= =?us-ascii?q?r5DqPzSU1uQWqWSU9O1gWvmoi247sAx+viagyd02honHnIIY01bJ/jh2z4gpP9?= =?us-ascii?q?O3UlJ7YcK6H5tKsSGXL4t4TM08T210pio3yb0ItYKncCYEyJkr2R3SZuCDfoWM?= =?us-ascii?q?5h/tVPidLSt4in95dryymRa//Favx+HiWce531ZHojdDn9LRuH4N0BnT5dKGSv?= =?us-ascii?q?t75kquxzKP1wXK5uFAO080k6XbJ4Qmwr4qmZoet1nIECzumEjukaObeFso9vK1?= =?us-ascii?q?5+nmYLjqvIKQOotqhg3kL6gjlc+yDfwlPgUAQWSX4/mw2bzi8EHjXblHiuM6nr?= =?us-ascii?q?PEvJzEI8kQu7S3DBVP0ok57hayFzem38ocnXkANF9KZBOHj5LyO17QOfz4FvK/?= =?us-ascii?q?g0i0kDtywPDGI6HhDo/TIXnMjLfhZ6xy51RAxwUt199T/ZxUCqsZLPLyXE/+qs?= =?us-ascii?q?DYAwckPwG63errEshx24IcVG6VH6OUNL3evUWV6u8gIOSAfIoVtyz8K/gh6f7u?= =?us-ascii?q?l3g5mVoFcKmnx5sYcna4EehhI0WYenrgmMwOEWARsQo5UOznk0GNXiBJaHqoUa?= =?us-ascii?q?I8/Ck3CJi6AofbWoCtnLuB0T+nEZJMY2BGDkmAEXPpd4WfR/cBczmSI89kkjwc?= =?us-ascii?q?T7etUY4h1Re0tA/70bVrNOTU+jdL/a7kgel8+OTJ3Tg39Do8W9WUzGiXCWhxn2?= =?us-ascii?q?UgSDo/3aQ5qkt4nASty6991tJCHNrc4PJSZS09P5nAh7h0Edn0UQXAZZGDT1yh?= =?us-ascii?q?Xv2tDDh3QMhnkIxGWFp0B9j31kOL5CGtGbJA0uXTXMVpoJKZ5GD4IoNG81iD1K?= =?us-ascii?q?QliAN3EMBOL3arw7V66xCWAJPV1UiJi7yjM68R1WjD7jXblDbcjARjSAd1FJ79?= =?us-ascii?q?czUHfEKG/9/07wXMVe32UOV1Ak560ceHb5ByRJjshFRCSu3kPYSMaG+43WmqV0?= =?us-ascii?q?+F?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BFAgBSf0Nfh5TAp4RfHgEBCxIMQIRkV?= =?us-ascii?q?gEwLIQ3iQGIDiWDeZgjCwEDAQwfDgIEAQGETAKCRAIcBwEENBMCEAEBBQEBAQI?= =?us-ascii?q?BAwMEARMBAQEKCwkIKYVjDII3KQGDEgEEASMECwFGEAsaAiYCAlcGDQgBARaDD?= =?us-ascii?q?AGCXCCwQn8zhVKDaH4GgQ4qjSKCG4E4DIFfUC4+glwBhHeCYASPRhGkRYIjB4F?= =?us-ascii?q?QgRaIZJE0BQoekXCOQp0LlSeBa4F6TSdMgmpPGQ2OOYhrhURAATE3AgYBCQEBA?= =?us-ascii?q?wlbkEMBAQ?= X-IPAS-Result: =?us-ascii?q?A0BFAgBSf0Nfh5TAp4RfHgEBCxIMQIRkVgEwLIQ3iQGIDiW?= =?us-ascii?q?DeZgjCwEDAQwfDgIEAQGETAKCRAIcBwEENBMCEAEBBQEBAQIBAwMEARMBAQEKC?= =?us-ascii?q?wkIKYVjDII3KQGDEgEEASMECwFGEAsaAiYCAlcGDQgBARaDDAGCXCCwQn8zhVK?= =?us-ascii?q?DaH4GgQ4qjSKCG4E4DIFfUC4+glwBhHeCYASPRhGkRYIjB4FQgRaIZJE0BQoek?= =?us-ascii?q?XCOQp0LlSeBa4F6TSdMgmpPGQ2OOYhrhURAATE3AgYBCQEBAwlbkEMBAQ?= X-IronPort-AV: E=Sophos;i="5.76,347,1592863200"; d="scan'208";a="464440656" X-MGA-submission: =?us-ascii?q?MDEPNSZkES+I+8KD6gU5SIoSLBMDPTe0m54OkT?= =?us-ascii?q?Ntr28CrKj74U2ZPyC59h2oX99RgkvhS7I+0OanZuFQZCynHKej6OUMuG?= =?us-ascii?q?Rb6zL+G+S/vl5f1Ha93Pqeu7hy8mKQQjBU/CfcMO8va80QN3w+Ln2CQf?= =?us-ascii?q?agFOnUtBgABDIGqxO0W41JuA=3D=3D?= Received: from cirse-smtp-out.extra.cea.fr ([132.167.192.148]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2020 10:51:52 +0200 Received: from pisaure.intra.cea.fr (pisaure.intra.cea.fr [132.166.88.21]) by cirse-sys.extra.cea.fr (8.14.7/8.14.7/CEAnet-Internet-out-4.0) with ESMTP id 07O8pohd001452; Mon, 24 Aug 2020 10:51:50 +0200 Received: from pisaure.intra.cea.fr (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id D918A203DF3; Mon, 24 Aug 2020 10:51:50 +0200 (CEST) Received: from muguet1-smtp-out.intra.cea.fr (muguet1-smtp-out.intra.cea.fr [132.166.192.12]) by pisaure.intra.cea.fr (Postfix) with ESMTP id CA068203883; Mon, 24 Aug 2020 10:51:50 +0200 (CEST) Received: from [10.8.35.72] (is231324.intra.cea.fr [10.8.35.72]) by muguet1-sys.intra.cea.fr (8.14.7/8.14.7/CEAnet-Internet-out-4.0) with ESMTP id 07O8poL7002634; Mon, 24 Aug 2020 10:51:50 +0200 To: Yawar Amin Cc: OCaml Mailing List References: <71ff7d61-6899-9b05-4c01-3984d47698ca@cea.fr> From: =?UTF-8?Q?Fran=c3=a7ois_Bobot?= Message-ID: <0f6d52de-88f5-ecb8-5236-a57e38c79e41@cea.fr> Date: Mon, 24 Aug 2020 10:51:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Tools for helping backward compatibility? Reply-To: =?UTF-8?Q?Fran=c3=a7ois_Bobot?= X-Loop: caml-list@inria.fr X-Sequence: 18227 Errors-To: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Le 22/08/2020 à 06:09, Yawar Amin a écrit : > Do you mean something like Semantic Versioning here? See e.g. Elm which has a package manager that > can enforce SemVer by comparing types: https://elm-lang.org/news/0.14 Thank you a lot for the pointer. Unfortunately I'm yet not able to find details about the tool (dead links). Still: $ elm diff Microsoft/elm-json-tree-view 1.0.0 2.0.0 This is a MAJOR change. ---- JsonTree - MAJOR ---- Changed: - parseString : String -> Result String Node + parseString : String -> Result Error Node - parseValue : Value -> Result String Node + parseValue : Value -> Result Error Node I think it is better to let developers choose how/if they want to mark in the version breaking changes. Such tooling to detect problematic changes is already difficult without adding normative bike-shedding. I don't have the details of their tools, but it seems that a differences would be that the API developers would have the ability to tell which changes are problematic, and so how the user of the API can use it. > >> For package authors, it means we can automatically enforce semantic versioning. No user will ever > get a breaking API change in a patch version again! > > Something like this for OCaml would be very cool. But I've heard that SemVer for OCaml is either > difficult or effectively impossible, indeed due to some of the reasons you listed. I think any > practical codification of backward-compatibility rules would probably need to ignore the presence of > features like 'module type of' and 'include'. SemVer is difficult or even impossible in OCaml if you don't restrict what the user of the API can do with it. For any API change you can create a program that will be broken by it. There is one case where you can use `module type of` and `include` without any backward compatibility problem (except removing the library). Reexporting a library: module A : module type of Lib = struct include Lib end So if you don't have any guarantees, the only accepted use of `module type of Lib`, could be this one. With more guarantees, other usual uses of `include Lib` can be accepted. For `module type of` it is more contrived, like guaranteeing to not add new types and values. But it is not a bad thing to forbid that for external libraries. For internal use those constructs can always be used since all the modules of one library move in lock-step. Even libraries that are guaranteed to move in lock step can avoid those restrictions between them. Best, -- François