220 27885 <72b7e733-cb85-4f47-a09b-10611f04211b@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Stabilize the numeric types in all platforms
Date: Mon, 22 Aug 2016 21:18:34 -0700 (PDT)
Lines: 167
Approved: news@gmane.org
Message-ID: <72b7e733-cb85-4f47-a09b-10611f04211b@isocpp.org>
References: <e10aed06-1df7-495b-93a2-10315cede76c@isocpp.org> <0d61be1e-2020-4f09-baa6-64dca463cb68@isocpp.org>
 <CAMD6iD9TuK5jV9BFHoAa+mNCR608bEP+rmbV67Mw3PbO1EvDsA@mail.gmail.com>
 <bfee02a3-301e-4a9e-92ef-51ab8647e94d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4814_1123196411.1471925914645"
X-Trace: blaine.gmane.org 1471925921 2925 195.159.176.226 (23 Aug 2016 04:18:41 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 23 Aug 2016 04:18:41 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBG45566QKGQEW6CVLPA@isocpp.org Tue Aug 23 06:18:36 2016
Return-path: <std-proposals+bncBCEKFTV6ZUMBBG45566QKGQEW6CVLPA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f199.google.com ([209.85.213.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBG45566QKGQEW6CVLPA@isocpp.org>)
	id 1bc3Aa-0000RL-CD
	for gclcip-std-proposals@m.gmane.org; Tue, 23 Aug 2016 06:18:36 +0200
Original-Received: by mail-yb0-f199.google.com with SMTP id f60sf100672554ybi.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 22 Aug 2016 21:18:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ePHbf+lcTu6XrXWTQ1pC31jQyfTQuEp9fbuYwfR8HMs=;
        b=yVOov15rTKap9oqj8T3k2QgQaZP7IZMQh66iFxzKwAEmQoVE7dlWra+kqBnNZea95n
         3Fn1FUPjkxiyDSP7ug3+8SuTAkq585xaYpComaIvHVDE2QRFj7USlT1fKfueYOwRrlOZ
         qVY3bgciNd02HTbs/hVU6Ucl8wkPmBL483GODWBn4YjpLmz8jp6GE1mhjbndG5wex4zT
         iOeHh2F3E07pNocpD1TOKbWKyVe4+UDsSCduG18/CgWwDAspbI/ELBRp+aYdYvhoUlW9
         SXA7nMdv3m48dcEsDubQDmf+xLs6PnaOMLo9KxsvJD5RQWhHR46PrB+RhZ+/slpZP4iv
         cRmw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=ePHbf+lcTu6XrXWTQ1pC31jQyfTQuEp9fbuYwfR8HMs=;
        b=LzT13k3XckvzECis3octiCBHocJB/I+HcmsA84pTNjO7owMDPrr9BleirAN1l7q1HQ
         jcsZgq1vpiHUVhP+FJ7zy0AZBFcTvKmcLSKmUMV4CPsJnCzH0Me3/N1eLmR/NPNNNg8b
         psIbv4JTuqgGrSrvFUbXaM5TiqXtL/vJwqrC2pzNCQrGtyMyuPTVDdcVnqSn4JSHfgMM
         UJHViKvhnEeXaUMfYQSWwKE6TpV408RyDcnVjcHcO25CEeWWPzA32K4b7MSJAKwL49/8
         xJli2ekLIpdHe8v+E4qSGmYynKgOSbUnqvatptBvGNWuZ4kNosEBg3KrpHEWP63SmsFt
         Holg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=ePHbf+lcTu6XrXWTQ1pC31jQyfTQuEp9fbuYwfR8HMs=;
        b=Eq49nUoju2AC/A6FtZWRbjwF5WASCa2CPZ4AC/zKQE0C6D1LE2tAJ/VEqg9xqtkJJR
         wgaUTtIlnRmGBr8QtH/ENIZPcJYpQhsyYsJbaZ/M8LzRO8lZZe4axqaPTF9LcGPHPUOB
         /sp11H8W+uJXTL4zSJKpRDHQnCKlRk7qkd01vs9EETsBo/G5tzX982Ph7hS1IVtGIQB5
         gJOSWsJjG0NLIscwC03vE4oPJAykHnG/md6vxl1KWhFdFFvX3+MftkwKX5DQ5Cpqq+TU
         slm5ir0rHXwXv4UIekmOYt2wqPGWGvY/+qmvWRQHVLc9Kb7Rx+rKLklPO3NcJcF+y98Y
         Vq5w==
X-Gm-Message-State: AEkooutowYRdmcMNhuOix7WrjdfJ5iwt1VrAUBWrnb7Um2q0Ruq9gXTGGqTVqx3a5log0Q==
X-Received: by 10.200.37.20 with SMTP id 20mr19097654qtm.17.1471925916765;
        Mon, 22 Aug 2016 21:18:36 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.20.68 with SMTP id 65ls4743544iou.16.gmail; Mon, 22 Aug
 2016 21:18:35 -0700 (PDT)
X-Received: by 10.36.238.143 with SMTP id b137mr766421iti.7.1471925915478;
        Mon, 22 Aug 2016 21:18:35 -0700 (PDT)
In-Reply-To: <bfee02a3-301e-4a9e-92ef-51ab8647e94d@isocpp.org>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:27885
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27885>

------=_Part_4814_1123196411.1471925914645
Content-Type: multipart/alternative; 
	boundary="----=_Part_4815_1407464808.1471925914645"

------=_Part_4815_1407464808.1471925914645
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Monday, August 22, 2016 at 11:40:34 PM UTC-4, FrankHB1989 wrote:
>
> =E5=9C=A8 2016=E5=B9=B48=E6=9C=8823=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=8C U=
TC+8=E4=B8=8A=E5=8D=8810:56:48=EF=BC=8CRen Industries=E5=86=99=E9=81=93=EF=
=BC=9A
>>
>> Yes, *what if another platform is 16 bit? *How in the world are we to=20
>> change that platform so it supports 32 bit ints?
>> All the currently working code would break, and for a lot of legacy=20
>> systems the actual code might be gone.
>>
>> Even if everyone had the source code to every program, many programs may=
=20
>> *depend* on int being 16 bits.
>> The code might not make sense using 32 bit integers. For example, some=
=20
>> DSP's are still 16 bit; emulating 32 bits on 16 bit processors will more=
=20
>> than half the speed of the code. And much code on these sorts of units i=
s=20
>> time critical; they might not have that many cycles to spare.
>> =20
>>
> Finally, the fundamental meaning of "int" would change; int would no=20
>> longer be the natural size for the platform. So why the hell are we call=
ing=20
>> it int anymore? It's a 32 bit integer, not a platform neutral integer.=
=20
>> Either we need to name it more strictly (such as int32_t or something) o=
r=20
>> we need to give a new name to "platform neutral" integer or "most natura=
l"=20
>> integer or "fastest" integer. Maybe intnatural? natural? fixed?
>>
>> There is no guarantee about "natural size".
>

Yes, there is no guarantee about what that means. But compiler writers=20
would encounter problems if they start arbitrarily violating the=20
expectations of users of that platform. As such, `int` will generally be=20
the "natural size" for the processor in question.

There have been the names for "fastest" ones: intN_fast_t/uintN_fast_t.=20
>
> It is reasonable that things like intN_t cannot be mandated for every=20
> platforms by practical reasons. But why not int_leastN_t/int_fastN_t?
>

They *are mandated* for all platforms. The only optional ones are those=20
that use a specific bitdepth and the `intptr_t`s.

Every valid C++11 implementation must provide those types. Even=20
freestanding implementations, which are permitted to only provide a subset=
=20
of the full standard library, are *required*, to provide these types.
=20

> The fact of keeping too many integer types without guarantees in the=20
> language specification is the true ugliness. Their co-existence also=20
> frustrates the normative type system (e.g. unsigned long vs. unsigned whe=
n=20
> they are the same thing in the ABI). I prefer most of them will be=20
> eventually conditionally-supported.
>
> BTW, I also don't think we have good reasons to provide more wrapper type=
s=20
> by the language specification. They can be unusable placeholders too=20
> easily, causing compatibility and maintenance nightmare. Why should=20
> programmers suffer from a `wchar_t` with 8-bit (yeah, damned Bionic)?
>
>

--=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/72b7e733-cb85-4f47-a09b-10611f04211b%40isocpp.or=
g.

------=_Part_4815_1407464808.1471925914645
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, August 22, 2016 at 11:40:34 PM UTC-4, FrankHB19=
89 wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=E5=
=9C=A8 2016=E5=B9=B48=E6=9C=8823=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=8C UTC+8=
=E4=B8=8A=E5=8D=8810:56:48=EF=BC=8CRen Industries=E5=86=99=E9=81=93=EF=BC=
=9A<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Yes, <i>what if=
 another platform is 16 bit? </i>How in the world are we to change that pla=
tform so it supports 32 bit ints?<div>All the currently working code would =
break, and for a lot of legacy systems the actual code might be gone.</div>=
<div><br></div><div>Even if everyone had the source code to every program, =
many programs may <i>depend</i>=C2=A0on int being 16 bits.</div><div>The co=
de might not make sense using 32 bit integers. For example, some DSP&#39;s =
are still 16 bit; emulating 32 bits on 16 bit processors will more than hal=
f the speed of the code. And much code on these sorts of units is time crit=
ical; they might not have that many cycles to spare.</div><div>=C2=A0</div>=
</div></blockquote><blockquote class=3D"gmail_quote" style=3D"margin:0;marg=
in-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"=
><div></div><div>Finally, the fundamental meaning of &quot;int&quot; would =
change; int would no longer be the natural size for the platform. So why th=
e hell are we calling it int anymore? It&#39;s a 32 bit integer, not a plat=
form neutral integer. Either we need to name it more strictly (such as int3=
2_t or something) or we need to give a new name to &quot;platform neutral&q=
uot; integer or &quot;most natural&quot; integer or &quot;fastest&quot; int=
eger. Maybe intnatural? natural? fixed?</div><div><br></div></div></blockqu=
ote><div>There is no guarantee about &quot;natural size&quot;.<br></div></d=
iv></blockquote><div><br>Yes, there is no guarantee about what that means. =
But compiler writers would encounter problems if they start arbitrarily vio=
lating the expectations of users of that platform. As such, `int` will gene=
rally be the &quot;natural size&quot; for the processor in question.<br><br=
></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><=
/div><div>There have been the names for &quot;fastest&quot; ones: intN_fast=
_t/uintN_fast_t. <br></div><div><br>It is reasonable that things like intN_=
t cannot be mandated for every platforms by practical reasons. But why not =
int_leastN_t/int_fastN_t?</div></div></blockquote><div><br>They <i>are mand=
ated</i> for all platforms. The only optional ones are those that use a spe=
cific bitdepth and the `intptr_t`s.<br><br>Every valid C++11 implementation=
 must provide those types. Even freestanding implementations, which are per=
mitted to only provide a subset of the full standard library, are <i>requir=
ed</i>, to provide these types.<br>=C2=A0</div><blockquote class=3D"gmail_q=
uote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pad=
ding-left: 1ex;"><div dir=3D"ltr"><div>The fact of keeping too many integer=
 types without guarantees in the language specification is the true uglines=
s. Their co-existence also frustrates the normative type system (e.g. unsig=
ned long vs. unsigned when they are the same thing in the ABI). I prefer mo=
st of them will be eventually conditionally-supported.<br><br>BTW, I also d=
on&#39;t think we have good reasons to provide more wrapper types by the la=
nguage specification. They can be unusable placeholders too easily, causing=
 compatibility and maintenance nightmare. Why should programmers suffer fro=
m a `wchar_t` with 8-bit (yeah, damned Bionic)?</div><br></div></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/72b7e733-cb85-4f47-a09b-10611f04211b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/72b7e733-cb85-4f47-a09b-10611f04211b=
%40isocpp.org</a>.<br />

------=_Part_4815_1407464808.1471925914645--

------=_Part_4814_1123196411.1471925914645--

.
