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 3B3247FE36 for ; Sun, 10 Jul 2016 21:45:55 +0200 (CEST) IronPort-PHdr: 9a23:oJYYHRXBYLzNoLdNzfWvm8q4VtnV8LGtZVwlr6E/grcLSJyIuqrYZhGAt8tkgFKBZ4jH8fUM07OQ6PG4Hzdcqs/a4TgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLHqvcaPKFwT1XKUWvBbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv50IbaKvU60mTLAQJTAiKGct/IW/uQPKCA2C+WA0V2gKmwFUCgPGqhr9W8GinDH9s79S1TOWdfbqSrQsXD2k6e8/SRnmjw8IOiQ1tXrLjchoiatdplStqkoskMbvfIiJOa8mLevmdtQASD8ZUw== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=info@gerd-stolpmann.de; spf=None smtp.mailfrom=info@gerd-stolpmann.de; spf=None smtp.helo=postmaster@mout.kundenserver.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.17.24; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.17.24; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=212.227.17.24; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DyAACSpYJXhxgR49RdhBR8uxEehXoCgR87EQEBAQEBAQEBEQEBAQgNCQkhL4IyFYIVAQEEAVUkBQsLDgouVwYTCYgfDAEJsBtvjSsBAQEBAQUBAQEBFQ6FL4VFhE2CPYMSBYgckHyBOQKEUohFiUkEhV+QDzSCOoFZbAGIbwEBAQ X-IPAS-Result: A0DyAACSpYJXhxgR49RdhBR8uxEehXoCgR87EQEBAQEBAQEBEQEBAQgNCQkhL4IyFYIVAQEEAVUkBQsLDgouVwYTCYgfDAEJsBtvjSsBAQEBAQUBAQEBFQ6FL4VFhE2CPYMSBYgckHyBOQKEUohFiUkEhV+QDzSCOoFZbAGIbwEBAQ X-IronPort-AV: E=Sophos;i="5.28,340,1464645600"; d="asc'?scan'208";a="226243334" Received: from mout.kundenserver.de ([212.227.17.24]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2016 21:45:28 +0200 Received: from office1.lan.sumadev.de ([178.4.30.143]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0McWDw-1be02Z3mN6-00HgLk; Sun, 10 Jul 2016 21:45:20 +0200 Received: from [192.168.65.10] (unknown [192.168.65.10]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id DED0EDC05D; Sun, 10 Jul 2016 21:45:18 +0200 (CEST) Message-ID: <1468179914.25014.89.camel@e130.lan.sumadev.de> From: Gerd Stolpmann To: David Allsopp Cc: caml-list@inria.fr Date: Sun, 10 Jul 2016 21:45:14 +0200 In-Reply-To: <001701d1daa2$30f7ac30$92e70490$@metastack.com> References: <001701d1daa2$30f7ac30$92e70490$@metastack.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-OgAbgLX+30HMes7A5xDY" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Provags-ID: V03:K0:xBPJVaaPTQW3F4l4/PfZnA29CkH10Tt8r/5Kam6PQ3rNl3GbykO /5yHnVFcuY93ezGYRZqriSAQ6wyP3Nak06UX8hjG9FFZbH75QqIcGb24dfxAzory7yGapWU itG4go7olbctnvjIeE0si2YKWk4n+IoCBDLmoVBOO11ar3lHpqCa6rpDxJ26SugvrzAt2su RnXCoVHOhMqUzTHOm/gOg== X-UI-Out-Filterresults: notjunk:1;V01:K0:22YI9LvA1sA=:hIld1fYjWgmUV0IVcMHNwx 6D+WcofX8D0lMBJB5c0IhN3QVc0tko7jKJjPVy5wBDgY6NbG0v0f2ZzDNQV1BS+B/0WxA8NNw GCAiP/cw1kyZY2mKoWRin92T7N8VAaojqvoFV9IY1ot4unK5UklbxNP1w3X03MVlOgNZ5dLY+ nXWq5jjFKiWGRijmri2zWjauKRgE0nH+g1Pj5ROtOXMrcqx1cUHLQDTsc6ywza6ciqw8qVyhK zF6dEwyg7gbuOszt1JLk88BDBU1QZAWOD5EAHeT7Ro1TdjrroTeIN8EtYGoJ2UZCGVL24pNmF Nl9/KbkJ6Saz3R4Fde4OAhN9U75Bu/WYzKNaRO335yJaUBtJdfeBz2yOyTZbbK5r6HLaemHQ9 J+8dE65MV1Sg9SjPFgRK0fxMRAWQu9fT+FQyAQ1+H7uOorZ/JM18OcJPLm0F3lqW8EXQp7nIm BgHlT6xX5DeqF5ok+f4KAmQnnoJlQUGcoANhibeBJauLZLBSMh8fHsd9ZeMxeo2VhzXb+cx7d ZDGRRMP0oly8+stHzrP4z7Fv7ECLobJc4f9GTP/wZ/qJbilEPpZy0x8wTs5o/C3PftVrjG5s2 D3T+mCihCRqWPgLMmjcD1rMA37vOVLTwx33yDEUk+errodC7AXxZiQjlCOXQ79+TJ6o7JZfpZ h6iKtZgsg5eGkT2tFaL0nSPhx38QESwSr2iuXeJh94r77DZ42vkgWZt7XFEtSwP7o95g= Subject: Re: [Caml-list] Warnings opening modules (was: why is building ocaml hard?) --=-OgAbgLX+30HMes7A5xDY Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable Am Sonntag, den 10.07.2016, 12:57 +0100 schrieb David Allsopp: > Gerd Stolpmann wrote: > > > For example, when there is > >=20 > > open M1 > > open M2 > >=20 > > at the beginning of a file, ocamldep doesn't know whether M2 is=20 > > another top-level module, or whether it is a submodule of M1. ocamldep= =20 > > normally errs on the side of generating too many dependencies, which=20 > > is then tried to be corrected by only accepting those deps=20 > > corresponding to existing files. In this example, this would mean that= =20 > > a dependency to M2 is emitted when there is a file M2.ml. Note that=20 > > this is wrong when M2 is actually a submodule of M1 AND the file M2.ml > exists. >=20 > 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)? 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. Successive opens are quite normal when you have packed libraries. > 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 trig= ger > if M2.cmi also exists indicating that M1.M2 has been opened rather than t= he > actual M2 module (again, with a deprecation message). Both warnings being > eliminated by giving: >=20 > open M1 > open M1.M2 >=20 > The big stability nightmare that I see there is you have: >=20 > open ThirdPartyLibrary > open MyOwnProjectModule >=20 > and a new version of ThirdPartyLibrary adds a submodule MyOwnProjectModul= e. I think that we need a syntax for toplevel module paths (e.g. I suggested "open ^MyOwnProjectModule", resembling anchored regular expressions). Gerd > It's also unfortunate that if M1, M1.M2 and "M2.ml" all define a value > [foo], it's not possible to open M1, M1.M2 and "M2.ml" in a way which giv= es > you "M2.ml"'s [foo] (if you follow that highly contrived example...!) >=20 >=20 > David >=20 >=20 >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-OgAbgLX+30HMes7A5xDY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJXgqXKAAoJEAaM4b9ZLB5TDlMH+wa9CtiIyQjLxrRW8fMaNcm8 i6YsDUi92HoZ/LR3M0FdzoTaEXqWyjCFH5h38wA6AXVfIFvUCtNG+sEoxKyyUX8f +NWTcf+fT/Yso54+HOfSBItYp+rBCx/SUyjmqbASkLcvGc8j+k71EuxdeSUN9i+G WMoHAb2EiylIBsFMLOWh7ZFqQ45aGrZ5h84F2Je2l1sH6btX0XI469Rn8DsGM3em jIjJWW0sqakxOjF2VJVdzcgQVzg/+x8PZX877GaZltT8x3bIRuMsOqTrMgPHoBv2 X4q2lSuPUs7D2fFFI7+h857D7aQ8JbgC/JEPuX58BQtQ0uU9qi3qsvbes2hPODU= =03BN -----END PGP SIGNATURE----- --=-OgAbgLX+30HMes7A5xDY--