<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1366711361;
        mso-list-template-ids:-975897992;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:"Courier New";
        mso-bidi-font-family:"Times New Roman";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Microsoft strongly encourages its developers and customers to NOT tie a module name with the containing source file of its interface.&nbsp; This is based on decades of experience caused by header files.&nbsp; I would rather see us move in the direction
 of some sort of MANIFEST file that map modules to source files and artifacts.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> tooling-bounces@open-std.org &lt;tooling-bounces@open-std.org&gt;
<b>On Behalf Of </b>Corentin<br>
<b>Sent:</b> Thursday, January 10, 2019 6:53 AM<br>
<b>To:</b> WG21 Tooling Study Group SG15 &lt;tooling@open-std.org&gt;<br>
<b>Subject:</b> [Tooling] Modules naming<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">Hello.<o:p></o:p></p>
<div>
<p class="MsoNormal">I would like to suggest two modules related proposals that I think SG15 should look at.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">-<b> Compiler enforced mapping between module names and module interface file (resource) name.&nbsp;</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Currently, modules interfaces can be declared in any file - which makes dependency scanning more tedious than it needs to be and have performance implications<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">(The build system needs to open all files to gather a list of modules) - notably when the build system tries to start building while the dependency graph isn't yet complete.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Tools ( ide, code servers, indexers, refactoring) may also greatly benefit from an easier way to locate the source file which declares a module.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">The specifics of the mapping are open to bikeshedding. However, I think we would have better luck sticking to something simple like &lt;module identifier&gt; &lt;=&gt; &lt;file name&gt;.&lt;extension&gt;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">(The standardese&nbsp;would mention <i>resource identifier</i> rather than filename)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">- <b>A standing document giving guidelines for modules naming.</b><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">The goal is to take everything the community had to learn the hard way about header naming over the past 30 years and apply it to modules by providing a set of guidelines<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">that could be partially enforced by build system vendors.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Encouraging consistency and uniqueness of module identifiers across the industry is I think a necessary step towards sane package management.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Note that the standard requires uniqueness of modules identifiers within (the standard definition of) a program but says little about a way to ensure this uniqueness.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Here is a rough draft of what I think would be good guidelines, partially inspired by what is done by other languages facing similar issues.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Prefix module names with an entity and/or a project name to prevent modules from different companies, entities
 and projects of declaring the same module names.</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Exported top-level namespaces should have a name identic to the project name used as part of the name of the
 module(s) from which it is exported.</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Do not export multiple top-level namespaces</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Do not export entities in the global namespace outside of the global module fragment.</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Organize modules hierarchically.</span></b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#42464C">&nbsp;For
 example, if both modules&nbsp;</span><code><span style="font-size:10.0pt;color:#42464C;border:none windowtext 1.0pt;padding:0in">example.foo</span></code><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#42464C">&nbsp;and&nbsp;</span><code><span style="font-size:10.0pt;color:#42464C;border:none windowtext 1.0pt;padding:0in">example.foo.bar</span></code><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#42464C">&nbsp;exist
 as part of the public API of&nbsp;</span><code><span style="font-size:10.0pt;color:#42464C;border:none windowtext 1.0pt;padding:0in">example</span></code><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#42464C">,&nbsp;</span><code><span style="font-size:10.0pt;color:#42464C;border:none windowtext 1.0pt;padding:0in">example.foo</span></code><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#42464C">&nbsp;should
 reexport&nbsp;</span><code><span style="font-size:10.0pt;color:#42464C;border:none windowtext 1.0pt;padding:0in">example.foo.bar</span></code><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Avoid common names such as&nbsp;</span></b><code><span style="font-size:10.0pt;color:#222324;border:none windowtext 1.0pt;padding:0in">util</span></code><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">&nbsp;and&nbsp;</span></b><code><span style="font-size:10.0pt;color:#222324;border:none windowtext 1.0pt;padding:0in">core</span></code><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">&nbsp;for
 module name prefix and top-level namespace names.</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Use lower-case module names</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:24.0pt;margin-bottom:0in;margin-left:24.0pt;margin-bottom:.0001pt;text-indent:-.25in;mso-list:l0 level1 lfo1;vertical-align:baseline">
<![if !supportLists]><span style="font-size:10.0pt;font-family:Symbol;color:#42464C"><span style="mso-list:Ignore">·<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><b><span style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif;color:#222324;border:none windowtext 1.0pt;padding:0in">Do not use characters outside of the basic source character set in module name identifiers.</span></b><span style="font-family:&quot;Arial&quot;,sans-serif;color:#42464C"><o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal">My hope is that&nbsp;these 2 proposals (whose impact on the standard is minimal) would make it easier for current tooling to deal with modules<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">while making possible for example to design dependency managers and build systems&nbsp;able to work at the module level.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I'd love to gather feedback and opinions before going further in that direction.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks a lot!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Corentin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">PS: For a bit of background, I talked about these issues there<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcor3ntin.github.io%2Fposts%2Fmodules_mapping%2F&amp;data=02%7C01%7Cgdr%40microsoft.com%7C1139eb25a2ca43b5cb2e08d6770b6606%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636827288180838903&amp;sdata=RbCelyBe1YDW4eNJtYEgKkAeHGxvkhsYqzPk0wf3F58%3D&amp;reserved=0">https://cor3ntin.github.io/posts/modules_mapping/</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcor3ntin.github.io%2Fposts%2Fmodules_naming%2F&amp;data=02%7C01%7Cgdr%40microsoft.com%7C1139eb25a2ca43b5cb2e08d6770b6606%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636827288180838903&amp;sdata=tMhQa4ijeqUd2qxXV4loP47nU5NESRTKJLwZqe%2FI1fc%3D&amp;reserved=0">https://cor3ntin.github.io/posts/modules_naming/</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>