220 41100 <CAOU91OPMe-0PU7zEfKKPSQNMwtaf8cw+q24XAes9pZTJqPGrcg@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Modules and preambule, just why?
Date: Wed, 28 Nov 2018 12:16:14 +0100
Lines: 89
Approved: news@gmane.org
Message-ID: <CAOU91OPMe-0PU7zEfKKPSQNMwtaf8cw+q24XAes9pZTJqPGrcg@mail.gmail.com>
References: <e3f7a8a5-8e78-49f5-97df-139951f5d07a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1543403692 14714 195.159.176.226 (28 Nov 2018 11:14:52 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 28 Nov 2018 11:14:52 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD3NR2WQQ4IBBJHS7HPQKGQEI6FVXUY@isocpp.org Wed Nov 28 12:14:48 2018
Return-path: <std-proposals+bncBD3NR2WQQ4IBBJHS7HPQKGQEI6FVXUY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vs1-f69.google.com ([209.85.217.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBD3NR2WQQ4IBBJHS7HPQKGQEI6FVXUY@isocpp.org>)
	id 1gRxns-0003Zj-01
	for gclcip-std-proposals@m.gmane.org; Wed, 28 Nov 2018 12:14:48 +0100
Original-Received: by mail-vs1-f69.google.com with SMTP id u29sf11849750vsj.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 Nov 2018 03:16:53 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1543403813; cv=pass;
        d=google.com; s=arc-20160816;
        b=T7lRM+/z1fWBkD5WhJoelR6dRh0vfUDcZ4/728Vf2op6pD0I68SYMPYnQw8/QCifV+
         xrOeksat39iPXQI6bogVGbdvqkxPbnIaxuHlPhBTgl9tqvcIlzhZsovF31QqfdCEzuw9
         yaofYsMmXYMQyhNve+8urh8tpWWcusA16lUfz6S1kcdxtBh2yQBsUPG8LWnogjGkJlVu
         gfCzVXdsUbihnhhtIQyPKVC5f3Yz/ipd3GCccMfPCHmZHfTscAXpAi5mpihFHZ4jCPWG
         e7oSC0M3vdBhl98sIYgNvm9C7tjH1h5UcOG2uypDU6bUmo00LsJeBKybA5ScPW/e/M7b
         etMA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-transfer-encoding
         :to:subject:message-id:date:from:in-reply-to:references:mime-version
         :dkim-signature;
        bh=AapdS2C5Ob1tvXhmSS8YlJS9tep4jSBPDtMGBwk8ecw=;
        b=gdbzgsURZORrMMkLjTiGJIterbma/Gjg7iMk52XlU1CNclD17RD78vl4bY/0rN85TD
         b+DNRO4YDd4Uys04zSab/CfQ9rqf5zrq+ZPeWvxOO0FgtPdw/sRETYeeWGM/24yJHQ8+
         acQ0+Sd91HJtfhAk7TkhAqixknrD6ZpFYGwEGwJiM//9ftvpNZeQcWmc1O7sibcG31jj
         we2Av0pU17Cej3KiptwR/0xiCQ+PjALxr1vaBREDeeg+mKyUFeatIxZftlGf+vgko5YP
         7HdVBZhBPKby7Re9AoMHdnqCq59x+QLPmhO8HXL/9GzOdRLKN4jPrI7pl1BoFquhLvgH
         EPkA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=MbpFl9lc;
       spf=pass (google.com: domain of mjklaim@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mjklaim@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :content-transfer-encoding:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=AapdS2C5Ob1tvXhmSS8YlJS9tep4jSBPDtMGBwk8ecw=;
        b=PTTrQIjoJm86jlE9g/MSjG4U2MZ2r899yhqIrHuJieaekXE4Dfh3LWrwYwD6YhIjPp
         QlQIbNJDV0Jg9jYwb7irHp/mR/8acA4NmogJO6hmDJBaLPkx0gAZp6g6kd0reAaPfl4X
         TP2dvnh2SoJeKtWH7Q1gaTtUMSg7ruZx7Y5T1A3gdsaEqNSYRhAyUPx5P2UY2mFqzovj
         xd2clTxJcc6OYmQOEHR7hofvDkPadoell+aGKG5h1Y9ZUECqeFvqYUNkg0avxUF2w0JH
         tNgrSv06lCj5wrjsNSWpAhGND+MiygryInYroTpP+LNCTt4fK2s/EZTqJvLwvfbsXzn/
         sKGA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:content-transfer-encoding:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=AapdS2C5Ob1tvXhmSS8YlJS9tep4jSBPDtMGBwk8ecw=;
        b=RISra6Vxkq23v6mWv0M1IWnXYhwnyPHE9ITItHocrPtq9agRaJ1RgsZEHSebq1/pbP
         iX8SjobayjO42PKauUQ2tXBVLInsxO75XwHgETe8YOdhmyG8MKvT3M5uiKUt11M6Mm+q
         SdSzINJWIfES6bbwU5/2lpsuxOBy3fr+THNhPi0cHLwF0tWnhszpGGZOYSp7lSnJ7NAa
         WsNFCry0IZUQoRcjZKkIF06R7EhryDc2YICYlZqaFzSeKjos8nGlaGBnsIPY+zBBQNd1
         GeS5Ml0msOrgVq40i4Kd55H8Hmi147gXVcnJm+IkOpZdAZIrS2/HC9nYW+fNoMD0nqVA
         KMf 
X-Gm-Message-State: AA+aEWaVLXZ6amNQ0KW0QxcZEp4ZaVzqNp1ucXRQFtJaVR4diHpA2W+6
	iilGpJZKWpCUjSodkjHcUKAvSg==
X-Google-Smtp-Source: AFSGD/VuAAS9kPpj7RgMaGJWnvVDpT0Dj5ixAZrL+fTGO59/6AYiybq4o+s/wjwErru8w6pAkW/KSA==
X-Received: by 2002:a1f:a010:: with SMTP id j16mr3464055vke.19.1543403813024;
        Wed, 28 Nov 2018 03:16:53 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a67:80ca:: with SMTP id b193ls2011672vsd.0.gmail; Wed, 28
 Nov 2018 03:16:52 -0800 (PST)
X-Received: by 2002:a67:5d83:: with SMTP id r125mr14390494vsb.197.1543403811999;
        Wed, 28 Nov 2018 03:16:51 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1543403811; cv=none;
        d=google.com; s=arc-20160816;
        b=xQK1XBkupGUOUZ2wCA5XJwhXdyGvYETmtdp8ICnYW89TGt5dgljHSpsm2e4NOZrdSW
         p37+VJz5PpfUhxG0X4N/YLKwz1XKHmd31jMEDacJVQt8lNZfyd5nl/dW8JwqQvJFdQmf
         kbP2AExPQzaCiQkf6MhJQ/D1qLDYvmm8TQXQo1Lsb7jn1jUs2Q+hY4tikzlQnfoZnYNm
         zMbP/j7Yn7A+KNXUlnPqVPN9KHuCIkOdfsvED5VU4YNEh5oBtJuAtOk/X7F4AgV0xf1P
         +2+3F3cvSTyXmhmg/hCi+kUEbX8ZR9WkP32DyB0O9qkxfPj3pa7P6DR25BRkupIQHwve
         1Z5w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:dkim-signature;
        bh=yNSffFevYYUJrpeg0Oj+j1YEIXRjxGknwwxjcIUHQhQ=;
        b=gD2u/AWjumIL8MyWG4x5vGFhjNUjI7nOl7X+0otDtGpRITCKx2MiDRQrixvxd9D5OT
         lq5mFdf87JjKtAcVMQbxOJ15NClgFQC1YIXgAGvB79QOWdznFj50ozDRCUPTL+3mZMx6
         o7OyC0s9CBHXOxOLHjIYCRSTvX3owqy2ofB16pu7MPoggiQRhSrw+ZhyZcBhSN8TYj43
         yZhsUqfbj7NZYrBLGIqpyUHLiOYOJzp01Z2LZ0qwiteOB95HAEFK92n/5CWYtEQZDw1W
         ukHqDQ2pSSbWxKzTR3iMJyz17fXqo7rI5KUnFogT7P05BGc7O9CMc+ciLuth1qAKSVMQ
         Avgg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=MbpFl9lc;
       spf=pass (google.com: domain of mjklaim@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=mjklaim@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id x195sor2988473vkd.27.2018.11.28.03.16.51
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Wed, 28 Nov 2018 03:16:51 -0800 (PST)
Received-SPF: pass (google.com: domain of mjklaim@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a1f:4301:: with SMTP id q1mr15245953vka.70.1543403811108;
 Wed, 28 Nov 2018 03:16:51 -0800 (PST)
In-Reply-To: <e3f7a8a5-8e78-49f5-97df-139951f5d07a@isocpp.org>
X-Original-Sender: mjklaim@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=MbpFl9lc;       spf=pass
 (google.com: domain of mjklaim@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=mjklaim@gmail.com;       dmarc=pass (p=NONE
 sp=QUARANTINE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:41100
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41100>

On Tue, 27 Nov 2018 at 22:10, <masse.nicolas@gmail.com> wrote:
> The way modules have been done, they require the sources files to declare=
 which module they implements and what they exports into a preambule.
> To be honest, I don't really get why this was necessary.

My understanding is that the main reason is that it helps tools know
the dependencies without having to parse the rest of the C++ syntax.
Build systems will have to check every source file in a first pass to
quickly decide what have to be built, by making a dependency graph.
This pass is simple if the information is easily locatable and with
always a strict subset of possible C++ syntax.

(also it's similar to other module system from other languages, but
that's not a reason).

> Moreover, i found some drawbacks with it:
> - It makes sources files dependent on which modules they will be shipped =
in.

I'm not sure I understand this point.
Isn't it the point of modules to associate a module name to sources?

> - Not only the sources does declare the module they belongs to, but they =
also need to be put together in the build system (may it be Makefiles, cmak=
e, ...). This goes against the DRY concept since it cause duplication of in=
formation.

I don't understand where would be a duplicate information. The module
names exist only in sources, not in build system's project description
files (at least in any decent build system).

> - There is a concept of 'module interface unit' (and even a 'primary modu=
le interface unit'!). As far as I understand it, it is almost the same that=
 old .h files, thus providing no real benefit over the latter when writing =
new code.

Of course it provides benefit! It's like saying that a header file and
a module is similar, but it's really not. For example, your header
will leak it's names into user's user's code. Modules will not by
default.
The point of these interface unit is to allow you to not change the
interface but change the implementation without the user aving to
recompile their code, even if all the module code is defined in one
file.

>
> So, my question is why was this preambule necessary? Can't we avoid it?

I'm not an expert, but I believe it is necessary if we want something
that is easy to implement and works well with human readers.

> Also there seems to be a paper which  indicate that preambules are unnece=
ssary (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1299r0.html=
). What's the status about this?

This paper will be published very soon, but you can ask the author for
a copy. Here is the revision 3's intro copy/pasted:

---
Module Preamble is Unnecessarily Fragile

Nathan Sidwell

The ATOM proposal introduced the module preamble. The merged document
modified that concept
for increased flexibility. The rules determining the extent of the
preamble have been modified, but it
remains fragile. We should consider making the preamble more robust.
TL;DR: This was presented to EWG at the San Diego=E2=80=9918 meeting. It wa=
s
accepted and is merged to
p1103.

----

As you can see, it's a fix of the preamble, not a removal.

A. Jo=C3=ABl Lamotte

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAOU91OPMe-0PU7zEfKKPSQNMwtaf8cw%2Bq24XAes9pZTJq=
PGrcg%40mail.gmail.com.

.
