From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr 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 82C517EF5E for ; Wed, 13 Jul 2016 14:08:36 +0200 (CEST) IronPort-PHdr: 9a23:QSOKJhFt7VPSnEHVCHXc651GYnF86YWxBRYc798ds5kLTJ75osmwAkXT6L1XgUPTWs2DsrQf2rKQ7/irBTZIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWD14Lrj6vuodX6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V02MNaXe3BY6M8VblRCjJuZ2Ez6srDuhTZQU6U+nwYSmAflBwODwWTvz/gWZKkniLkt+Y18S2eJsruVfhgVS6rqqFmVwTAjSobPiUl+WrUzMd3ifQI81qauxVjztuMM8muP/1kc/aFcA== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dra-news@metastack.com; spf=Pass smtp.mailfrom=dra-news@metastack.com; spf=None smtp.helo=postmaster@outmail148100.authsmtp.co.uk Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=62.13.148.100; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of dra-news@metastack.com designates 62.13.148.100 as permitted sender) identity=mailfrom; client-ip=62.13.148.100; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@outmail148100.authsmtp.co.uk) identity=helo; client-ip=62.13.148.100; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail148100.authsmtp.co.uk"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ABAADQLYZXmGSUDT5dgxGBA3wGo3QGlmIahX4CgS07EQEBAQEBAQEBEQEBAQEBCAsLByEvgjIVghUBAQQBOj8QAgEIDgoeEDIlAQEEDg2IIAkDAcBfAQEBAQEFAQEBAQEBAQEBHoVihRWEQ4Mqgi8FmRyGEYhGCo8lkBc0gjqBV26IOAF+AQEB X-IPAS-Result: A0ABAADQLYZXmGSUDT5dgxGBA3wGo3QGlmIahX4CgS07EQEBAQEBAQEBEQEBAQEBCAsLByEvgjIVghUBAQQBOj8QAgEIDgoeEDIlAQEEDg2IIAkDAcBfAQEBAQEFAQEBAQEBAQEBHoVihRWEQ4Mqgi8FmRyGEYhGCo8lkBc0gjqBV26IOAF+AQEB X-IronPort-AV: E=Sophos;i="5.28,357,1464645600"; d="scan'208";a="226612791" Received: from outmail148100.authsmtp.co.uk ([62.13.148.100]) by mail2-smtp-roc.national.inria.fr with ESMTP; 13 Jul 2016 14:08:35 +0200 Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232]) by punt24.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u6DC8XCo046232; Wed, 13 Jul 2016 13:08:33 +0100 (BST) Received: from romulus.metastack.com (114.212-105-213.static.virginmediabusiness.co.uk [213.105.212.114]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u6DC8WIx078682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jul 2016 13:08:32 +0100 (BST) Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id u6DC8VRU006589 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Wed, 13 Jul 2016 13:08:31 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0279.002; Wed, 13 Jul 2016 13:08:31 +0100 From: David Allsopp To: Gerd Stolpmann CC: "caml-list@inria.fr" Thread-Topic: [Caml-list] Warnings opening modules (was: why is building ocaml hard?) Thread-Index: AdHaoiY+hN+behtOTfeXtrpVwcHBDAAOQugAAIjFBaA= Date: Wed, 13 Jul 2016 12:08:30 +0000 Message-ID: References: <001701d1daa2$30f7ac30$92e70490$@metastack.com> <1468179914.25014.89.camel@e130.lan.sumadev.de> In-Reply-To: <1468179914.25014.89.camel@e130.lan.sumadev.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [85.255.234.156] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Server-Quench: 84ea531a-48f2-11e6-829e-00151795d556 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgASJgRHAnNE X3kJW1VSQFxyU2N9 YQlSIwdcYVRPXwB0 UklLXFNTEBpqBAMA SFsYJmp6EHwOeHl4 Y05gEHheW0A0fUIo E0tXFDwbYW82an0e URVeagtWeVZXfh9E b1F4XXZZZGABKBgV TUcAFDk0OXBbKT9J d0kyJEgUQEAEBXY7 Xx0EHDMgVUgCSzg3 IgduakEVBxRZLUUj eVo6EVgFMhseCwtR fQlKCyZcIxEBTjAn WkIy X-Authentic-SMTP: 61633634383431.1037:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 213.105.212.114/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Subject: RE: [Caml-list] Warnings opening modules (was: why is building ocaml hard?) Gerd Stolpmann wrote: > Am Sonntag, den 10.07.2016, 12:57 +0100 schrieb David Allsopp: > > Gerd Stolpmann wrote: > > > > > For example, when there is > > > > > > open M1 > > > open M2 > > > > > > at the beginning of a file, ocamldep doesn't know whether M2 is > > > another top-level module, or whether it is a submodule of M1. > > > ocamldep normally errs on the side of generating too many > > > dependencies, which is then tried to be corrected by only accepting > > > those deps corresponding to existing files. In this example, this > > > would mean that a dependency to M2 is emitted when there is a file > > > M2.ml. Note that this is wrong when M2 is actually a submodule of M1 > > > AND the file M2.ml > > exists. > > > > I hate the open statement (indeed, I hate its equivalent in every > > language I've ever used), which limits how much I tend to consider it: > > but this is awful in so many ways. Do you happen to know how common it > > is to open one module and then open a *unqualified* submodule of that > > (i.e. where M2 is a submodule of M1)? >=20 > I cannot give numbers, but imagine M2 is actually called Types or Util. > This trap is a real one. It is not one that makes the build tools > completely unusable, but it adds a litte bit of the unreliability that is > observed by the users. If we want to address these issues ocamldep needs > to be part of this effort. >=20 > Successive opens are quite normal when you have packed libraries. Sure, but in which case, isn't encouraging (and eventually mandating) open ReallyCoolLibraryPack.Util considerably better than: open ReallyCoolLibraryPack (* myriad more open statements *) open Util and eventually solves considerably more problems. > > It strikes me that that pattern requires not a new language convention > > as you go on to say, but at least two warnings and possibly a > > deprecation to discourage its ever being written! The first warning > > (including a deprecation message) should state that [open M2] relies > > on the previous [open M1] (similar idea as Warning 40) and the second > > warning should trigger if M2.cmi also exists indicating that M1.M2 has > > been opened rather than the actual M2 module (again, with a > > deprecation message). Both warnings being eliminated by giving: > > > > open M1 > > open M1.M2 > > > > The big stability nightmare that I see there is you have: > > > > open ThirdPartyLibrary > > open MyOwnProjectModule > > > > and a new version of ThirdPartyLibrary adds a submodule > MyOwnProjectModule. >=20 > I think that we need a syntax for toplevel module paths (e.g. I suggested > "open ^MyOwnProjectModule", resembling anchored regular expressions). Indeed, but rather than adding yet another piece of syntax, does it cause s= o much pain to move in the direction of just making the open declaration al= ways require a toplevel module path? David