Date: Tue, 30 Jul 2024 12:22:50 +0200
On 30/07/2024 11.30, Pynix Wnag via Liaison wrote:
> I know, but these all are typedef,
What's wrong with that?
> Can we build these into language as keyword, make it default. and deprecate short long to typedef for compatibility
We can. We've done so for "true" and "false" in C23, for example.
However, the goal of C and C++ is to write programs portable across
a wide variety of platforms. Not all platforms are based on 8-bit bytes.
So, some platforms might offer an "int32" type, and others might offer
an "int36" type (but not an "int32" type). Some of the "modern languages"
do not facilitate as broad a portability story as C and C++ do.
Having an "int" type as the portable abstraction seems more useful.
That said, both WG14 and WG21 operate by reviewing papers that propose
changes. If you do wish to make a change happen, please write a paper
and submit it to those committees, with implementation experience and
good rationale. (Why is this improving the language? What's possible/easier
with the change that wasn't possible before?) Note that profound changes
need very thorough rationale, including consideration of backward
compatibility.
Also note that this particular mailing list is for awareness and discussion
of proposals for C or C++ that might affect the compatibility story with
the other language. It is not primarily for initial discussion of random
ideas, in particular since no decisions for either C or C++ can be made
in this forum.
Jens
> On Sun, Jul 28, 2024 at 5:41 PM Bjarne Stroustrup via Liaison <liaison_at_[hidden] <mailto:liaison_at_[hidden]>> wrote:
>
> This may help: https://en.cppreference.com/w/cpp/types/integer <https://en.cppreference.com/w/cpp/types/integer>
>
> On 7/28/2024 11:08 AM, Pynix Wnag via Liaison wrote:
> > any plan to make stdint types into language and compiler, modern
> > languages use width in type names, int8, int16, int32,
> > int64,uint8,uint16,uint32,uint64.
> > when I learn c language first time, I must try to remember short long
> > bit width.
> > why not use types with bit width?
> > no one want to remember usb version names, full speed, high
> > speed,ultra speed, what we want is usb 5g, usb10g, usb20g, usb40g.
> >
> > I always ask myself, how long “long” is, how short “short” is.
> > if we need 128 bit, how we call it, long long? double long?
> >
> > _______________________________________________
> > Liaison mailing list
> > Liaison_at_[hidden] <mailto:Liaison_at_[hidden]>
> > Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison <https://lists.isocpp.org/mailman/listinfo.cgi/liaison>
> > Link to this post: http://lists.isocpp.org/liaison/2024/07/1463.php <http://lists.isocpp.org/liaison/2024/07/1463.php>
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden] <mailto:Liaison_at_[hidden]>
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison <https://lists.isocpp.org/mailman/listinfo.cgi/liaison>
> Link to this post: http://lists.isocpp.org/liaison/2024/07/1464.php <http://lists.isocpp.org/liaison/2024/07/1464.php>
>
>
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2024/07/1465.php
> I know, but these all are typedef,
What's wrong with that?
> Can we build these into language as keyword, make it default. and deprecate short long to typedef for compatibility
We can. We've done so for "true" and "false" in C23, for example.
However, the goal of C and C++ is to write programs portable across
a wide variety of platforms. Not all platforms are based on 8-bit bytes.
So, some platforms might offer an "int32" type, and others might offer
an "int36" type (but not an "int32" type). Some of the "modern languages"
do not facilitate as broad a portability story as C and C++ do.
Having an "int" type as the portable abstraction seems more useful.
That said, both WG14 and WG21 operate by reviewing papers that propose
changes. If you do wish to make a change happen, please write a paper
and submit it to those committees, with implementation experience and
good rationale. (Why is this improving the language? What's possible/easier
with the change that wasn't possible before?) Note that profound changes
need very thorough rationale, including consideration of backward
compatibility.
Also note that this particular mailing list is for awareness and discussion
of proposals for C or C++ that might affect the compatibility story with
the other language. It is not primarily for initial discussion of random
ideas, in particular since no decisions for either C or C++ can be made
in this forum.
Jens
> On Sun, Jul 28, 2024 at 5:41 PM Bjarne Stroustrup via Liaison <liaison_at_[hidden] <mailto:liaison_at_[hidden]>> wrote:
>
> This may help: https://en.cppreference.com/w/cpp/types/integer <https://en.cppreference.com/w/cpp/types/integer>
>
> On 7/28/2024 11:08 AM, Pynix Wnag via Liaison wrote:
> > any plan to make stdint types into language and compiler, modern
> > languages use width in type names, int8, int16, int32,
> > int64,uint8,uint16,uint32,uint64.
> > when I learn c language first time, I must try to remember short long
> > bit width.
> > why not use types with bit width?
> > no one want to remember usb version names, full speed, high
> > speed,ultra speed, what we want is usb 5g, usb10g, usb20g, usb40g.
> >
> > I always ask myself, how long “long” is, how short “short” is.
> > if we need 128 bit, how we call it, long long? double long?
> >
> > _______________________________________________
> > Liaison mailing list
> > Liaison_at_[hidden] <mailto:Liaison_at_[hidden]>
> > Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison <https://lists.isocpp.org/mailman/listinfo.cgi/liaison>
> > Link to this post: http://lists.isocpp.org/liaison/2024/07/1463.php <http://lists.isocpp.org/liaison/2024/07/1463.php>
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden] <mailto:Liaison_at_[hidden]>
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison <https://lists.isocpp.org/mailman/listinfo.cgi/liaison>
> Link to this post: http://lists.isocpp.org/liaison/2024/07/1464.php <http://lists.isocpp.org/liaison/2024/07/1464.php>
>
>
> _______________________________________________
> Liaison mailing list
> Liaison_at_[hidden]
> Subscription: https://lists.isocpp.org/mailman/listinfo.cgi/liaison
> Link to this post: http://lists.isocpp.org/liaison/2024/07/1465.php
Received on 2024-07-30 10:22:55