220 28050 <4fcf4f5e-4a0a-49b9-b62e-ac9569858b11@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: FrankHB1989 <frankhb1989@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Stabilize the numeric types in all platforms
Date: Tue, 30 Aug 2016 04:48:42 -0700 (PDT)
Lines: 208
Approved: news@gmane.org
Message-ID: <4fcf4f5e-4a0a-49b9-b62e-ac9569858b11@isocpp.org>
References: <e10aed06-1df7-495b-93a2-10315cede76c@isocpp.org> <72b7e733-cb85-4f47-a09b-10611f04211b@isocpp.org> <18a39611-8088-4e04-be0a-bb1b7c485683@isocpp.org>
 <1706311.trY4MaExHO@tjmaciei-mobl1>
 <36958399-1282-4cef-a12b-0439e176aeda@isocpp.org>
 <616f8567-2214-4424-a1e3-85ce70e5c99b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1782_591487521.1472557722340"
X-Trace: blaine.gmane.org 1472557731 25718 195.159.176.226 (30 Aug 2016 11:48:51 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 30 Aug 2016 11:48:51 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCTJVBPG3QIBBG7FSW7AKGQEUMM3BVY@isocpp.org Tue Aug 30 13:48:46 2016
Return-path: <std-proposals+bncBCTJVBPG3QIBBG7FSW7AKGQEUMM3BVY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCTJVBPG3QIBBG7FSW7AKGQEUMM3BVY@isocpp.org>)
	id 1behX2-00065G-3I
	for gclcip-std-proposals@m.gmane.org; Tue, 30 Aug 2016 13:48:44 +0200
Original-Received: by mail-pf0-f199.google.com with SMTP id w128sf39310245pfd.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 30 Aug 2016 04:48:45 -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=EpxvnBxzyceB3oB5hRByl3Duwq+SbepECeAb4DJ3FUM=;
        b=NsWPVk5pO3k/LsL8xTg2lNkRKgIsU2iasFscNm6vtMS9IPDs5ALgleOdmlq0PFM7K/
         WUrpMzON6NT/j3/EwWUEe+3N+KcE3DDcmhAps/MKrR6tnwrTbhchgk5sQW4NFzl2pTv4
         DU9lz9GOkoe1estthppEcxsR9c3W6voMb5bCjyXKuQzmw4jKh8mzXndP6OdF3xLon8je
         aCiAZ9ukNa6N2piQgUlFe3HN5P0kcKELS1lZFSswsfXS0Bgn/zDVDJzvX5M+BrAtedrZ
         MYIodOiYSU2ikiHu3ipdaxH2BFeRnOWH8bJbe+5rC+lcgtCMqPvzVvFSakSpuyITkciN
         R6Fg==
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=EpxvnBxzyceB3oB5hRByl3Duwq+SbepECeAb4DJ3FUM=;
        b=rZ/6BfscKgc/PGqukJ6fbgRnxpwoAske4tNdA+7m+SPfdjAA0RByBPy8GmoqT+bzWh
         FEweTRqu4PrvcYZiy5JnDFjGmGrUTPXgK1K1zSOGqWlOq4J04PcWxV1uL2ivlT5i3htX
         GHZNsRbqgehgKDkPoOV7x+D7P7RqqXA3tYxZYXA4Ng3ly8wZUO8O2wUYwZL0euCSGenV
         SrqhB4vDnjp6/v5wgCFYNuNPvdsReFFSOsek9CxKUzX5vp+6OmnVpXPBC5klhSGprbWl
         cRngZ09/jn2TG6AP6QeE5hEIIA43HoNczSYkNrxvFnzs58AFMsaXehxW5KKr62Lz0dPH
         48CQ==
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=EpxvnBxzyceB3oB5hRByl3Duwq+SbepECeAb4DJ3FUM=;
        b=QvcHA4y+iaDmlsuSXbhGIrjJQSQ/bjS2WqV07TPDnecdc03DBKM8QlLCPNcCDAzd+S
         Zh31sv14NwU6JlhWLBYYG9Ygt8MZ7zp6LEXRW58fkHCYpp2LnhBk4KRxatVH1dv4+AVm
         nMh5E0F3TtaXXeTIvSi5du76PCzTeup/n5cK6CKvntIpnPYEqO9cV6Rvv/e2Pi2qCleh
         84mgYu2yO+OtvJKh1MbjlOSHhQwQgA54RnhPKzt0V8j6oVDEgzJgZ1IZMts8TXSz9HRd
         ejvQAbmPVJaJg8mb2IfSDhOq0Bl1+2iXrZDGZ0wEsYj4MEGNfGqxID8uztKpJxNrMZH2
         G7uA==
X-Gm-Message-State: AE9vXwMKxvzyAM1iLDhc8SOkKu8PjQXpTXNgm1lbmvL5Bl0xVwdKbhD5LHhdNDavH+E8DQ==
X-Received: by 10.66.246.197 with SMTP id xy5mr1481758pac.47.1472557724594;
        Tue, 30 Aug 2016 04:48:44 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.242.68 with SMTP id j65ls1138046ith.8.gmail; Tue, 30 Aug
 2016 04:48:43 -0700 (PDT)
X-Received: by 10.36.225.69 with SMTP id n66mr94317ith.3.1472557723348;
        Tue, 30 Aug 2016 04:48:43 -0700 (PDT)
In-Reply-To: <616f8567-2214-4424-a1e3-85ce70e5c99b@isocpp.org>
X-Original-Sender: frankhb1989@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:28050
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28050>

------=_Part_1782_591487521.1472557722340
Content-Type: multipart/alternative; 
	boundary="----=_Part_1783_582962063.1472557722340"

------=_Part_1783_582962063.1472557722340
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

=20
=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=8B=E5=8D=889:33:09=EF=BC=8CNicol Bolas=E5=86=99=E9=81=93=EF=BC=9A
>
> On Tuesday, August 23, 2016 at 7:31:20 AM 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 =
UTC+8=E4=B8=8B=E5=8D=8812:49:54=EF=BC=8CThiago Macieira=E5=86=99=E9=81=93=
=EF=BC=9A
>>>
>>> On segunda-feira, 22 de agosto de 2016 21:36:12 PDT FrankHB1989 wrote:=
=20
>>> > OK, I should have said, they are not mandated *by the core language*,=
=20
>>> or,=20
>>> > not guaranteed both built-in and portable.=20
>>>
>>> They are mandated in a header that complements the core language. Just=
=20
>>> like=20
>>> <intializer_list>, <type_traits> and <limits>, those types cannot be=20
>>> implemented by anyone except the compiler vendor.=20
>>>
>>> Therefore, for all intents and purposes, the minimum-width and fast=20
>>> integer=20
>>> types are guaranteed to be portable.=20
>>>
>>> The exact-width ones aren't guaranteed to be portable because their=20
>>> concept=20
>>> isn't portable. Some machines don't have 8-, 16-, 32- and 64-bit types=
=20
>>> (they=20
>>> could be multiples of 9 bits). Also note how int32_t is required to use=
=20
>>> two's=20
>>> complement representation, which again excludes some machines.=20
>>>
>>> Good point about 2's complements. However, all of these are what I have=
=20
>> already known. I still wonder why these (at least partially) width-aware=
=20
>> types are not in the core language while traditional fundamental integer=
=20
>> types are still in it.
>>
>
> ... why does it matter if it's a reserved keyword or not? It's *there*;=
=20
> it's available on every platform that provides C++11 or better. You can u=
se=20
> it to solve the problem you have with types not having a relatively fixed=
=20
> size.
>
> I don't think "to solve the problem you have with types not having a=20
relatively fixed size" useful in reality. Overflow of signed integers leads=
=20
to UB. Wrapped behavior on unsigned integers will cause unexpected result=
=20
too easily. Without a concrete limit of the range, they are dangerous (if=
=20
not that useless). So we need to know the size sooner or later. When size=
=20
is needed, they are *almost always suboptimal* choices. With such types we=
=20
actually have some implicit weak guarantees, e.g. an INT_MAX should be=20
greater than 32767. That's too subtle on readability. And I find nothing=20
reasonable to encourage such use. Then keeping them would cause=20
teachability problems, probably.

Well, I admit I am not motivated enough to push the change forward=20
currently since it does not benefit much at once. But getting consensus on=
=20
some points of design should be good.

The placement of something in the standard library or core language is not=
=20
> based on some evaluation of the *merit* of the feature.
>

Please also note "it works" should not be a normal reason in a process of=
=20
standardization. There will be great risks to simply pile features without=
=20
enough alternative choices considered carefully, and this will probably=20
waste time a lot in future (e.g. `export` and dynamic exception=20
specification). To do the "right thing" pedantically is unlikely to be a=20
premature optimization in such cases than in ordinary projects.

There should be at least one topic concerned here: the return type of=20
`std::uncaught_exceptions`.=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/4fcf4f5e-4a0a-49b9-b62e-ac9569858b11%40isocpp.or=
g.

------=_Part_1783_582962063.1472557722340
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">=C2=A0<iframe style=3D"padding: 0px; position: absolute; t=
op: 0px; left: 0px; width: 1456px; height: 188px; visibility: hidden;" fram=
eborder=3D"0"></iframe><br>=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=8B=E5=8D=889:33:09=EF=BC=8CNicol Bolas=
=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">On Tuesday, August 23, 2016 at 7:31:20 AM UTC-4, FrankHB1989 =
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 20=
16=E5=B9=B48=E6=9C=8823=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=8C UTC+8=E4=B8=8B=
=E5=8D=8812:49:54=EF=BC=8CThiago Macieira=E5=86=99=E9=81=93=EF=BC=9A<blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex">On segunda-feira, 22 de agosto de 2016 21:=
36:12 PDT FrankHB1989 wrote:
<br>&gt; OK, I should have said, they are not mandated *by the core languag=
e*, or,=20
<br>&gt; not guaranteed both built-in and portable.
<br>
<br>They are mandated in a header that complements the core language. Just =
like=20
<br>&lt;intializer_list&gt;, &lt;type_traits&gt; and &lt;limits&gt;, those =
types cannot be=20
<br>implemented by anyone except the compiler vendor.
<br>
<br>Therefore, for all intents and purposes, the minimum-width and fast int=
eger=20
<br>types are guaranteed to be portable.
<br>
<br>The exact-width ones aren&#39;t guaranteed to be portable because their=
 concept=20
<br>isn&#39;t portable. Some machines don&#39;t have 8-, 16-, 32- and 64-bi=
t types (they=20
<br>could be multiples of 9 bits). Also note how int32_t is required to use=
 two&#39;s=20
<br>complement representation, which again excludes some machines.
<br>
<br></blockquote><div>Good point about 2&#39;s complements. However, all of=
 these are what I have already known. I still wonder why these (at least pa=
rtially) width-aware types are not in the core language while traditional f=
undamental integer types are still in it.</div></div></blockquote><div><br>=
.... why does it matter if it&#39;s a reserved keyword or not? It&#39;s <i>t=
here</i>; it&#39;s available on every platform that provides C++11 or bette=
r. You can use it to solve the problem you have with types not having a rel=
atively fixed size.<br><br></div></div></blockquote><div>I don&#39;t think =
&quot;to solve the problem you have with types not having a=20
relatively fixed size&quot; useful in reality. Overflow of signed integers=
=20
leads to UB. Wrapped behavior on unsigned integers will cause unexpected
 result too easily. Without a concrete limit of the range, they are=20
dangerous (if not that useless). So we need to know the size sooner or=20
later. When size is needed, they are <i>almost always suboptimal</i>=20
choices. With such types we actually have some implicit weak guarantees,
 e.g. an INT_MAX should be greater than 32767. That&#39;s too subtle on=20
readability. And I find nothing reasonable to encourage such=20
use. Then keeping them would cause teachability problems, probably.<br><br>=
Well, I admit I am not motivated enough to push the change forward=20
currently since it does not benefit much at once. But getting consensus=20
on some points of design should be good.<br><br></div><blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;"><div dir=3D"ltr"><div>The placement of something in=
 the standard library or core language is not based on some evaluation of t=
he <i>merit</i> of the feature.<br></div></div></blockquote><div><br>Please=
 also note &quot;it works&quot; should=20
not be a normal reason in a process of standardization. There will be great=
 risks to simply pile features without enough alternative choices considere=
d carefully, and this will probably waste time a lot in future (e.g. `expor=
t` and dynamic exception specification). To do the &quot;right thing&quot; =
pedantically is unlikely to be a premature optimization in such cases than =
in ordinary projects.<br><br>There should be at least one topic concerned h=
ere: the return type of `std::uncaught_exceptions`. <br><br><br><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/4fcf4f5e-4a0a-49b9-b62e-ac9569858b11%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4fcf4f5e-4a0a-49b9-b62e-ac9569858b11=
%40isocpp.org</a>.<br />

------=_Part_1783_582962063.1472557722340--

------=_Part_1782_591487521.1472557722340--

.
