Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Faith: not *wanting* to know what is true." -- Friedrich Nietzsche


devel / comp.lang.c / Re: you think rust may outthrone c?

SubjectAuthor
* you think rust may outthrone c?fir
`* Re: you think rust may outthrone c?Blue-Maned_Hawk
 +- Re: you think rust may outthrone c?jak
 +* Re: you think rust may outthrone c?fir
 |`- Re: you think rust may outthrone c?fir
 +* Re: you think rust may outthrone c?rek2 hispagatos
 |`* Re: you think rust may outthrone c?Kaz Kylheku
 | `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  +* Re: you think rust may outthrone c?Scott Lurndal
 |  |`* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | +* Re: you think rust may outthrone c?Bart
 |  | |`* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | +* Re: you think rust may outthrone c?Bart
 |  | | |+* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | ||`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | || `- Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |`* Re: you think rust may outthrone c?David Brown
 |  | | | `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |  +* Re: you think rust may outthrone c?David Brown
 |  | | |  |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |  | `- Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |  `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |   `* Re: you think rust may outthrone c?Kalevi Kolttonen
 |  | | |    `* Re: you think rust may outthrone c?David Brown
 |  | | |     +* Re: you think rust may outthrone c?Scott Lurndal
 |  | | |     |`- Re: you think rust may outthrone c?Keith Thompson
 |  | | |     `* Re: you think rust may outthrone c?Keith Thompson
 |  | | |      +- Re: you think rust may outthrone c?David Brown
 |  | | |      `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |       `* Re: you think rust may outthrone c?David Brown
 |  | | |        `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |         `* Re: you think rust may outthrone c?David Brown
 |  | | |          +- Re: you think rust may outthrone c?fir
 |  | | |          +* Re: you think rust may outthrone c?fir
 |  | | |          |`* Re: you think rust may outthrone c?fir
 |  | | |          | `- Re: you think rust may outthrone c?fir
 |  | | |          `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |           `* Re: you think rust may outthrone c?Bart
 |  | | |            +* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            |`* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | +* Re: you think rust may outthrone c?David Brown
 |  | | |            | |+* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | ||+* Re: you think rust may outthrone c?David Brown
 |  | | |            | |||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            | ||||`* Re: you think rust may outthrone c?Tim Rentsch
 |  | | |            | |||| `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            | |||`* Re: you think rust may outthrone c?Bart
 |  | | |            | ||| +- Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            | ||| `- Re: you think rust may outthrone c?David Brown
 |  | | |            | ||`- Re: you think rust may outthrone c?Scott Lurndal
 |  | | |            | |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |            | | +- Re: you think rust may outthrone c?David Brown
 |  | | |            | | `* Re: you think rust may outthrone c?jak
 |  | | |            | |  `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |            | |   +- Re: you think rust may outthrone c?jak
 |  | | |            | |   `- Re: you think rust may outthrone c?Tim Rentsch
 |  | | |            | `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            |  `* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |            |   +- Re: you think rust may outthrone c?David Brown
 |  | | |            |   `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |            `* Re: you think rust may outthrone c?David Brown
 |  | | |             `* Re: you think rust may outthrone c?fir
 |  | | |              +* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              |`* Re: you think rust may outthrone c?David Brown
 |  | | |              | +* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | |+* Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||+- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |              | |||`- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              | ||`- Re: you think rust may outthrone c?fir
 |  | | |              | |`- Re: you think rust may outthrone c?Bart
 |  | | |              | `- Re: you think rust may outthrone c?Chris M. Thomasson
 |  | | |              `* Re: you think rust may outthrone c?fir
 |  | | |               `* Re: you think rust may outthrone c?Bart
 |  | | |                +* Re: you think rust may outthrone c?Keith Thompson
 |  | | |                |+* Re: you think rust may outthrone c?Bart
 |  | | |                ||+* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                |||`* Re: you think rust may outthrone c?Bart
 |  | | |                ||| +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| +* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| |+* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||+- Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| || `* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||  `* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   +* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||   |`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   | `* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||   |  `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| ||   `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| ||    `- Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| |+* Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||+* Re: you think rust may outthrone c?Ike Naar
 |  | | |                ||| |||`- Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||+* Re: you think rust may outthrone c?David Brown
 |  | | |                ||| |||`* Re: you think rust may outthrone c?Bart
 |  | | |                ||| ||| `- Re: you think rust may outthrone c?David Brown
 |  | | |                ||| ||`* Re: you think rust may outthrone c?Ben Bacarisse
 |  | | |                ||| || +- Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                ||| || +* Re: you think rust may outthrone c?Malcolm McLean
 |  | | |                ||| || `* Re: you think rust may outthrone c?Bart
 |  | | |                ||| |`* Re: you think rust may outthrone c?Scott Lurndal
 |  | | |                ||| `* Re: you think rust may outthrone c?Keith Thompson
 |  | | |                ||`- Re: you think rust may outthrone c?Keith Thompson
 |  | | |                |`* Re: you think rust may outthrone c?Kaz Kylheku
 |  | | |                `* Re: you think rust may outthrone c?fir
 |  | | +* Yeah, C is harder than many programming languages. Your point? (Was: you think Kenny McCormack
 |  | | +* Re: you think rust may outthrone c?Po Lu
 |  | | `* Re: you think rust may outthrone c?Kaz Kylheku
 |  | +* Re: you think rust may outthrone c?David Brown
 |  | `- Re: you think rust may outthrone c?Po Lu
 |  `* Re: you think rust may outthrone c?Anton Shepelev
 `* Re: you think rust may outthrone c?Bonita Montero

Pages:123456789101112131415161718192021222324252627282930313233343536373839
Re: you think rust may outthrone c?

<86jzuuvxk2.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26403&group=comp.lang.c#26403

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Thu, 20 Jul 2023 18:54:37 -0700
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <86jzuuvxk2.fsf@linuxsc.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u8p0kv$h9r$1@matrix.hispagatos.org> <20230713104558.553@kylheku.com> <u8phd0$3niul$1@dont-email.me> <UpYrM.257503$W7d4.2562@fx18.iad> <u8pmt9$3o80g$1@dont-email.me> <u8q0q4$3p89v$1@dont-email.me> <u8qqpv$3v3pg$1@dont-email.me> <s3ma5vyveo9.fsf@yahoo.com> <u8rhrs$1b2m$1@dont-email.me> <s0dttu5ln36.fsf@yahoo.com> <871qh9zjke.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="2d78163bfb891e7187c96a580a5a5784";
logging-data="3116812"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qGn+WTzqlrvNXywzvZ0RHfXvhaSbTLhk="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:T2auWV2xBVk4BuPp+cGMskmirHE=
sha1:VlU52Pm6BdkeroP8jkWkDFWQGoY=
 by: Tim Rentsch - Fri, 21 Jul 2023 01:54 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Po Lu <luangruo@yahoo.com> writes:
>
>> kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
>>
>>> Po Lu <luangruo@yahoo.com> wrote:
>>>
>>>> kalevi@kolttonen.fi (Kalevi Kolttonen) writes:
>>>>
>>>>> No. Lots of C programs are quite portable. That includes e.g. Linux
>>>>> kernel, BSD kernels, PostgreSQL, Apache, Postfix, and many,
>>>>> many other Unix daemons. PostgreSQL runs not only on Unix
>>>>> but even on Windows. Possibly OpenLDAP does, too.
>>>>
>>>> Yet none of these programs strictly conform to a Standard. They are
>>>> more or less conforming programs, meaning that they are acceptable
>>>> to
>>>> the C implementations that they have been ported to.
>>>
>>> You could well be right. But invoking UB is something so evil
>>> that no C or C++ program must ever do it, meaning that the
>>> programmers must know enough to avoid it.
>>>
>>> Since you seem to be confident about your claim, is it possible
>>> for you to describe what aspects of Postfix are non-corforming
>>> C code?
>>
>> Not strictly conforming? Easy: any code that assumes char is 8 bits
>> wide, or that int can hold values larger than 32766.
>
> 32767.
>
> Or any code whose behavior depends on those things. For example, this:
>
> #include <stdio.h>
> #include <limits.h>
> int main(void) {
> printf("%d\n", INT_MAX);
> }
>
> is in a sense 100% portable to any hosted implementation, but it's not
> strictly conforming.
>
>>> Speaking of MTAs, Sendmail was/is portable enough so that it runs
>>> on practically every modern and not-so-modern UNIX. This being
>>> the case, one could assume that its C code must be very
>>> standards compliant, no? What do you think?
>>
>> What exactly is ``standards compliance''?
>> Mere conformance, or strict conformance?
>
> A "conforming program" is one that is acceptable to a conforming
> implementation -- an almost absurdly weak condition. If there's a C
> implementation that accepts Fortran programs as an extension (after
> issuing any required diagnostic), then a Forgran program is a
> "conforming program", though I doubt that the authors meant the
> definition to be quite that loose.
>
> But I think there's an intermediate level of conformance: a "correct
> program".
>
> A program that is correct in all other aspects, operating on correct
> data, containing unspecified behavior shall be a correct program and
> act in accordance with 5.1.2.3.
>
> (This in section 4 of the ISO C standard.)

Note that a "correct program" can include programs that depend on
unspecified behavior, and on implementation-defined behavior, and
on implementation-specific extensions covering particular cases
of undefined behavior. There is nothing "incorrect" about
depending on extensions that cover areas of undefined behavior.

Re: you think rust may outthrone c?

<86bkg6vx1y.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26405&group=comp.lang.c#26405

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Thu, 20 Jul 2023 19:05:29 -0700
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <86bkg6vx1y.fsf@linuxsc.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u8p0kv$h9r$1@matrix.hispagatos.org> <20230713104558.553@kylheku.com> <u8phd0$3niul$1@dont-email.me> <UpYrM.257503$W7d4.2562@fx18.iad> <u8pmt9$3o80g$1@dont-email.me> <u8q0q4$3p89v$1@dont-email.me> <u8qqpv$3v3pg$1@dont-email.me> <s3ma5vyveo9.fsf@yahoo.com> <u8rhrs$1b2m$1@dont-email.me> <u8rpuu$24m6$3@dont-email.me> <u8rsjl$2i8m$1@dont-email.me> <u8rvj6$31dr$1@dont-email.me> <u8s0fc$33sa$2@dont-email.me> <1e547403-da8a-45ce-a178-79a8f62c1569n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="2d78163bfb891e7187c96a580a5a5784";
logging-data="3116812"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GyIHrW6/V4taN2Q4JSp9w9Pms+4P5g0o="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:Ry7KGSKsxYw/QSGTDUACr1IsXFo=
sha1:jDoM3B3TA2B9Fzp+RyJ6rm7g9dE=
 by: Tim Rentsch - Fri, 21 Jul 2023 02:05 UTC

Paul N <gw7rib@aol.com> writes:

> On Friday, July 14, 2023 at 6:26:20?PM UTC+1, Kalevi Kolttonen wrote:
>
>> David Brown <david...@hesbynett.no> wrote:
>>
>>>> Your code containing UB can work fine in the environment that you
>>>> use, but it might not work when you compile it elsewhere.
>>>
>>> Just like other bugs.
>>
>> Could you please provide a simple example of such a bug,
>> i.e. it must a bug that is not caused by relying on
>> Implementation Defined behavior or Undefined Behavior?
>
> I think you could get such a bug if you assume that the letters of
> the alphabet all have consecutive values. It's true of many
> computers today, but was not true of the mainframe when I was at
> university, which used EBCDIC instead of ASCII. As I understand it,
> this is not "Implementation Defined behaviour" because there is no
> requirement to say what values the letters have.

The values of members of the execution character set are indeed
implementation defined. Section 5.2.1, paragraph 1.

Re: you think rust may outthrone c?

<87bkg6ow4x.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26406&group=comp.lang.c#26406

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 03:07:10 +0100
Organization: A noiseless patient Spider
Lines: 114
Message-ID: <87bkg6ow4x.fsf@bsb.me.uk>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<0ff5dfe1-de32-4dae-872e-5401a3c04c97n@googlegroups.com>
<u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me>
<874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<874jm0t41e.fsf@bsb.me.uk>
<6425092b-d2ab-40c7-af6d-b1c1e73ef1cbn@googlegroups.com>
<878rbbsw0o.fsf@bsb.me.uk>
<076c5a98-4eea-4cce-b0fc-7f1a6305fe94n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="4d6d411b072660d280bdd2ba4d2c5af7";
logging-data="3248136"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Wb0hlBokJQpZayG+P8JnFH6DlStWDb1Y="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:+iSg9ebjnbtZ8X5S8v2/CXQZyTM=
sha1:tTAad1NglJ9h4PRgu8cjw8+F0t0=
X-BSB-Auth: 1.0922a542881dd89f1c18.20230721030710BST.87bkg6ow4x.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 21 Jul 2023 02:07 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On Wednesday, 19 July 2023 at 17:31:51 UTC+1, Ben Bacarisse wrote:
>> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>>
>> > On Wednesday, 19 July 2023 at 14:38:36 UTC+1, Ben Bacarisse wrote:
>> >> Malcolm McLean <malcolm.ar...@gmail.com> writes:
>> >>
>> >> > On Wednesday, 19 July 2023 at 03:31:43 UTC+1, Ben Bacarisse wrote:
>> >> >> Bart <b...@freeuk.com> writes:
>> >> >>
>> >> >> > On 18/07/2023 03:25, Ben Bacarisse wrote:
>> >> >> >> Bart <b...@freeuk.com> writes:
>> >> >> >>>
>> >> >> You /are/ allowed to use it. The fact that it is undefined simply means
>> >> >> that the definition of the language does not say what the code means.
>> >> >> >> I really don't know what you hope to gain by saying obvious things like
>> >> >> >> this other than to (incorrectly) imply that C -- the language -- is not
>> >> >> >> defined by it's defining documents -- the ISO standards -- but by
>> >> >> >> compiler options.
>> >> >> >
>> >> >> > I've given examples in the past where the same C program either:
>> >> >> >
>> >> >> > * Passed with 0 lines of errors or warnings
>> >> >> >
>> >> >> > * Passed with 28,000 lines of warnings and notes (on a 40Kloc input)
>> >> >> So you are still trying to imply that C -- the language -- is not
>> >> >> defined by it's defining documents -- the ISO standards -- but by
>> >> >> compiler options. You are still wrong.
>> >> >>
>> >> > For someone implementing a compiler, the language is defined by the
>> >> > standards document. But for someone who is not implementing a
>> >> > compiler, the language is ultimatelt defined by the behaviour of
>> >> > compilers.
>> >> Your use of the definite article is permitting a confusion to go
>> >> unnoticed. I would say that you are talking about two languages here:
>> >> there is the C language (defined by the standards) and the language
>> >> implemented by the compiler. We usually hope that they are very
>> >> similar.
>> >>
>> >> The language implemented by the compiler is obviously very important in
>> >> practice, but it's almost impossible to talk about it because it
>> >> includes everything from bugs to misunderstandings of the standards.
>> >>
>> > It's also because the standard has to include every extant
>> > architecture,
>> I'm not sure what "it" refers to here so I'll leave this bit alone...
>> > and maybe some which don't exist but theoretically could exist, like
>> > Fibonacci representation machines. Whilst in fact you can probably
>> > rely on features like CHAR_BIT being exactly eight. The standard
>> > doesn't guarantee it, but the vast majority of achitectures make it
>> > natural, and on big mainframes that don't allow 8 bit memory access,
>> > in fact C compilers put the program through ANDs and ORs to create 8
>> > bit chars, because otherwise too much code breaks. Only digital
>> > signals processing chips have wider chars, and they can't run general
>> > purpose programs anyway.
>> >>
>> >> In that sense, this second language is defined only by the compiler
>> >> source code -- it's still not defined by the options. Bart wants to
>> >> spread confusion by suggesting that C is a language defined by compiler
>> >> options.
>> >>
>> > It is a bit of an odd situation. If we write a program which branches
>> > if a char is negative, it will produce one output if we use the
>> > "signed chars" option and another if we use the "unsigned chars"
>> > option. So two executables with the same source and written in the
>> > same language produce different output.
>> Yes, but I am surprised you think that's odd. Maybe I think about the
>> meaning of programs in very different terms to you. In formal
>> semantics, there's no problem stating that there is more than one
>> possible output, and when being informal you just need to adjust the
>> words a bit. The "meaning" of this program:
>>
>> #include <stdio.h>
>>
>> int main(void) { printf("%u\n", -1u); }
>>
>> is "print the decimal representation of the largest unsigned int". It's
>> not "print 4294967295" or "print 65535" (or any of the other
>> possibilities).
>>
> The intention of the programmer might be to print the largest unsigned
> int, or it might be to print 65535.

This indent does not alter the meaning. If the intent was to print
65535, the programmer needs to consider other careers.

>> > So you can argue that in fact
>> > the language can't be the same. Or you can argue, as you have done,
>> > that computer languages allow for a sort of ambiguity which we don't
>> > see in natural languages.
>> I am not arguing that. For one thing, I don't consider "print the
>> decimal representation of the largest unsigned int" to be ambiguous, but
>> even if you do consider it so, it is ambiguous in a very particular
>> sense, quite unlike most ambiguities in natural language.
>>
> In natural language your ambiguity is "does this mean the largest
> unsigned int in existence, which is probably 2^128 -1, or the largest
> unsigned int on the partiuclar machine we are discussing?" You need
> context to know the answer, and of course in this case, you mean the
> second.

No, I don't mean that. I don't mean either of your suggested
re-wordings. And, yes, we need context. The context is using English
to approximate the formal semantics of a C program. We are not
discussing a machine or probable values. We are discussing the
semantics of a computer programming language. In that context "unsigned
int" behaves like a type variable. All we know about it is what the C
standard says about unsigned int. We know its relative rank, for
example, and we know that -1u is an expression whose value is it's
largest value.

--
Ben.

Re: you think rust may outthrone c?

<867cquvwhu.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26407&group=comp.lang.c#26407

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Thu, 20 Jul 2023 19:17:33 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <867cquvwhu.fsf@linuxsc.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <u8qqpv$3v3pg$1@dont-email.me> <u8r94r$dn9$1@dont-email.me> <u8rcu9$qd2$1@dont-email.me> <u8rdrf$uca$1@dont-email.me> <20230714140153.112@kylheku.com> <u8sf33$4nc3$1@dont-email.me> <u8u3ge$cscl$1@dont-email.me> <87sf9oye05.fsf@nosuchdomain.example.com> <a189a8ff-5e91-43b7-9601-1f29b6a667bfn@googlegroups.com> <u90c0s$nr2u$1@dont-email.me> <0ff5dfe1-de32-4dae-872e-5401a3c04c97n@googlegroups.com> <u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk> <u923gr$tf08$1@dont-email.me> <87mszvwbwl.fsf@bsb.me.uk> <ea263e0e-b936-43d2-a4b2-9fe62ccccce9n@googlegroups.com> <u93dlc$158qe$1@dont-email.me> <20230717113353.356@kylheku.com> <u9bv2c$2r3ek$1@dont-email.me> <20230720121839.520@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="2d78163bfb891e7187c96a580a5a5784";
logging-data="3251267"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/P6jnODT+3rufMgy8hRreGaQaEV8S5MTc="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:4zqwcEFZygG58ajOXb+5x9b45SE=
sha1:z1QYQcvPhNU3V8051JmA0Iq5l6Y=
 by: Tim Rentsch - Fri, 21 Jul 2023 02:17 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:

[slightly reformatted for white space]

> On 2023-07-20, jak <nospam@please.ty> wrote:
>
>> Kaz Kylheku ha scritto:
>>
>>> With C99 syntax, we can do that as one expression:
>>>
>>> #include <stdio.h>
>>>
>>> #define union_cast(to_type, from_type, value) \
>>> ((union { to_type to; from_type from; }){ .from = (value) }.to)
>>
>> Around the web I found this macro similar to yours:
>>
>> #define chk_sign(from_type, value) \
>> (!!(union { \
>> from_type from; \
>> struct { \
>> uint64_t rest : ((sizeof(from_type) * CHAR_BIT) - 1); \
>> uint64_t sign : 1; \
>> } to; \
>> }) { .from = (value) }.to.sign)
>
> That alone not work on anything but big endian machines.

Look again. It works fine on my little endian machine.

Re: you think rust may outthrone c?

<u9d4n6$34eab$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26412&group=comp.lang.c#26412

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuy...@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 01:22:46 -0400
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <u9d4n6$34eab$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<87sf9niqb6.fsf@bsb.me.uk> <u923gr$tf08$1@dont-email.me>
<u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<u98g5n$2469a$1@dont-email.me> <u98rs9$26ae9$1@dont-email.me>
<87mszrsx6z.fsf@bsb.me.uk> <u99alq$292ke$1@dont-email.me>
<87wmyvr9kg.fsf@bsb.me.uk> <87fs5jseuv.fsf@nosuchdomain.example.com>
<20230719160546.668@kylheku.com> <87bkg7s5zt.fsf@nosuchdomain.example.com>
<u9aunu$2l5mt$1@dont-email.me> <20230720085729.566@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 05:22:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ad393336d9417b97520321ec091588f9";
logging-data="3291467"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19IOA/IwtOOWJ+OaU6jpGlgK02/MjInfFM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:LDBFhMTYwwJ5+1QCHytEJw4+f5A=
Content-Language: en-US
In-Reply-To: <20230720085729.566@kylheku.com>
 by: James Kuyper - Fri, 21 Jul 2023 05:22 UTC

On 7/20/23 12:44, Kaz Kylheku wrote:
> On 2023-07-20, David Brown <david.brown@hesbynett.no> wrote:
....
>> 6.7.9p10 says:
>>
>> """
>> If an object that has automatic storage duration is not initialized
>> explicitly, its value is indeterminate.
>> """
>
> Here we can "macro expand" the definition of indeterminate; this means
> exactly the same thing as "it has either an unspecified
> value, or else a trap representation".

Defining an indeterminate "value" as possibly being a trap
"representation" confuses the distinction between a representation of a
value and the value represented. I think it would have been better to
specify that an object can contain an indeterminate representation,
which is either a trap representation or a representation of an
unspecified value. They didn't consult me about it, for some reason :-).

> If the implementation doesn't have the latter, it has to be the former.

Yes, whenever it's possible to determine that a given type has no trap
representations, an indeterminate value of that type can only be an
unspecified value. The standard guarantees directly that some types have
no trap representations, and you can derive the fact that unsigned char
has no trap representations from the fact that the number of different
non-trap representations it is required to have leaves no room for any
representations to be trap representations.

As a separate matter, if an implementation documents that a given type
has no trap representations, indeterminate values of that type cannot be
trap representations when using that implementation, regardless of
whether they might be on some other implementation.

Re: you think rust may outthrone c?

<648a342f-a940-4f99-bc9a-e2c9ce175fccn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26413&group=comp.lang.c#26413

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1a0b:b0:404:284d:d6c5 with SMTP id f11-20020a05622a1a0b00b00404284dd6c5mr3401qtb.11.1689918409856;
Thu, 20 Jul 2023 22:46:49 -0700 (PDT)
X-Received: by 2002:ad4:55c3:0:b0:635:de09:205d with SMTP id
bt3-20020ad455c3000000b00635de09205dmr3752qvb.1.1689918409650; Thu, 20 Jul
2023 22:46:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 20 Jul 2023 22:46:49 -0700 (PDT)
In-Reply-To: <87cz0mqe90.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:2d3c:9ceb:ad56:e836;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:2d3c:9ceb:ad56:e836
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com> <b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk> <u94pch$1dpd6$1@dont-email.me>
<87edl6uf9y.fsf@bsb.me.uk> <u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com> <87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com> <u98odb$25mj8$1@dont-email.me>
<87jzuvsg7q.fsf@nosuchdomain.example.com> <u9cfmj$2trto$1@dont-email.me>
<87h6pyqgnp.fsf@nosuchdomain.example.com> <6317c8eb-a3bd-41ad-b9fb-e07a51505febn@googlegroups.com>
<87cz0mqe90.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <648a342f-a940-4f99-bc9a-e2c9ce175fccn@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Fri, 21 Jul 2023 05:46:49 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3855
 by: Malcolm McLean - Fri, 21 Jul 2023 05:46 UTC

On Friday, 21 July 2023 at 01:50:51 UTC+1, Keith Thompson wrote:
> Malcolm McLean <malcolm.ar...@gmail.com> writes:
> [...]
> > Try this one.
> >
> > #include <stdio.h>
> > #include <stdint.h>
> > #include <string.h>
> >
> > int main(void)
> > {
> > uint32_t nanpattern = 0x7f801234;
> > float x;
> >
> > memcpy(&x, &nanpattern, 4);
> > printf("x %f\n", x);
> > if (x + 1 > x)
> > {
> > printf("Doesn't honour nan\n");
> > }
> > else
> > {
> > printf("Nan handled correctly\n");
> > }
> >
> > return 0;
> > }
> On my system, it prints:
> x nan
> Nan handled correctly
> when compiled with both gcc and clang at all optimization levels.
> > If it behaves in the same way then it is bugged.
> You may be right (assuming 0x7f801234 copied into a float yields a NaN;
> I don't think the C standard specifies that), but I haven't given it
> much though.
>
That's why I printed it out. Just to check.
IEEE 754 mandates a particular pattern for a 32 bit float, and virtually everyone
now uses that standard. But the C standard doesn't require it. However IEEE 754
doesn't impose endianness requirements. But usually when interpreted as a 32
bit integer, the sign bit will be the most significant bit, the exponent bits the next bits,
and the mantissa the least significant bits.
>
> For any two valid integer values x and y, exactly one of x<y, x==y, x>y
> is true. That's not the case for floating-point values, which means
> that a compiler cannot assume (x + 1 > x) without information about the
> value of x (given an implementation that supports NaNs).
>
Yes, exactly. it shouldn't assume that x + 1 > x for integer arithmetic either because

if (x + 1 > x)
{ y = x + 1;
if ( y > x) /* must be true ? */
}

and gcc's behaviour is undesireable.

Re: you think rust may outthrone c?

<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26414&group=comp.lang.c#26414

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!bluemanedhawk.eternal-september.org!.POSTED!not-for-mail
From: bluemane...@gmail.com (Blue-Maned_Hawk)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 02:06:36 -0400
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Fri, 21 Jul 2023 06:06:37 -0000 (UTC)
Injection-Info: bluemanedhawk.eternal-september.org; posting-host="1ef7a27b3d9d02ef5d9cdd7dc0121f29";
logging-data="3304232"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KmJEfpPKF6ev6v1VXzffoYSQ/DPQR4WM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:d3AWKZZ0Rj7Sr1EUTVhLHevoHrg=
In-Reply-To: <u9bs1u$2qj43$1@dont-email.me>
Content-Language: en-US
 by: Blue-Maned_Hawk - Fri, 21 Jul 2023 06:06 UTC

On 7/20/23 13:48, Bonita Montero wrote:
> Am 20.07.2023 um 16:25 schrieb Bonita Montero:
>> Am 20.07.2023 um 14:49 schrieb Blue-Maned_Hawk:
>>> On 7/20/23 05:07, Bonita Montero wrote:
>>>> Am 20.07.2023 um 01:16 schrieb Blue-Maned_Hawk:
>>>>> On 7/19/23 12:07, Bonita Montero wrote:
>>>>>> Am 18.07.2023 um 12:37 schrieb Blue-Maned_Hawk:
>>>>>>> On 7/17/23 12:26, Bonita Montero wrote:
>>>>>>>> Am 13.07.2023 um 07:37 schrieb Blue-Maned_Hawk:
>>>>>>>>>
>>>>>>>>> ​Ain't nothing gonna dethrone C until a total revolution of the
>>>>>>>>> modern computing ecosystem; in other words, replacing C would
>>>>>>>>> require replacing everything else all at once.
>>>>>>>>
>>>>>>>> C has already been dethroned many times.
>>>>>>>
>>>>>>> ​I think you and i have different definitions of "dethrone" here.
>>>>>>
>>>>>> This statement is based on the language features. There are now
>>>>>> some languages that are also system-related and also allow almost
>>>>>> optimal performance, but are much more comfortable to program.
>>>>>> F.e. Rust and C++.
>>>>>>
>>>>>
>>>>> ​Languages do not exist in a vacuum; whether or not a language is
>>>>> hypothetically better than C matters not for its practicality in
>>>>> the face of C's pervasiveness.
>>>>
>>>> Rust and C++ can replace C equally well given the
>>>> tools and the languages.
>>>>
>>>
>>> ​The fact that it's possible doesn't mean that it will happen; again,
>>> languages do not exist in a vaccuum.
>>
>> C is chosen many times when C or C++ would be a viable option
>                               ^ Rust
>> and both would save much work.
>>
>>
>
​What evidence have you that they would save work? On the contrary, i'd
say that the insane complexity of C++ and the hostile culture
surrounding Rust both would interfere with getting work done.
--
⚗︎ | /blu.mɛin.dʰak/ | shortens to "Hawk" | he/him/his/himself/Mr.
bluemanedhawk.github.io
Bitches stole my whole ass ␔🭖᷿᪳𝼗᷍⏧𒒫𐻾ࣛ↉�⃣ quoted-printable, can't
have shit in Thunderbird 😩

Re: you think rust may outthrone c?

<86jzutvj6a.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26415&group=comp.lang.c#26415

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 00:05:17 -0700
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <86jzutvj6a.fsf@linuxsc.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com> <u8qqpv$3v3pg$1@dont-email.me> <u8r94r$dn9$1@dont-email.me> <u8rcu9$qd2$1@dont-email.me> <u8rdrf$uca$1@dont-email.me> <20230714140153.112@kylheku.com> <u8sf33$4nc3$1@dont-email.me> <u8u3ge$cscl$1@dont-email.me> <87sf9oye05.fsf@nosuchdomain.example.com> <a189a8ff-5e91-43b7-9601-1f29b6a667bfn@googlegroups.com> <u90c0s$nr2u$1@dont-email.me> <0ff5dfe1-de32-4dae-872e-5401a3c04c97n@googlegroups.com> <u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk> <u923gr$tf08$1@dont-email.me> <87mszvwbwl.fsf@bsb.me.uk> <ea263e0e-b936-43d2-a4b2-9fe62ccccce9n@googlegroups.com> <u93dlc$158qe$1@dont-email.me> <f08cb1de-e0a2-4346-96b8-d154c39141e7n@googlegroups.com> <u93k2s$196i8$1@dont-email.me> <87bkgawlwp.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="2d78163bfb891e7187c96a580a5a5784";
logging-data="3320267"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EJSxfl1m3whaT4ZxlSoNIjMSOWH4+Qj0="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:EePtd3vz+PoUiyInwmKvmFcNBGQ=
sha1:6l2/EZ6Qcr3zinBwpVwUq6bXpYY=
 by: Tim Rentsch - Fri, 21 Jul 2023 07:05 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

[considering the rules for accessing an object of one type
when using an lvalue of a different type].

> There should be a name for this relationship between types, like
> "effectively compatible", but there isn't one in the language
> standard, and I don't think there is on that is widely used.
> Maybe we could use "effectively compatible"...

I don't like "effectively compatible" for two reasons. One,
the word "effectively" is commonly used with a different
meaning, and that would confuse the issue. Two, the word
"compatible" suggests a symmetric relationship, but the
effective type rules are not symmetric, so "compatible"
would be misleading, or at least confusing.

> Similarly, you will see people talk about two types being
> "assignment compatible" in order to refer to the related (but
> different) rules covering assignment and argument passing. The
> standard itself even refers to these rules in a number of
> places, but without a name for them, it must reference "the
> constraints of 6.5.16.1" instead!

Here again "compatible" is a poor fit because the type rules
for assignment are not symmetric. I might suggest, without
thinking about it too deeply, "assignment permissible" as
an adjective for describing the types on the right-hand
side of an assignment. This phrase could be extended with
a "for (left-hand-side type)" where needed, as for example
"the type of the expression '*p' is not assignment permissible
for an int* target".

Re: you think rust may outthrone c?

<u9dcb1$35gmv$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26417&group=comp.lang.c#26417

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 09:32:51 +0200
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <u9dcb1$35gmv$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org>
<u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org>
<u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org>
<u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org>
<u9bg5f$2o9ci$1@dont-email.me> <u9bs1u$2qj43$1@dont-email.me>
<u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 21 Jul 2023 07:32:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="eab0bdde3d4fe538e58ee7a8d92b7e3b";
logging-data="3326687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OIxk5DVXJdycK3N7xtaN1W4kcZJBRayc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:CxTLsTbPX6Ezu8GM0DCWlNa3b0w=
Content-Language: de-DE
In-Reply-To: <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
 by: Bonita Montero - Fri, 21 Jul 2023 07:32 UTC

Am 21.07.2023 um 08:06 schrieb Blue-Maned_Hawk:

> ​What evidence have you that they would save work?  On the contrary,
> i'd say that the insane complexity of C++ and the hostile culture
> surrounding Rust both would interfere with getting work done.

If you're know C++ halfway you're multiple times faster than
with C, where you have to deal with every details yourself.
There is no more rudimentary language than C in that sense.
I'm developing C++ since 1992 and maybe I've missed some useful
features, but it's easy to learn additional features by the way.

Re: you think rust may outthrone c?

<u9dd5h$35hjk$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26418&group=comp.lang.c#26418

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 09:46:57 +0200
Organization: A noiseless patient Spider
Lines: 127
Message-ID: <u9dd5h$35hjk$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u90c0s$nr2u$1@dont-email.me>
<0ff5dfe1-de32-4dae-872e-5401a3c04c97n@googlegroups.com>
<u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 21 Jul 2023 07:46:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3327604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+X9RaFWzQlJzakRB/yTbQUsSBcfCF+Wt4="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:LyMe8BZwIeVgwkgEZy6ibN8FmEk=
Content-Language: en-GB
In-Reply-To: <u9cfmj$2trto$1@dont-email.me>
 by: David Brown - Fri, 21 Jul 2023 07:46 UTC

On 21/07/2023 01:24, Bart wrote:
> On 19/07/2023 23:12, Keith Thompson wrote:
> > David Brown <david.brown@hesbynett.no> writes:
>
> >> However, when people talk about two's complement signed integers, they
> >> are sometimes talking about signed arithmetic overflows.  This is a
> >> very different matter from the representation of the types.  And while
> >> almost all current processors will use two's complement wrapping in
> >> their signed arithmetic instructions, C (including C23) does /not/
> >> guarantee any behaviour for overflows, and C compilers do not, as a
> >> rule, guarantee any behaviour for overflows.  Many optimising
> >> compilers will optimise code on the assumption that signed integer
> >> arithmetic does not overflow.  This is not new - I first saw it nearly
> >> 30 years ago.  It is not just gcc or clang - MSVC also does such
> >> optimisations.  The only compilers I know about for which you can rely
> >> on wrapping behaviour are gcc and clang with the "-fwrapv" flag
> >> enabled.
> >
> > Agreed.  Here's an example:
> >
> > #include <stdio.h>
> > #include <limits.h>
> > int main(void) {
> >      int n = INT_MAX;
> >      if (n + 1 > n) {
> >          printf("%d > %d\n", n + 1, n);
> >      }
> >      else {
> >          printf("%d <= %d\n", n + 1, n);
> >      }
> > }
> >
> > With gcc (without -fwrapv), this program prints (at all optimization
> > levels):
> >
> > -2147483648 > 2147483647
>
> This is a fake result.

That's a silly thing to say. Keith did the test, and gave the result.

> gcc even at -O0 does not actually attempt to do
> the comparison, it just calls that first printf anyway. Code for the
> other printf does not appear in the compiler output (this is version 10.x).

The compiler knows that for any int, "n + 1" is bigger than "n". It
generates code accordingly.

The unsigned integer types in C form modulo groups, and comparisons are
not as simple, but the signed integer types model a subset of
mathematical integers as best as can be done in a limited range. Many
mathematical identities hold true for C ints, which they would not do if
they used modulo arithmetic.

>
> That is the case even when `n` is external. It assumes that n+1 must be
> greater than n, always.

Yes. It makes perfect sense.

Of course, a compiler is /also/ free to actually read "n", calculate "n
+ 1" according to the specifications of the language, and do the
comparison. It will get the same result for any "n" for which "n + 1"
is defined. And it can pick any value it wants for "INT_MAX + 1",
including impossible values that are not valid "int" values. So it
could pick "something bigger than INT_MAX" and get the same result as
before. Or it could pick "INT_MIN" and get a different result for the
comparison. Or it could pick 42, "bananas", or an invisible pink
unicorn, or a compile-time error. (But "something bigger than INT_MAX"
and INT_MIN are the two likely candidates.)

>
> If I compare two externs a and b (set elsewhere to INT_MAX+1 and
> INT_MAX), then I get <= like my compilers.
>

Compilers only make use of information they have to optimise code if it
actually optimises the code. They don't go out of their way to detect
instances of UB (unless you choose such modes, for checking your code or
fault-finding).

> This means that gcc can give inconsistent results when apparently
> comparing the same two pairs of values.
>

Yes. Is the concept of UB new to you?

> TBH I found it hard to predict the results of x64's cmp followed by jle.
> But what's not hard however is predicting the result of INT_MAX+1. My
> tools which don't try to be clever, will give more consistent results.
>
> gcc assumes ints don't wrap, but sometimes they do.

gcc assumes your integer arithmetic does not overflow - and that if it
does, you don't care about the resulting behaviour of the code. That's
what UB means.

Why is this stuff so hard for you to understand? Look at 3.4.3 in the C
standards, defining the term "undefined behaviour". Read it, and see if
there is anything there that does not match up with what you have seen
above. If there is anything you are still not clear about, ask.

3.4.3

1 undefined behavior

behavior, upon use of a nonportable or erroneous program construct or of
erroneous data, for which this International Standard imposes no
requirements

2 NOTE Possible undefined behavior ranges from ignoring the situation
completely with unpredictable results, to behaving during translation or
program execution in a documented manner characteristic of the
environment (with or without the issuance of a diagnostic message), to
terminating a translation or execution (with the issuance of a
diagnostic message).

3 EXAMPLE
An example of undefined behavior is the behavior on integer overflow.

Re: you think rust may outthrone c?

<u9ddoj$35hjk$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26419&group=comp.lang.c#26419

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 09:57:07 +0200
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <u9ddoj$35hjk$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <87h6pyqgnp.fsf@nosuchdomain.example.com>
<6317c8eb-a3bd-41ad-b9fb-e07a51505febn@googlegroups.com>
<87cz0mqe90.fsf@nosuchdomain.example.com>
<648a342f-a940-4f99-bc9a-e2c9ce175fccn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 07:57:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3327604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19G3M4jEhLH5y/ynajg1n3Up6u+eacAY/M="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:pXeWx8+PP+2zwOmuKVH34h2zvo4=
In-Reply-To: <648a342f-a940-4f99-bc9a-e2c9ce175fccn@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Fri, 21 Jul 2023 07:57 UTC

On 21/07/2023 07:46, Malcolm McLean wrote:
> On Friday, 21 July 2023 at 01:50:51 UTC+1, Keith Thompson wrote:

I don't know enough about the details of floating point operations -
either in IEEE or in C - to comment about it.

(For my own use of floating point in my code, it's all good, solid
finite numbers in reasonable ranges, and I use "-ffast-math" for
efficiency, especially on small devices. That makes it easy!)

>> For any two valid integer values x and y, exactly one of x<y, x==y, x>y
>> is true. That's not the case for floating-point values, which means
>> that a compiler cannot assume (x + 1 > x) without information about the
>> value of x (given an implementation that supports NaNs).
>>
> Yes, exactly. it shouldn't assume that x + 1 > x for integer arithmetic either because
>
> if (x + 1 > x)
> {
> y = x + 1;
> if ( y > x) /* must be true ? */
> }
>
> and gcc's behaviour is undesireable.
>

If x is less than INT_MAX, then this sets y to x + 1 and the comparison
is always true. Agreed?

If x is equal to INT_MAX, then "if (x + 1 > x)" is undefined behaviour
and the compiler can do anything it likes - including assuming that the
comparison is true. The assignment "y = x + 1;" is also undefined
behaviour, and the compiler can put anything it likes in y - including
trapping values, leaving it uninitialised, keeping a "mental" note that
it is bigger than x, or firing off an email to the programmer's boss
saying that the programmer needs a refresher course on basic C.

The simplest, most efficient code consistent with all that is for the
compiler to assume the comparison is true. And that is the /desirable/
behaviour, because people who write correct code deserve to get
efficient results, not bigger and slower code just because some other
programmer has made a mistake.

Re: you think rust may outthrone c?

<u9dev0$35t7e$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26420&group=comp.lang.c#26420

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 10:17:35 +0200
Organization: A noiseless patient Spider
Lines: 73
Message-ID: <u9dev0$35t7e$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<u98g5n$2469a$1@dont-email.me> <u98rs9$26ae9$1@dont-email.me>
<87mszrsx6z.fsf@bsb.me.uk> <u99alq$292ke$1@dont-email.me>
<87wmyvr9kg.fsf@bsb.me.uk> <u9atg7$2kv4f$1@dont-email.me>
<87h6pyowz6.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 08:17:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3339502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QwlE16uKG8kcl3H5uwM1b5LRQ70cH2jw="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:uzrpw9OWEoBcL2aARnLptH1XoLg=
Content-Language: en-GB
In-Reply-To: <87h6pyowz6.fsf@bsb.me.uk>
 by: David Brown - Fri, 21 Jul 2023 08:17 UTC

On 21/07/2023 03:49, Ben Bacarisse wrote:
> David Brown <david.brown@hesbynett.no> writes:
>
>> On 19/07/2023 21:21, Ben Bacarisse wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
>>>
<snip>
>>
>> For automatic storage variables, using the value while it is indeterminate
>> is explicitly UB - from J.2 (a list of undefined behaviours):
>
> Non-normative, as I am sure you know. And, as I said elsewhere, if it
> accurately reflects the intent, then it explicitly excludes the case in
> point with allocated storage.
>
>> """
>> The value of an object with automatic storage duration is used while it is
>> indeterminate (6.2.4, 6.7.9, 6.8).
>> """
>>
<snip>
>>
>> Using indeterminate values in uninitialised local variables is UB,
>> regardless of whether or not there could be non-value representations
>> supported by the hardware.
>
> So everyone says, but no one has produced the normative text that says
> so. I was trying to get there. I think there's some justification for
> saying the something that is potentially UB could be called UB. It's
> not a strong argument, but is there anything better? What's your
> reasoning?
>

I have to agree with you here. I really cannot see a convincing
argument for why using indeterminate values in local variables is UB.
As you say, J.2 is not normative - but I had assumed that it contained
valid summaries of the normative text. (i.e., The paragraph in J.2
implied there was nominative text marking such accesses as UB, and I
just could not find them.) However, when no one here can see any
nominative text to that effect, maybe it simply doesn't exist - the J.2
paragraph could be an error, or a left-over from earlier drafts.

I think we can agree that if an indeterminate value is a trap value,
using it is undefined behaviour (6.2.6.1p5). And pretty much any
implementation will have trap values for _Bool, but perhaps not for any
other types. So as long as we stick to types with no trap values, I
can't see any normative justification for use being UB.

I see Keith has punted this one uphill to comp.standards.c, so we will
see if anything interesting comes out of that.

>>> Thus it's tempting to consider *q as being "almost always well-defined"
>>> but since my view is that the semantics of a construct should include
>>> all the possibilities, the only meaning we can put on "int p;
>>> printf("%d\n", p);" is "none".
>>
>> "No meaning" is, of course, just another way of saying "UB". But it's
>> important, I think, to note that it is UB even on systems where non-value
>> representations are not possible for ints. (i.e., almost every real-world
>> system.)
>
> We should only note it if it's true! Is it?
>

I think the answer to that is now indeterminate :-) (More seriously, I
hope Keith's c.s.c post gives a definite answer.)

Do you happen to know the corresponding situation for C++? The
standards there tend to be more complicated, but they might give insights.

Re: you think rust may outthrone c?

<u9df0i$35t7e$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26421&group=comp.lang.c#26421

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 10:18:26 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <u9df0i$35t7e$2@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<u98g5n$2469a$1@dont-email.me> <u98rs9$26ae9$1@dont-email.me>
<u992jq$27kpu$1@dont-email.me> <u99bua$29a16$1@dont-email.me>
<87ilafr8e0.fsf@bsb.me.uk> <u99i9b$2ac5l$1@dont-email.me>
<u9avim$2l5mt$3@dont-email.me>
<2c1804d7-256e-4e3a-aa8e-d2cf4cea82can@googlegroups.com>
<u9bas2$2n8dl$1@dont-email.me> <u9berv$2o345$1@dont-email.me>
<u9bmvs$2pmgm$1@dont-email.me> <87pm4mqjmb.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 21 Jul 2023 08:18:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3339502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191QaKrW4YhfbxWMUMlKVhqokzN9UjIfsU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:zUYTqtjt0PfdflWXl3pQKlM+wnA=
Content-Language: en-GB
In-Reply-To: <87pm4mqjmb.fsf@nosuchdomain.example.com>
 by: David Brown - Fri, 21 Jul 2023 08:18 UTC

On 21/07/2023 00:54, Keith Thompson wrote:
> David Brown <david.brown@hesbynett.no> writes:
> [...]
>> Like Yoda must you think if Forth to understand you are. Or something
>> like that!
> [...]
>
> An old bumper sticker: "4TH ♥ IF HONK THEN"
>

:-)

Re: you think rust may outthrone c?

<u9df40$35t7e$3@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26422&group=comp.lang.c#26422

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 10:20:16 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <u9df40$35t7e$3@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u90c0s$nr2u$1@dont-email.me>
<0ff5dfe1-de32-4dae-872e-5401a3c04c97n@googlegroups.com>
<u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<u98g5n$2469a$1@dont-email.me> <u98rs9$26ae9$1@dont-email.me>
<u992jq$27kpu$1@dont-email.me> <u99bua$29a16$1@dont-email.me>
<87ilafr8e0.fsf@bsb.me.uk> <u99i9b$2ac5l$1@dont-email.me>
<u9avim$2l5mt$3@dont-email.me>
<2c1804d7-256e-4e3a-aa8e-d2cf4cea82can@googlegroups.com>
<u9c40h$2rpbs$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 08:20:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3339502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9vEutjEllnR3TrJ66FQNwsX4Itv6FnwQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:sE/OXE5nOAbR1WuP0FAVVYA2q/Q=
In-Reply-To: <u9c40h$2rpbs$5@dont-email.me>
Content-Language: en-GB
 by: David Brown - Fri, 21 Jul 2023 08:20 UTC

On 20/07/2023 22:04, Chris M. Thomasson wrote:
> On 7/20/2023 5:39 AM, minf...@arcor.de wrote:

>> Its "queer" syntax is just a matter of getting used to it.
>
> What is "queer" syntax?
>

Syntax significantly different from that of other languages you are used
to. So of course it is an entirely subjective term. But given that
this is comp.lang.c, "queer syntax" would mean something radically
different to that of C, and unfamiliar to people whose only programming
language is C.

Re: you think rust may outthrone c?

<u9dfcj$35t7e$4@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26423&group=comp.lang.c#26423

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 10:24:51 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u9dfcj$35t7e$4@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u90c0s$nr2u$1@dont-email.me>
<0ff5dfe1-de32-4dae-872e-5401a3c04c97n@googlegroups.com>
<u90u5r$pnad$1@dont-email.me> <87sf9niqb6.fsf@bsb.me.uk>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<u98g5n$2469a$1@dont-email.me> <u98rs9$26ae9$1@dont-email.me>
<u992jq$27kpu$1@dont-email.me> <u99bua$29a16$1@dont-email.me>
<87ilafr8e0.fsf@bsb.me.uk> <u9aval$2l5mt$2@dont-email.me>
<u9c3ur$2rpbs$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 21 Jul 2023 08:24:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3339502"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19i2OWvb1YxEYoY3lVV9Rd8ffqWpCWmnJk="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:MoYzwgV/hVhiL7sb5AOAW1HgKt4=
Content-Language: en-GB
In-Reply-To: <u9c3ur$2rpbs$4@dont-email.me>
 by: David Brown - Fri, 21 Jul 2023 08:24 UTC

On 20/07/2023 22:03, Chris M. Thomasson wrote:
> On 7/20/2023 2:38 AM, David Brown wrote:
>> On 19/07/2023 21:47, Ben Bacarisse wrote:
>>> David Brown <david.brown@hesbynett.no> writes:
> [...]
>> In 1982 I was 10 years old.  I was familiar with BASIC on at least two
>> different machines, but I didn't look at other languages for another
>> couple of years.  BCPL passed me by, as did Fortran and Algol.
> [...]
>
> Fwiw, In 1982 I was 5 years old and working with BASIC, LOGO and PILOT
> on my trusty Atari.
>

I didn't see a computer until I was about 6 or 7 - a Commodore PET (with
dual tape drives!).

Re: you think rust may outthrone c?

<87o7k5prew.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26425&group=comp.lang.c#26425

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 02:03:51 -0700
Organization: None to speak of
Lines: 49
Message-ID: <87o7k5prew.fsf@nosuchdomain.example.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me>
<874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<u98g5n$2469a$1@dont-email.me> <u98rs9$26ae9$1@dont-email.me>
<87mszrsx6z.fsf@bsb.me.uk> <u99alq$292ke$1@dont-email.me>
<87wmyvr9kg.fsf@bsb.me.uk> <87fs5jseuv.fsf@nosuchdomain.example.com>
<20230719160546.668@kylheku.com>
<87bkg7s5zt.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="2370f913b850030e0527dd0f7396627d";
logging-data="3350787"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Tu2ZLRRr49NUfZCdyekWF"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:XpdgVYBizRuoRoe+yDoFBijXsfc=
sha1:ewL/LCwBq20rjbDaQAp7XM3/XhA=
 by: Keith Thompson - Fri, 21 Jul 2023 09:03 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
[...]
> The problem is that (referring to N1570, and I don't see any relevant
> changes in the latest public C23 draft, N3096), Annex J says gives
>
> The value of an object with automatic storage duration is used
> while it is indeterminate (6.2.4, 6.7.9, 6.8).
>
> as an example of undefined behavior.
>
> If that is accurate, then this program:
>
> #include <limits.h>
> int main(void) {
> int foo;
> if (sizeof (int) == 4 &&
> CHAR_BIT == 8 &&
> INT_MAX == 2147483647 &&
> INT_MIN == -INT_MAX-1)
> {
> int bar = foo;
> }
> }
>
> has undefined behavior on an implementation where the condition is true.
> (Of course that UB is likely to manifest as quietly doing nothing.)
>
> Annex J is non-normative, and depends on normative statements
> elsewhere in the standard. Following the section numbers given in
> Annex J and searching for occurrences of "indeterminate value",
> I have so far been unable to confirm that the statement in Annex
> J is correct.
>
> Either Annex J is incorrect, or accessing an uninitalized
> automatic object is UB even if the object cannot possibly hold a
> trap representation. (I'd be satisfied either way; I'd like the
> standard to be internally consistent.)
>
> Perhaps someone else can find something in the standard that I've
> missed.

I've posted about this to comp.std.c (subject "Does reading an
uninitialized object have undefined behavior?") and emailed the C23
editors. (It's likely too late to make any significant changes to C23.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: you think rust may outthrone c?

<87jzutpqfy.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26426&group=comp.lang.c#26426

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 02:24:49 -0700
Organization: None to speak of
Lines: 24
Message-ID: <87jzutpqfy.fsf@nosuchdomain.example.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me>
<874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me>
<87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me>
<87h6pyqgnp.fsf@nosuchdomain.example.com>
<6317c8eb-a3bd-41ad-b9fb-e07a51505febn@googlegroups.com>
<87cz0mqe90.fsf@nosuchdomain.example.com>
<648a342f-a940-4f99-bc9a-e2c9ce175fccn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="2370f913b850030e0527dd0f7396627d";
logging-data="3357650"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wyphLjVZl8HVzPcWxBhpk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Uz6cf4x0nPLztdYjJ7sd1RimVHw=
sha1:BYZfep5DScxQyupNvZAd+7yREzQ=
 by: Keith Thompson - Fri, 21 Jul 2023 09:24 UTC

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
> On Friday, 21 July 2023 at 01:50:51 UTC+1, Keith Thompson wrote:
[...]
>> For any two valid integer values x and y, exactly one of x<y, x==y, x>y
>> is true. That's not the case for floating-point values, which means
>> that a compiler cannot assume (x + 1 > x) without information about the
>> value of x (given an implementation that supports NaNs).
>>
> Yes, exactly. it shouldn't assume that x + 1 > x for integer arithmetic either because
>
> if (x + 1 > x)
> {
> y = x + 1;
> if ( y > x) /* must be true ? */
> }
>
> and gcc's behaviour is undesireable.

gcc's behavior is consistent with the standard.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: you think rust may outthrone c?

<87fs5hpq82.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26427&group=comp.lang.c#26427

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 02:29:33 -0700
Organization: None to speak of
Lines: 14
Message-ID: <87fs5hpq82.fsf@nosuchdomain.example.com>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<87sf9niqb6.fsf@bsb.me.uk> <u923gr$tf08$1@dont-email.me>
<u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me>
<874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me>
<87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <u9dd5h$35hjk$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="2370f913b850030e0527dd0f7396627d";
logging-data="3357650"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OOx6LaL5mbi9K5/NRSiae"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:ZgCh9dk4fGz3ASNiQY7MsRNPgl4=
sha1:WLYR2VA4xxDDAhsDSDG1A94iloU=
 by: Keith Thompson - Fri, 21 Jul 2023 09:29 UTC

David Brown <david.brown@hesbynett.no> writes:
[...]
> The compiler knows that for any int, "n + 1" is bigger than "n". It
> generates code accordingly.
[...]

Quibble: for any int value *for which n + 1 is defined*, n + 1 is
greater than n. (And for any int value for which n + 1 is not defined,
which is only INT_MAX, UB means the compiler can do what it likes.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: you think rust may outthrone c?

<u9dm6t$370v3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26428&group=comp.lang.c#26428

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 11:21:18 +0100
Organization: A noiseless patient Spider
Lines: 91
Message-ID: <u9dm6t$370v3$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <87h6pyqgnp.fsf@nosuchdomain.example.com>
<u9cld3$2uof8$1@dont-email.me> <878rbaqch6.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 10:21:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0b33e2ae51c4dd97523406dbb7e485ce";
logging-data="3376099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/R8vx9hzKrS4OrDX1OmSkeW06lA+xXPN8="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:zRpXNPFHZEBz9GFHMfg+9IwP25Q=
In-Reply-To: <878rbaqch6.fsf@nosuchdomain.example.com>
 by: Bart - Fri, 21 Jul 2023 10:21 UTC

On 21/07/2023 02:28, Keith Thompson wrote:
> Bart <bc@freeuk.com> writes:
>> On 21/07/2023 00:58, Keith Thompson wrote:
>>> No, it's not. It's exactly the output the program produced when I
>>> compiled and ran it.
>>> Please explain what you mean by "fake result". Are you insinuating
>>> that
>>> I lied about it?
>>
>> No. gcc on my machine hard-codes that output without bothering to
>> execute the comparison to see what the hardware does with it.
>
> Are you saying that that's what you meant by "fake result"? Are you
> saying there's something "fake" about not emitting an ADD instruction in
> response to a C "+" operation? Is evaluating 2+2 at compile time
> "fake"?

Transforming 2+2 is more acceptable since the result is always going to
be consistent. It is not controversial.

>> Because it makes an assumption about the result of comparing n+1 with
>> n. If those same two values were compared via variables where it did
>> not not know their values and their relationship, it would be forced
>> to do an actual comparison.
>
> Yes. Are you under the impression I didn't know that? Do you think the
> assumption is invalid, given that the code's behavior is undefined?
>
>> On my machine, that produced a different result even still comparing
>> values of INT_MAX+1 with INT_MAX.
>
> And what exactly is your point?

What was yours?

You posted a piece of code and challenged people to try it themselves on
their own platforms.

However, the platform doesn't matter: gcc will always produce that
result no matter what. It does not attempt to put the actual hardware to
the test.

There was me looking at the output of my compilers trying to figure why
it was different, and gcc is not even bothering generating the instructions.

It's a like taking a program that calculates and prints fib(36), and
then discovering that the winning compiler or interpreter is only
emitting puts("14930352") and not doing the actual work.

Suppose someone is tasked with surveying dozens of machines to find out
exactly what `if (n+1>n)` produces. Well, if they're using gcc, they
might as well not bother, as they're not going to find out what /the
machine/ produces, only what gcc has decided it should produce.

Presumably your point was to demonstrate something about the
unpredictability of UB, but your chosen compiler had already made up its
mind in advance that it was going to do X no matter what!

This is what you said:

>(This applies only to the quick experiment I just did, and could vary
with the phase of the moon.)

I doubt anything would make gcc do anything different!

But if you still can't see my objection, then forget it.

> Or are you just trying to make this look worse and more complicated than
> it really is?

I consider inconsistency in comparing the same two values to be poor.
That is, comparing INT_MIN with INT_MAX. Because if you do this:

int b = INT_MAX;
int a = b+1; // yields INT_MIN even with gcc

if (a>b) {

that will get a different results compared with 'if (b+1, b)`. Is that
supposed to be good?

Comparing values at the limits of a type's bounds is always going to be
dodgy anyway, but at least you might expect the results to be always the
same.

Note that if you do this test using unsigned and UINT_MAX, gcc also
hardcodes the result, even this in this case it knows that b+1 could
wrap around to zero. The result showed will be wrong, but so is mine. At
least it is consistent with the signed version!

Re: you think rust may outthrone c?

<c339d764-b249-4950-bea7-69849f8096a3n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26429&group=comp.lang.c#26429

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ad4:4f2b:0:b0:635:de09:2058 with SMTP id fc11-20020ad44f2b000000b00635de092058mr5005qvb.3.1689936248014;
Fri, 21 Jul 2023 03:44:08 -0700 (PDT)
X-Received: by 2002:a05:6870:f80a:b0:1ba:82c3:a56d with SMTP id
fr10-20020a056870f80a00b001ba82c3a56dmr5034981oab.1.1689936247821; Fri, 21
Jul 2023 03:44:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 21 Jul 2023 03:44:07 -0700 (PDT)
In-Reply-To: <u9dm6t$370v3$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23a8:400a:5601:2d3c:9ceb:ad56:e836;
posting-account=Dz2zqgkAAADlK5MFu78bw3ab-BRFV4Qn
NNTP-Posting-Host: 2a00:23a8:400a:5601:2d3c:9ceb:ad56:e836
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com> <b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk> <u94pch$1dpd6$1@dont-email.me>
<87edl6uf9y.fsf@bsb.me.uk> <u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com> <87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com> <u98odb$25mj8$1@dont-email.me>
<87jzuvsg7q.fsf@nosuchdomain.example.com> <u9cfmj$2trto$1@dont-email.me>
<87h6pyqgnp.fsf@nosuchdomain.example.com> <u9cld3$2uof8$1@dont-email.me>
<878rbaqch6.fsf@nosuchdomain.example.com> <u9dm6t$370v3$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c339d764-b249-4950-bea7-69849f8096a3n@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: malcolm....@gmail.com (Malcolm McLean)
Injection-Date: Fri, 21 Jul 2023 10:44:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2596
 by: Malcolm McLean - Fri, 21 Jul 2023 10:44 UTC

On Friday, 21 July 2023 at 11:21:32 UTC+1, Bart wrote:
>
> Note that if you do this test using unsigned and UINT_MAX, gcc also
> hardcodes the result, even this in this case it knows that b+1 could
> wrap around to zero. The result showed will be wrong, but so is mine. At
> least it is consistent with the signed version!
>
Did you write
unsigned int x = UINT_MAX;
if(x + 1 > x)

or

if(x + 1u > x)

?

C has some weird rules about expressions going to an int which date back to
the days of implict int.
I don't have a Linux machine handy so I can't test gcc.

Re: you think rust may outthrone c?

<u9dpfm$37geb$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26430&group=comp.lang.c#26430

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (Bart)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 12:17:11 +0100
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <u9dpfm$37geb$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <87h6pyqgnp.fsf@nosuchdomain.example.com>
<u9cld3$2uof8$1@dont-email.me> <878rbaqch6.fsf@nosuchdomain.example.com>
<u9dm6t$370v3$1@dont-email.me>
<c339d764-b249-4950-bea7-69849f8096a3n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 11:17:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0b33e2ae51c4dd97523406dbb7e485ce";
logging-data="3391947"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nyVxPmyeG0J/cNgtR1z3NxNOOdYR2/Ng="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:JiLBnExJWReJFqRDujPaSdnGvxU=
In-Reply-To: <c339d764-b249-4950-bea7-69849f8096a3n@googlegroups.com>
 by: Bart - Fri, 21 Jul 2023 11:17 UTC

On 21/07/2023 11:44, Malcolm McLean wrote:
> On Friday, 21 July 2023 at 11:21:32 UTC+1, Bart wrote:
>>
>> Note that if you do this test using unsigned and UINT_MAX, gcc also
>> hardcodes the result, even this in this case it knows that b+1 could
>> wrap around to zero. The result showed will be wrong, but so is mine. At
>> least it is consistent with the signed version!
>>
> Did you write
> unsigned int x = UINT_MAX;
> if(x + 1 > x)
>
> or
>
> if(x + 1u > x)
>
> ?

I wrote x+1, but using 1u didn't make any difference.

Since I think I forgot to write `unsigned`, only `UINT_MAX` and "%u"!

Using `unsigned`, then gcc does do the actual comparison. And this way
the results of comparing the same two values, UINT_MIN and UINT_MAX, are
consistent no matter how it is done.

(Doing u32 + i32 I think would yield a u32 result, in which case the 1u
is not necessary.)

Re: you think rust may outthrone c?

<u9dqf1$37nt1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26431&group=comp.lang.c#26431

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 13:33:53 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <u9dqf1$37nt1$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <87h6pyqgnp.fsf@nosuchdomain.example.com>
<6317c8eb-a3bd-41ad-b9fb-e07a51505febn@googlegroups.com>
<87cz0mqe90.fsf@nosuchdomain.example.com>
<648a342f-a940-4f99-bc9a-e2c9ce175fccn@googlegroups.com>
<87jzutpqfy.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 11:33:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3399585"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GJy4l95iuL/r4+SZ9lVh2MbkQXVTFYHg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:KIIxxpLMVVzR0V3cqe4zg9SzZ4g=
In-Reply-To: <87jzutpqfy.fsf@nosuchdomain.example.com>
Content-Language: en-GB
 by: David Brown - Fri, 21 Jul 2023 11:33 UTC

On 21/07/2023 11:24, Keith Thompson wrote:
> Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>> On Friday, 21 July 2023 at 01:50:51 UTC+1, Keith Thompson wrote:
> [...]
>>> For any two valid integer values x and y, exactly one of x<y, x==y, x>y
>>> is true. That's not the case for floating-point values, which means
>>> that a compiler cannot assume (x + 1 > x) without information about the
>>> value of x (given an implementation that supports NaNs).
>>>
>> Yes, exactly. it shouldn't assume that x + 1 > x for integer arithmetic either because
>>
>> if (x + 1 > x)
>> {
>> y = x + 1;
>> if ( y > x) /* must be true ? */
>> }
>>
>> and gcc's behaviour is undesireable.
>
> gcc's behavior is consistent with the standard.
>

And it is desirable, at least to some people - such as myself, and
presumably also the gcc developers.

Re: you think rust may outthrone c?

<u9dv2c$38ir2$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26432&group=comp.lang.c#26432

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 14:52:27 +0200
Organization: A noiseless patient Spider
Lines: 214
Message-ID: <u9dv2c$38ir2$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <87h6pyqgnp.fsf@nosuchdomain.example.com>
<u9cld3$2uof8$1@dont-email.me> <878rbaqch6.fsf@nosuchdomain.example.com>
<u9dm6t$370v3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 21 Jul 2023 12:52:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3427170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qAv/i/Ax+iX4RwuXTKtxNrCuFaY+/b6A="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:OYWN8ccfzb6+nG8QiKjx3I2m5pI=
Content-Language: en-GB
In-Reply-To: <u9dm6t$370v3$1@dont-email.me>
 by: David Brown - Fri, 21 Jul 2023 12:52 UTC

On 21/07/2023 12:21, Bart wrote:
> On 21/07/2023 02:28, Keith Thompson wrote:
> > Bart <bc@freeuk.com> writes:
> >> On 21/07/2023 00:58, Keith Thompson wrote:
> >>> No, it's not.  It's exactly the output the program produced when I
> >>> compiled and ran it.
> >>> Please explain what you mean by "fake result".  Are you insinuating
> >>> that
> >>> I lied about it?
> >>
> >> No. gcc on my machine hard-codes that output without bothering to
> >> execute the comparison to see what the hardware does with it.
> >
> > Are you saying that that's what you meant by "fake result"?  Are you
> > saying there's something "fake" about not emitting an ADD instruction in
> > response to a C "+" operation?  Is evaluating 2+2 at compile time
> > "fake"?
>
> Transforming 2+2 is more acceptable since the result is always going to
> be consistent. It is not controversial.

If it is merely "more" acceptable, then it is still controversial.
There will be people who don't understand how the C language works who
feel it should be translated into assembly instructions to add 2 and 2.
You understand a bit more than such people, and thus think 2 + 2 can be
pre-calculated at compile time, but you apparently still don't
understand that the same applies to the comparison in Keith's program.

>
>
> >> Because it makes an assumption about the result of comparing n+1 with
> >> n. If those same two values were compared via variables where it did
> >> not not know their values and their relationship, it would be forced
> >> to do an actual comparison.
> >
> > Yes.  Are you under the impression I didn't know that?  Do you think the
> > assumption is invalid, given that the code's behavior is undefined?
> >
> >> On my machine, that produced a different result even still comparing
> >> values of INT_MAX+1 with INT_MAX.
> >
> > And what exactly is your point?
>
> What was yours?

His point - if I may be so bold as to interpret Keith's post - was that
real-world compilers regularly make use of assumptions about UB in order
to generate more efficient code. An example does not prove that this is
how the C language is defined, but it /does/ prove that mainstream
toolmakers believe that. (And the people behind the gcc compiler know
more about the definition of the language than you or I do.)

>
> You posted a piece of code and challenged people to try it themselves on
> their own platforms.

No, he did not. He posted a piece of code and ran it on his own system.

>
> However, the platform doesn't matter: gcc will always produce that
> result no matter what. It does not attempt to put the actual hardware to
> the test.
>

Why would you think it would do that? There's nothing
hardware-dependent in Keith's program.

When I am investigating how a compiler treats particular code pieces, I
usually don't bother running it at all on any hardware - it's a lot more
efficient and insightful (to me) to use godbolt and look at the
generated assembly. The hardware is irrelevant, beyond
implementation-dependent details like the size of the types and the
value of INT_MAX.

> There was me looking at the output of my compilers trying to figure why
> it was different, and gcc is not even bothering generating the
> instructions.
>

If you had looked up instead, you'd have seen Keith's point flying over
your head.

> It's a like taking a program that calculates and prints fib(36), and
> then discovering that the winning compiler or interpreter is only
> emitting puts("14930352") and not doing the actual work.
>

And that would be perfectly reasonable. We already know you have no
idea how to benchmark tools.

> Suppose someone is tasked with surveying dozens of machines to find out
> exactly what `if (n+1>n)` produces. Well, if they're using gcc, they
> might as well not bother, as they're not going to find out what /the
> machine/ produces, only what gcc has decided it should produce.

They would manage fine with gcc - /if/ they understand the language and
how to test compilers. You, apparently, do not, and are flummoxed by
the task.

>
> Presumably your point was to demonstrate something about the
> unpredictability of UB, but your chosen compiler had already made up its
> mind in advance that it was going to do X no matter what!
>
> This is what you said:
>
> >(This applies only to the quick experiment I just did, and could vary
> with the phase of the moon.)
>
> I doubt anything would make gcc do anything different!

Different code could give different results. Different versions of gcc
could give different results. Different flags could give different
results. It's undefined behaviour - only a fool would expect some
particular consistent choice of output. /That/ is the point. It would
be nice if you tried harder to understand.

>
> But if you still can't see my objection, then forget it.
>
>
> > Or are you just trying to make this look worse and more complicated than
> > it really is?
>
> I consider inconsistency in comparing the same two values to be poor.

As always - you are allowed to have an opinion on whether you like or
dislike the way C specifies this kind of thing. You are not allowed an
opinion on /how/ it specifies it - only on whether or not you like it or
approve of it. Understand the facts first - then form an opinion.

Oh, and note that it is not the comparison that is UB - comparison of
two int expressions is fully defined in C. It is the overflow on the
addition (INTMAX + 1) that is UB.

> That is, comparing INT_MIN with INT_MAX. Because if you do this:
>
>     int b = INT_MAX;
>     int a = b+1;       // yields INT_MIN even with gcc

It /might/ yield INT_MIN. It might not. It might crash the program
when it runs (try compiling with -fsantize=undefined). It might
complain at compile time. (gcc will do that if you mark "b" as "const".
I think it is weak that it does not do so for non-const "b", but
compilers can't warn about all bad code.) It is undefined behaviour -
maybe it will do what /you/ want it to do, but maybe not.

And it can certainly get in a self-contradictory state - it is /fine/
for the compiler to store one thing in "a" (if it bothers doing that at
all) while also tracking known facts about "a" for use in later
optimisations - such as a comparison. The compiler tracks range and
value facts all the time, allowing all kinds of optimisations. If you
give it code that gives the compiler contradictory information, you can
expect the possibility of contradictory results. Lying to your compiler
is not a good idea - it always ends in tears.

>
>     if (a>b) {
>
> that will get a different results compared with 'if (b+1, b)`. Is that
> supposed to be good?

It's garbage in, garbage out. Charles Babbage had this figured out - it
really should not come as a surprise to you.

Despite having written several compilers of your own, I really don't
think you understand how they work. A compiler is not a dumb translator
that works line by line. It analyses the code and forms internal graphs
tracking information and decisions. It re-arranges things to minimise
dependencies, re-use calculations, pre-calculate what it can, eliminate
redundant code, merge loads, stores and calculations, etc. The
statement "if (a > b) {" can therefore be transformed to "if (b + 1 >
b)" and then "if (true)", regardless of any writes to "a" which may or
may not take place, and which may be moved forwards or backwards in the
code.

And yes, this is /good/. It lets people write their code in whatever
makes the most sense when writing it - they can write clear and
maintainable source code, without getting bogged down in
micro-optimisations and concerns about the details of the code
generation. Human programmers can do what they do best, and let the
compiler do what it does best.

It is only a problem if there is a programmer who disregards the rules
of the language (and you certainly can't claim you don't know these
particular rules - if you break them, it is by intention). Compilers
can provide tools to help programmers spot accidental mistakes (and they
can always get better at this), but they can't force you to write proper
code.

>
> Comparing values at the limits of a type's bounds is always going to be
> dodgy anyway, but at least you might expect the results to be always the
> same.


Click here to read the complete article
Re: you think rust may outthrone c?

<u9dvqj$38mb3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26434&group=comp.lang.c#26434

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.lang.c
Subject: Re: you think rust may outthrone c?
Date: Fri, 21 Jul 2023 15:05:22 +0200
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <u9dvqj$38mb3$1@dont-email.me>
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u923gr$tf08$1@dont-email.me> <u92mms$12tmp$1@dont-email.me>
<5fbef78e-14f8-43c4-afaf-17fa5bad12bdn@googlegroups.com>
<b54f60b1-6db7-4ecc-a1f6-b03c78c291een@googlegroups.com>
<u94eb1$1c2vr$1@dont-email.me> <874jm2tbkt.fsf@nosuchdomain.example.com>
<u94hip$1cdbp$1@dont-email.me> <87lefeukpy.fsf@bsb.me.uk>
<u94pch$1dpd6$1@dont-email.me> <87edl6uf9y.fsf@bsb.me.uk>
<u95rn3$1k9hq$1@dont-email.me> <87r0p4tyx4.fsf@bsb.me.uk>
<c52e1506-b0a5-4e5b-99c0-5e79c5305a3an@googlegroups.com>
<87o7k8rzh5.fsf@nosuchdomain.example.com>
<0fa83b40-26e6-427a-ba84-6cf8ac33172an@googlegroups.com>
<u98odb$25mj8$1@dont-email.me> <87jzuvsg7q.fsf@nosuchdomain.example.com>
<u9cfmj$2trto$1@dont-email.me> <87h6pyqgnp.fsf@nosuchdomain.example.com>
<u9cld3$2uof8$1@dont-email.me> <878rbaqch6.fsf@nosuchdomain.example.com>
<u9dm6t$370v3$1@dont-email.me>
<c339d764-b249-4950-bea7-69849f8096a3n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 21 Jul 2023 13:05:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b2fb03a98f308a462982357442f9ec83";
logging-data="3430755"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189V6DsE3tJjt9A+H1XwF8GpJCOup2UfCo="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.9.0
Cancel-Lock: sha1:KbTPzZf0pt8djLkESBVMkGq8SiE=
Content-Language: en-GB
In-Reply-To: <c339d764-b249-4950-bea7-69849f8096a3n@googlegroups.com>
 by: David Brown - Fri, 21 Jul 2023 13:05 UTC

On 21/07/2023 12:44, Malcolm McLean wrote:
> On Friday, 21 July 2023 at 11:21:32 UTC+1, Bart wrote:
>>
>> Note that if you do this test using unsigned and UINT_MAX, gcc also
>> hardcodes the result, even this in this case it knows that b+1 could
>> wrap around to zero. The result showed will be wrong, but so is mine. At
>> least it is consistent with the signed version!
>>
> Did you write
> unsigned int x = UINT_MAX;
> if(x + 1 > x)
>
> or
>
> if(x + 1u > x)
>
> ?
>
> C has some weird rules about expressions going to an int which date back to
> the days of implict int.
> I don't have a Linux machine handy so I can't test gcc.

The rules are very clear here. They are laid out in 6.3.1.1 of the C
standards. You can read them here, if you don't like reading the
standards: <https://en.cppreference.com/w/c/language/conversion>

If you add an unsigned int to an int, the int is first converted to an
unsigned int (by modulo wrapping if it is negative), then the operation
is carried out as an unsigned int addition, resulting in an unsigned int.

Thus "UINT_MAX + 1" and "UINT_MAX + 1u" are both handled as unsigned int
addition, with guaranteed wrapping semantics, and operate identically.
(UINT_MAX is guaranteed to be of "unsigned int" type.)

Re: you think rust may outthrone c?

<94f31ccb-c536-4262-881a-207edc53139dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=26435&group=comp.lang.c#26435

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:ac8:4909:0:b0:403:9734:9485 with SMTP id e9-20020ac84909000000b0040397349485mr45297qtq.1.1689944800058;
Fri, 21 Jul 2023 06:06:40 -0700 (PDT)
X-Received: by 2002:a05:6870:b7a6:b0:1b0:5a58:5949 with SMTP id
ed38-20020a056870b7a600b001b05a585949mr2862394oab.8.1689944799846; Fri, 21
Jul 2023 06:06:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Fri, 21 Jul 2023 06:06:39 -0700 (PDT)
In-Reply-To: <u9dcb1$35gmv$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.108; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.108
References: <ebb9e01a-6369-4629-8b38-11d28df63693n@googlegroups.com>
<u8o2jf$3isv1$1@bluemanedhawk.eternal-september.org> <u93q47$19p2n$1@dont-email.me>
<u95q1j$1k1sq$1@bluemanedhawk.eternal-september.org> <u991ot$27egh$2@dont-email.me>
<u99qru$2brfo$1@bluemanedhawk.eternal-september.org> <u9atgg$2ku7m$2@dont-email.me>
<u9bafs$2n7dq$1@bluemanedhawk.eternal-september.org> <u9bg5f$2o9ci$1@dont-email.me>
<u9bs1u$2qj43$1@dont-email.me> <u9d79c$34qp8$1@bluemanedhawk.eternal-september.org>
<u9dcb1$35gmv$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <94f31ccb-c536-4262-881a-207edc53139dn@googlegroups.com>
Subject: Re: you think rust may outthrone c?
From: profesor...@gmail.com (fir)
Injection-Date: Fri, 21 Jul 2023 13:06:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2996
 by: fir - Fri, 21 Jul 2023 13:06 UTC

piątek, 21 lipca 2023 o 09:33:04 UTC+2 Bonita Montero napisał(a):
> Am 21.07.2023 um 08:06 schrieb Blue-Maned_Hawk:
>
> > ​What evidence have you that they would save work? On the contrary,
> > i'd say that the insane complexity of C++ and the hostile culture
> > surrounding Rust both would interfere with getting work done.
> If you're know C++ halfway you're multiple times faster than
> with C, where you have to deal with every details yourself.

that is what you belive... but i think you dont know c in c you dont need
to deal with every detail ..yopu only have to deal with detail onde, write your own
small specialised library and tehn not deal with detail anymore and
you have your own small library which suits you better than some other
libraries wjose have some weird things and you need to learn them
often much longer than writing yours
(eventually you dont need to write yours you may take some from others..
in thsi case you may also hit better than learning c++ std libraries which are kinda shame
imo (long timno didnt seen them though) yet you simply get better language
than pony++)

> There is no more rudimentary language than C in that sense.
> I'm developing C++ since 1992 and maybe I've missed some useful
> features, but it's easy to learn additional features by the way.


devel / comp.lang.c / Re: you think rust may outthrone c?

Pages:123456789101112131415161718192021222324252627282930313233343536373839
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor