Topic: Make header files optional


Author: "'jadeburton' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Tue, 3 May 2016 10:00:04 -0700 (PDT)
Raw View
------=_Part_3406_1738368040.1462294804704
Content-Type: multipart/alternative;
 boundary="----=_Part_3407_717709462.1462294804705"

------=_Part_3407_717709462.1462294804705
Content-Type: text/plain; charset=UTF-8

I'm certain I'm not the first to propose this - but one of the pain points
of C++ is *still*, even today, header files.  It seems odd that the
language has jumped ahead with many impressive new features, but header
files are still the elephant in the room.

I think the C++ syntax should be extended to optionally allow a complete
class/template to be defined from beginning to end in a module file.  The
compiler should infer the public interface from it, as many other languages
do.

Programmers currently waste a huge of time keeping the module and headers
synchronized, like whenever they change a method signature, for example.

And not including many header files would probably in many cases be a lot
faster to compile.

I also doubt there's a good reason why such an extension to the language
could not be backwards-compatible with projects that still use header
files.  Old files could still #include virtual header files that the
compiler infers automatically from modules that use the new syntax.

And new files could just use some new directive like #import, which takes a
module name instead of a header file name.  Or even better, let all modules
have visibility with all other modules and forget about importing/including
anything.

--
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 email 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/656fed63-b1c9-4045-980b-27011493130c%40isocpp.org.

------=_Part_3407_717709462.1462294804705
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;m certain I&#39;m not the first to propose this - bu=
t one of the pain points of C++ is *still*, even today, header files. =C2=
=A0It seems odd that the language has jumped ahead with many impressive new=
 features, but header files are still the elephant in the room.<div><br></d=
iv><div>I think the C++ syntax should be extended to optionally allow a com=
plete class/template to be defined from beginning to end in a module file. =
=C2=A0The compiler should infer the public interface from it, as many other=
 languages do.</div><div><br></div><div>Programmers currently waste a huge =
of time keeping the module and headers synchronized, like whenever they cha=
nge a method signature, for example.</div><div><br></div><div>And not inclu=
ding many header files would probably in many cases be a lot faster to comp=
ile. =C2=A0</div><div><br></div><div>I also doubt there&#39;s a good reason=
 why such an extension to the language could not be backwards-compatible wi=
th projects that still use header files. =C2=A0Old files could still #inclu=
de virtual header files that the compiler infers automatically from modules=
 that use the new syntax.</div><div><br></div><div>And new files could just=
 use some new directive like #import, which takes a module name instead of =
a header file name. =C2=A0Or even better, let all modules have visibility w=
ith all other modules and forget about importing/including anything.</div><=
div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/656fed63-b1c9-4045-980b-27011493130c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/656fed63-b1c9-4045-980b-27011493130c=
%40isocpp.org</a>.<br />

------=_Part_3407_717709462.1462294804705--
------=_Part_3406_1738368040.1462294804704--

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Tue, 03 May 2016 10:13:52 -0700
Raw View
On ter=C3=A7a-feira, 3 de maio de 2016 10:00:04 PDT 'jadeburton' via ISO C+=
+=20
Standard - Future Proposals wrote:
> I'm certain I'm not the first to propose this - but one of the pain point=
s
> of C++ is *still*, even today, header files.  It seems odd that the
> language has jumped ahead with many impressive new features, but header
> files are still the elephant in the room.
[cut]

Are you aware of the Modules proposal?

--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

--=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/3697351.iT4WhgBjBC%40tjmaciei-mobl4.

.


Author: FrankHB1989 <frankhb1989@gmail.com>
Date: Wed, 4 May 2016 00:40:17 -0700 (PDT)
Raw View
------=_Part_5792_1553575380.1462347617993
Content-Type: multipart/alternative;
 boundary="----=_Part_5793_1305347338.1462347617993"

------=_Part_5793_1305347338.1462347617993
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



=E5=9C=A8 2016=E5=B9=B45=E6=9C=884=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89 UTC+=
8=E4=B8=8A=E5=8D=881:13:55=EF=BC=8CThiago Macieira=E5=86=99=E9=81=93=EF=BC=
=9A
>
> On ter=C3=A7a-feira, 3 de maio de 2016 10:00:04 PDT 'jadeburton' via ISO =
C++=20
> Standard - Future Proposals wrote:=20
> > I'm certain I'm not the first to propose this - but one of the pain=20
> points=20
> > of C++ is *still*, even today, header files.  It seems odd that the=20
> > language has jumped ahead with many impressive new features, but header=
=20
> > files are still the elephant in the room.=20
> [cut]=20
>
> Are you aware of the Modules proposal?=20
>
> Even without modules, header *files *are already optional in the standard=
=20
library. The headers of the standard library are not required to=20
implemented as *files*. Also note the term "header file" only occurs once=
=20
in the informative text.=20

> --=20
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org=20
>    Software Architect - Intel Open Source Technology Center=20
>
>

--=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/54d24f11-03b8-4fc3-8e09-2fd45d566d7b%40isocpp.or=
g.

------=_Part_5793_1305347338.1462347617993
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>=E5=9C=A8 2016=E5=B9=B45=E6=9C=884=E6=97=A5=E6=98=
=9F=E6=9C=9F=E4=B8=89 UTC+8=E4=B8=8A=E5=8D=881:13:55=EF=BC=8CThiago Macieir=
a=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On=
 ter=C3=A7a-feira, 3 de maio de 2016 10:00:04 PDT &#39;jadeburton&#39; via =
ISO C++=20
<br>Standard - Future Proposals wrote:
<br>&gt; I&#39;m certain I&#39;m not the first to propose this - but one of=
 the pain points
<br>&gt; of C++ is *still*, even today, header files. =C2=A0It seems odd th=
at the
<br>&gt; language has jumped ahead with many impressive new features, but h=
eader
<br>&gt; files are still the elephant in the room.
<br>[cut]
<br>
<br>Are you aware of the Modules proposal?
<br>
<br></blockquote><div>Even without modules, header <i>files </i>are already=
 optional in the standard library. The headers of the standard library are =
not required to implemented as <i>files</i>. Also note the term &quot;heade=
r file&quot; only occurs once in the informative text. <br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;">--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x3dD\x26sntz\x3d1\x26usg\=
x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return true;" onclick=3D"this.hr=
ef=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x=
3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return t=
rue;">macieira.info</a> - thiago (AT) <a href=3D"http://kde.org" target=3D"=
_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.google.=
com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH=
GRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;" onclick=3D"this.href=3D&#39;=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1=
\x26usg\x3dAFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;">kde.org</a=
>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br>
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/54d24f11-03b8-4fc3-8e09-2fd45d566d7b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/54d24f11-03b8-4fc3-8e09-2fd45d566d7b=
%40isocpp.org</a>.<br />

------=_Part_5793_1305347338.1462347617993--
------=_Part_5792_1553575380.1462347617993--

.