• We have a new standard!

    From Stefan Ram@21:1/5 to All on Fri Dec 27 14:47:51 2024
    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to Stefan Ram on Fri Dec 27 21:51:10 2024
    Stefan Ram writes:

    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)

    Hip-hip-hooray! Finally, finally they addressed the long-standing criticism
    of C++ being too trivial and too simple, and a kids' language. At last,
    there's some meat on those bones. Watch out, Java! There's a new boss in
    town. Real programming languages' specifications are measured in pounds,
    and not a page count.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Benutzer Eins@21:1/5 to Stefan Ram on Sat Dec 28 03:17:37 2024
    On 27/12/2024 14:47, Stefan Ram wrote:
    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)




    This is the latest draft I could find:

    <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/n5001.pdf>

    Happy New Year
    Frohes Neues Jahr

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sat Dec 28 10:19:19 2024
    On Fri, 27 Dec 2024 21:51:10 -0500
    Sam <[email protected]> gabbled:
    Stefan Ram writes:

    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)

    Hip-hip-hooray! Finally, finally they addressed the long-standing criticism >of C++ being too trivial and too simple, and a kids' language. At last, >there's some meat on those bones. Watch out, Java! There's a new boss in >town. Real programming languages' specifications are measured in pounds,
    and not a page count.

    Watch out Java? Watch out Perl more like! The title of most write only
    language could soon change!

    Being serious, I haven't even checked whats new in it but going by C++ 2020 it'll be yet more syntactic soup to support features absolutely no one outside of ivory tower academic discussions asked for. It'll just add yet more complexity to compilers, hence more potential bugs and make the C++ learning curve even steeper meaning yet more new programmers abandon it - or don't
    even start - for languages such as Python.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Sat Dec 28 16:20:57 2024
    On 28/12/2024 11:19, [email protected] wrote:
    On Fri, 27 Dec 2024 21:51:10 -0500
    Sam <[email protected]> gabbled:
    Stefan Ram writes:

      According to one web site, C++23 (ISO/IEC 14882:2024) was released
      October 19, 2024.

      (Sorry if it was mentioned here then, and I just did not notice!)

    Hip-hip-hooray! Finally, finally they addressed the long-standing
    criticism of C++ being too trivial and too simple, and a kids'
    language. At last, there's some meat on those bones. Watch out, Java!
    There's a new boss in town. Real programming languages' specifications
    are measured in pounds, and not a page count.

    Watch out Java? Watch out Perl more like! The title of most write only language could soon change!

    Being serious, I haven't even checked whats new in it but going by C++ 2020 it'll be yet more syntactic soup to support features absolutely no one outside
    of ivory tower academic discussions asked for. It'll just add yet morecomplexity to compilers, hence more potential bugs and make the C++ learning
    curve even steeper meaning yet more new programmers abandon it - or don't even start - for languages such as Python.


    Ah, yes - the classic well-reasoned argument. Why would one ever want
    to /look/ at the new standard before condemning it?

    It's inevitable that most people won't have need of most of the new
    features - C++ is a big language, and has a big standard library, and
    few people use more than a fraction of it. But all the new features
    will be of some use to some people. (It's a lot like Python in that
    aspect.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ahlstrom@21:1/5 to Benutzer Eins on Sat Dec 28 11:19:47 2024
    Benutzer Eins wrote this post while blinking in Morse code:

    On 27/12/2024 14:47, Stefan Ram wrote:
    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)

    This is the latest draft I could find:

    <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/n5001.pdf>

    It's only 2400 pages :-(

    --
    No sooner had Edger Allen Poe
    Finished his old Raven,
    then he started his Old Crow.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Phillip@21:1/5 to [email protected] on Sat Dec 28 13:05:37 2024
    On 12/28/24 05:19, [email protected] wrote:
    On Fri, 27 Dec 2024 21:51:10 -0500
    Sam <[email protected]> gabbled:
    Stefan Ram writes:

      According to one web site, C++23 (ISO/IEC 14882:2024) was released
      October 19, 2024.

      (Sorry if it was mentioned here then, and I just did not notice!)

    Hip-hip-hooray! Finally, finally they addressed the long-standing
    criticism of C++ being too trivial and too simple, and a kids'
    language. At last, there's some meat on those bones. Watch out, Java!
    There's a new boss in town. Real programming languages' specifications
    are measured in pounds, and not a page count.

    Watch out Java? Watch out Perl more like! The title of most write only language could soon change!

    Being serious, I haven't even checked whats new in it but going by C++ 2020 it'll be yet more syntactic soup to support features absolutely no one outside
    of ivory tower academic discussions asked for. It'll just add yet morecomplexity to compilers, hence more potential bugs and make the C++ learning
    curve even steeper meaning yet more new programmers abandon it - or don't even start - for languages such as Python.


    I'm still on C++98 and C++03. Everything beyond that is just bloat to
    me. ;-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 09:43:38 2024
    On Sat, 28 Dec 2024 13:05:37 -0500
    Phillip <[email protected]> gabbled:
    On 12/28/24 05:19, [email protected] wrote:
    On Fri, 27 Dec 2024 21:51:10 -0500
    Sam <[email protected]> gabbled:
    Stefan Ram writes:

      According to one web site, C++23 (ISO/IEC 14882:2024) was released
      October 19, 2024.

      (Sorry if it was mentioned here then, and I just did not notice!)

    Hip-hip-hooray! Finally, finally they addressed the long-standing
    criticism of C++ being too trivial and too simple, and a kids'
    language. At last, there's some meat on those bones. Watch out, Java!
    There's a new boss in town. Real programming languages' specifications
    are measured in pounds, and not a page count.

    Watch out Java? Watch out Perl more like! The title of most write only
    language could soon change!

    Being serious, I haven't even checked whats new in it but going by C++ 2020 >> it'll be yet more syntactic soup to support features absolutely no one
    outside
    of ivory tower academic discussions asked for. It'll just add yet
    morecomplexity to compilers, hence more potential bugs and make the C++
    learning
    curve even steeper meaning yet more new programmers abandon it - or don't
    even start - for languages such as Python.


    I'm still on C++98 and C++03. Everything beyond that is just bloat to
    me. ;-)

    I would say that C++ 11 did improve things particularly wrt the STL and possibly 2014 was the high point. Beyond that its been as you say pointless bloat that achieves nothing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 09:32:30 2024
    On Sat, 28 Dec 2024 16:20:57 +0100
    David Brown <[email protected]> gabbled:
    On 28/12/2024 11:19, [email protected] wrote:
    Being serious, I haven't even checked whats new in it but going by C++ 2020 >> it'll be yet more syntactic soup to support features absolutely no one
    outside
    of ivory tower academic discussions asked for. It'll just add yet
    morecomplexity to compilers, hence more potential bugs and make the C++
    learning
    curve even steeper meaning yet more new programmers abandon it - or don't
    even start - for languages such as Python.


    Ah, yes - the classic well-reasoned argument. Why would one ever want
    to /look/ at the new standard before condemning it?

    Ah yes, the same logic that has produced cars with ever more, harder to use complexity that no one wants.

    It's inevitable that most people won't have need of most of the new

    For most read 99.9%.

    features - C++ is a big language, and has a big standard library, and
    few people use more than a fraction of it. But all the new features
    will be of some use to some people. (It's a lot like Python in that
    aspect.)

    For some read 0.01%. Is it worth it? No.

    Also you seem to have little understanding of human nature. Make the learning curve close to vertical for a language and no one will bother with it. I've worked with 20 something devs in the last few years. Not ONE of them bothered to learn C++, its all Python, Java (usually learnt at uni - even uni's don't bother with C++ now) or Web dev. Ask yourself why. At this rate when people such as myself retire in the 2030s C++ will become legacy like Cobol and no amount of bolting on ever more niche features will save it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Sun Dec 29 14:51:17 2024
    On 29/12/2024 10:32, [email protected] wrote:
    On Sat, 28 Dec 2024 16:20:57 +0100
    David Brown <[email protected]> gabbled:
    On 28/12/2024 11:19, [email protected] wrote:
    Being serious, I haven't even checked whats new in it but going by
    C++ 2020
    it'll be yet more syntactic soup to support features absolutely no
    one outside
    of ivory tower academic discussions asked for. It'll just add yet
    morecomplexity to compilers, hence more potential bugs and make the
    C++ learning
    curve even steeper meaning yet more new programmers abandon it - or
    don't
    even start - for languages such as Python.


    Ah, yes - the classic well-reasoned argument.  Why would one ever want
    to /look/ at the new standard before condemning it?

    Ah yes, the same logic that has produced cars with ever more, harder to use complexity that no one wants.

    No, not remotely. But then, you knew that before making what you
    mistakenly thought was a smart or witty reply.

    If you don't like the complexity of newer C++ standards, that's fine.
    If you don't think it is a good direction for the language, fair enough.
    You can choose a different language, or stick to an older standard, or
    make your own language, or get involved in the C++ standardisation
    processes and try to influence them.

    You can have an informed opinion about C++, and agree or disagree with
    the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you want
    to be viewed seriously - is spout an /uninformed/ opinion. That's no
    more than mindless prejudice, and of no interest to anyone.

    So go away, and read about C++23. Learn what is new or changed. /Then/
    you can come back and tell us what you don't like about it - or perhaps
    you'll find some things that you /do/ like about it. Either way, you'll
    be at least vaguely qualified to express an opinion on it.

    <https://en.wikipedia.org/wiki/C%2B%2B23>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to [email protected] on Sun Dec 29 08:50:16 2024
    [email protected] writes:

    On Sat, 28 Dec 2024 13:05:37 -0500
    Phillip <[email protected]> gabbled:
    I'm still on C++98 and C++03. Everything beyond that is just bloat to me. ;-)

    I would say that C++ 11 did improve things particularly wrt the STL and possibly 2014 was the high point. Beyond that its been as you say pointless bloat that achieves nothing.

    I would say that C++17 was also an incremental improvement.

    But C++20 jumped the shark, when the standardization process was hijacked by Microsoft in order to cram coroutines into the language, which noone wanted, cared, or asked for, simply because the standard threading model in Windows blows chunks, performance wise, and Microsoft desperately needed a multithreading model that did not suck.

    And things went downhill from that point on…

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Chris Ahlstrom on Sun Dec 29 15:01:33 2024
    On 28/12/2024 17:19, Chris Ahlstrom wrote:
    Benutzer Eins wrote this post while blinking in Morse code:

    On 27/12/2024 14:47, Stefan Ram wrote:
    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)

    This is the latest draft I could find:

    <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/n5001.pdf>

    It's only 2400 pages :-(


    That is the latest draft of C++26, which is not close to finalised.

    The final freely available pre-publication draft of C++23 is <https://wg21.link/n4950>. (As always, the official ISO publications
    are expensive, but the final pre-publication versions are sufficient for
    almost everyone.)

    Of course, at 2134 pages it is not much lighter than C++26. That's 10
    pages of preamble (title, contents, etc.), 477 pages on the language,
    1404 pages on the standard library, then 243 pages of appendices and
    indexes.


    In practice, I think <https://en.cppreference.com/w/cpp> is a more
    useful resource for most people than the standard document itself.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 16:15:25 2024
    On Sun, 29 Dec 2024 08:50:16 -0500
    Sam <[email protected]> gabbled:
    [email protected] writes:

    On Sat, 28 Dec 2024 13:05:37 -0500
    Phillip <[email protected]> gabbled:
    I'm still on C++98 and C++03. Everything beyond that is just bloat to me. >;-)

    I would say that C++ 11 did improve things particularly wrt the STL and
    possibly 2014 was the high point. Beyond that its been as you say pointless >> bloat that achieves nothing.

    I would say that C++17 was also an incremental improvement.

    I'll give you shared_mutex that came with 17, but really that should have
    been in from 2011 when threading was added. Not having 3 level thread locking from the get go was ridiculous. But the rest of 17 ... meh.

    But C++20 jumped the shark, when the standardization process was hijacked by >Microsoft in order to cram coroutines into the language, which noone wanted, >cared, or asked for, simply because the standard threading model in Windows >blows chunks, performance wise, and Microsoft desperately needed a >multithreading model that did not suck.

    I looked at co-routines and wondered wtf the author(s) was smoking. How its supposed to be simpler than simply using a local state machine beats the fsck out of me.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to [email protected] on Sun Dec 29 11:57:45 2024
    [email protected] writes:

    On Sun, 29 Dec 2024 08:50:16 -0500
    Sam <[email protected]> gabbled:
    But C++20 jumped the shark, when the standardization process was hijacked by >> Microsoft in order to cram coroutines into the language, which noone wanted, >> cared, or asked for, simply because the standard threading model in Windows >> blows chunks, performance wise, and Microsoft desperately needed a
    multithreading model that did not suck.

    I looked at co-routines and wondered wtf the author(s) was smoking. How its supposed to be simpler than simply using a local state machine beats the fsckout of me.

    Everything will make sense to you when you look at the co-routines
    proposal, and note its authorship:

    https://isocpp.org/files/papers/N4402.pdf

    Visual C++ does not have an impressive track record of zippy adoptions of
    new C++ language feature. Most of the time it gets beaten to the punch by
    gcc. Weirdly, it was the first out of the gate with co-routines.

    As I said: std::thread blows chunks on Windows. This was Microsoft's
    solution.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 17:11:27 2024
    On Mon, 30 Dec 2024 01:08:29 +0800
    wij <[email protected]> gabbled:
    On Sun, 2024-12-29 at 16:17 +0000, [email protected] wrote:
    On Sun, 29 Dec 2024 22:33:05 +0800
    wij <[email protected]> gabbled:
    with that. The wrong thing is regarding it as better new technology, es= >peci=3D
    ally
    when libwy is more advanced (idea) than c++standard library by one gene= >rati=3D
    on.
    =20
    Nobody gives a rats arse about your library. Haven't you figured that out=
    yet?
    =20

    No problem for me. I just see you people suffering there, maybe enjoying.

    Having seen some examples of your code I think the suffering would be for anyone stupid enough to try and use your library.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 17:08:39 2024
    On Sun, 29 Dec 2024 11:57:45 -0500
    Sam <[email protected]> gabbled:
    [email protected] writes:
    I looked at co-routines and wondered wtf the author(s) was smoking. How its >> supposed to be simpler than simply using a local state machine beats the
    fsckout of me.

    Everything will make sense to you when you look at the co-routines
    proposal, and note its authorship:

    https://isocpp.org/files/papers/N4402.pdf

    Don't know either of the authors but I knew it was MS.

    Visual C++ does not have an impressive track record of zippy adoptions of
    new C++ language feature. Most of the time it gets beaten to the punch by >gcc. Weirdly, it was the first out of the gate with co-routines.

    As I said: std::thread blows chunks on Windows. This was Microsoft's >solution.

    For solution read hack. At best its co-operative multitasking reinstated in
    a hideously overcomplicated way requiring nonsense special classes for [reasons] when a simple "yield" command would have sufficed.

    A proper solution would be to fix whatever fuckups they've made in their implementation of std::thread unless the problem lies in the windows kernel itself which frankly wouldn't surprise me.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 16:16:35 2024
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> gabbled:
    But what you don't get to do - or at least, don't get to do if you want
    to be viewed seriously - is spout an /uninformed/ opinion. That's no
    more than mindless prejudice, and of no interest to anyone.

    Ah ok , its the usual "anyone who disagrees with me POV is ignorant" position is it?

    Back under your bridge troll.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sun Dec 29 16:17:28 2024
    On Sun, 29 Dec 2024 22:33:05 +0800
    wij <[email protected]> gabbled:
    with that. The wrong thing is regarding it as better new technology, especi= >ally
    when libwy is more advanced (idea) than c++standard library by one generati= >on.

    Nobody gives a rats arse about your library. Haven't you figured that out yet?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Sam on Sun Dec 29 19:50:25 2024
    On Sun, 29 Dec 2024 11:57:45 -0500
    Sam <[email protected]> wrote:

    [email protected] writes:

    On Sun, 29 Dec 2024 08:50:16 -0500
    Sam <[email protected]> gabbled:
    But C++20 jumped the shark, when the standardization process was
    hijacked by Microsoft in order to cram coroutines into the
    language, which noone wanted, cared, or asked for, simply because
    the standard threading model in Windows blows chunks, performance
    wise, and Microsoft desperately needed a multithreading model that
    did not suck.

    I looked at co-routines and wondered wtf the author(s) was smoking.
    How its supposed to be simpler than simply using a local state
    machine beats the fsckout of me.

    Everything will make sense to you when you look at the co-routines
    proposal, and note its authorship:

    https://isocpp.org/files/papers/N4402.pdf

    Visual C++ does not have an impressive track record of zippy
    adoptions of new C++ language feature. Most of the time it gets
    beaten to the punch by gcc. Weirdly, it was the first out of the gate
    with co-routines.

    As I said: std::thread blows chunks on Windows. This was Microsoft's solution.


    That makes no sense.
    If Microsoft was so concerned about lack of competitiveness of
    std::thread under Windows then it would campaign for addition to the
    standard of non-joinable threads (a.k.a. thread pools, a.k.a. work
    items) rather than of coroutines. May be, also for addition of IO
    completion ports, although those are much harder to standardize in OS-independent manner.
    The third possibility would be addition of stackful co-routines (a.k.a.
    fibers, a.k.a. cooperatively scheduled threads).
    Stackless coroutines of C++ serve non-trivially different purposes than
    all things mentioned above and unlikely to replace threads except in
    *very* unusual circumstances.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to David Brown on Mon Dec 30 00:12:31 2024
    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree with
    the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you want
    to be viewed seriously - is spout an /uninformed/ opinion.  That's no
    more than mindless prejudice, and of no interest to anyone.

    Thanks David, for standing against the trolls. It's a pity that personal freedoms are often interpreted as "my ignorant opinion has exactly the
    same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might hurt
    other people, or the nature for that matter. Boasting ignorant jumble
    can easily do that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Paavo Helde on Mon Dec 30 00:44:50 2024
    On Mon, 30 Dec 2024 00:12:31 +0200
    Paavo Helde <[email protected]> wrote:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.


    It seems that [email protected] still didn't figure out why
    stating strong opinion about something that you not just didn't learn
    in depth, but didn't even look at casually is less than optimal.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Mon Dec 30 08:34:32 2024
    On 29/12/2024 17:16, [email protected] wrote:
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> gabbled:
    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to anyone.

    Ah ok , its the usual "anyone who disagrees with me POV is ignorant"
    position
    is it?


    It's not a matter of agreement or disagreement. You know - by your own admission - /nothing/ about C++23. Your ignorance is not a matter of
    opinion but a matter of fact.

    I'm not disagreeing about your /opinions/ of C++23 - I am simply stating
    that any opinions you have, until you have learned at least a little
    about the new standard, are totally worthless.

    Maybe once you have gone away and learned a little, we can talk about
    the new features of C++23, and agree or disagree about particulars or
    general aspects of it. Until then, you might like to note that I
    haven't as yet offered any opinions about C++23 at all - so how could
    you possibly think I disagree with you?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Mon Dec 30 09:34:51 2024
    On Mon, 30 Dec 2024 08:34:32 +0100
    David Brown <[email protected]> gabbled:
    On 29/12/2024 17:16, [email protected] wrote:
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> gabbled:
    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to anyone.

    Ah ok , its the usual "anyone who disagrees with me POV is ignorant"
    position
    is it?


    It's not a matter of agreement or disagreement. You know - by your own >admission - /nothing/ about C++23. Your ignorance is not a matter of
    opinion but a matter of fact.

    I'm going by 2017 and 2020 adding little of value to the language. I very
    much doubt they've suddenly found some paradigm changing additions.

    I'm not disagreeing about your /opinions/ of C++23 - I am simply stating
    that any opinions you have, until you have learned at least a little
    about the new standard, are totally worthless.

    So you think I've never browsed anything to do with 23? Thats a hell of an assumption.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Paavo Helde on Mon Dec 30 03:14:57 2024
    Paavo Helde <[email protected]> writes:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.

    I agree with much of what you say. I don't agree with the last
    sentence. Depending on other factors, a public broadcast of a
    personal statement can produce enough of a negative effect so that
    it should be prohibited, but simply boasting ignorant jumble does
    not, by itself, fall into that category. The nature of posting to
    a newsgroup like this one does nothing to change that.

    Personal opinion: the comments from David Brown do more harm than
    good here. At some level he is just a guilty of giving a preachy
    opinion as the person he is responding to. It seems likely that
    his statements will exacerbate the offending behavior rather than
    diminish it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to David Brown on Mon Dec 30 13:25:44 2024
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> wrote:

    On 29/12/2024 10:32, [email protected] wrote:
    On Sat, 28 Dec 2024 16:20:57 +0100
    David Brown <[email protected]> gabbled:
    On 28/12/2024 11:19, [email protected] wrote:
    Being serious, I haven't even checked whats new in it but going
    by C++ 2020
    it'll be yet more syntactic soup to support features absolutely
    no one outside
    of ivory tower academic discussions asked for. It'll just add yet
    morecomplexity to compilers, hence more potential bugs and make
    the C++ learning
    curve even steeper meaning yet more new programmers abandon it -
    or don't
    even start - for languages such as Python.


    Ah, yes - the classic well-reasoned argument.� Why would one ever
    want to /look/ at the new standard before condemning it?

    Ah yes, the same logic that has produced cars with ever more,
    harder to use complexity that no one wants.

    No, not remotely. But then, you knew that before making what you
    mistakenly thought was a smart or witty reply.

    If you don't like the complexity of newer C++ standards, that's fine.
    If you don't think it is a good direction for the language, fair
    enough. You can choose a different language, or stick to an older
    standard, or make your own language, or get involved in the C++ standardisation processes and try to influence them.

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to anyone.

    So go away, and read about C++23. Learn what is new or changed.
    /Then/ you can come back and tell us what you don't like about it -
    or perhaps you'll find some things that you /do/ like about it.
    Either way, you'll be at least vaguely qualified to express an
    opinion on it.

    <https://en.wikipedia.org/wiki/C%2B%2B23>


    Comments after cursory view:

    C++20 introduces two promising language features - concepts and
    coroutines. Both were introduces without proper support in standard
    library. Absence of support in library in both cases was justified by
    probably correct claim that the best library constructs are still in
    research state, non-crystallized. The hope was that universal
    availability of this features at compiler level will help to best
    library constructs to mature.

    In case of coroutines developers were left with choice of 3 options:
    1. To write a lot of boiler-plate code each time they a going to use coroutines.
    2. To try to organize repetitive patterns in the library (likely
    template library) of their own and reuse it between parts of the
    programs and multiple projects. Hopefully, share with community.
    Hopefully, under liberal license.
    3. Don't use coroutines

    In case of concepts, the choice was even narrower:
    1. Use concepts when you occasionally are writing container-like or algorithm-like template of your own.
    2. Don't use concepts.

    Nobody was realistically expecting that grassroots developers will use
    concepts to develop comprehensive widely reusable library that
    duplicates functionality of STL, but brings advantage of sane error
    messages.


    So, where we are 3 years later?
    W.r.t. concepts, in the same unfortunate place.
    W.r.t. coroutines, library provides std::generator. I didn't look at it
    yet. Hopefully, it works. Hopefully it is easy to use. But it is just
    one of many possible uses of coroutines, and I would think that
    it is not the one that could be considered most common.


    Did I miss something?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Mon Dec 30 03:17:17 2024
    Michael S <[email protected]> writes:

    On Mon, 30 Dec 2024 00:12:31 +0200
    Paavo Helde <[email protected]> wrote:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.

    It seems that [email protected] still didn't figure out why
    stating strong opinion about something that you not just didn't learn
    in depth, but didn't even look at casually is less than optimal.

    For some time now I have simply stopped reading his comments.
    I don't know why anyone bothers with him for more than a handful
    of interactions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Mon Dec 30 12:00:59 2024
    On Mon, 30 Dec 2024 03:17:17 -0800
    Tim Rentsch <[email protected]> wibbled:
    Michael S <[email protected]> writes:

    On Mon, 30 Dec 2024 00:12:31 +0200
    Paavo Helde <[email protected]> wrote:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.

    It seems that [email protected] still didn't figure out why
    stating strong opinion about something that you not just didn't learn
    in depth, but didn't even look at casually is less than optimal.

    For some time now I have simply stopped reading his comments.
    I don't know why anyone bothers with him for more than a handful
    of interactions.

    The same could be said about you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Tim Rentsch on Mon Dec 30 16:05:34 2024
    On 30/12/2024 12:14, Tim Rentsch wrote:

    Personal opinion: the comments from David Brown do more harm than
    good here. At some level he is just a guilty of giving a preachy
    opinion as the person he is responding to. It seems likely that
    his statements will exacerbate the offending behavior rather than
    diminish it.

    Opinion noted.

    I disagree that I was giving a "preachy /opinion/", but I can accept
    that my posts were somewhat "preachy" in style. What influence it may
    have on Muttley (or anyone else giving unjustified opinions on a
    standard they have not looked at) remains to be seen - I don't think
    anyone is in a position to predict accurately.

    (I don't always agree with such feedback, but I do always try to give it
    fair consideration.)

    Perhaps we can have a more topical discussion about the actual changes
    and new features in C++23?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Mon Dec 30 15:37:45 2024
    On 30/12/2024 10:34, [email protected] wrote:
    On Mon, 30 Dec 2024 08:34:32 +0100
    David Brown <[email protected]> gabbled:
    On 29/12/2024 17:16, [email protected] wrote:
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> gabbled:
    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to anyone.

    Ah ok , its the usual "anyone who disagrees with me POV is ignorant"
    position
    is it?


    It's not a matter of agreement or disagreement.  You know - by your
    own admission - /nothing/ about C++23.  Your ignorance is not a matter
    of opinion but a matter of fact.

    I'm going by 2017 and 2020 adding little of value to the language. I very much doubt they've suddenly found some paradigm changing additions.

    I'm not disagreeing about your /opinions/ of C++23 - I am simply
    stating that any opinions you have, until you have learned at least a
    little about the new standard, are totally worthless.

    So you think I've never browsed anything to do with 23? Thats a hell of an assumption.


    You wrote: "Being serious, I haven't even checked whats new in it..."
    followed by assumptions about C++23. The only assumption /I/ made was
    that you were telling the truth - was that unreasonable?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Mon Dec 30 15:08:13 2024
    On Mon, 30 Dec 2024 15:37:45 +0100
    David Brown <[email protected]> wibbled:
    On 30/12/2024 10:34, [email protected] wrote:
    On Mon, 30 Dec 2024 08:34:32 +0100
    David Brown <[email protected]> gabbled:
    On 29/12/2024 17:16, [email protected] wrote:
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> gabbled:
    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to anyone. >>>>
    Ah ok , its the usual "anyone who disagrees with me POV is ignorant"
    position
    is it?


    It's not a matter of agreement or disagreement.  You know - by your
    own admission - /nothing/ about C++23.  Your ignorance is not a matter
    of opinion but a matter of fact.

    I'm going by 2017 and 2020 adding little of value to the language. I very
    much doubt they've suddenly found some paradigm changing additions.

    I'm not disagreeing about your /opinions/ of C++23 - I am simply
    stating that any opinions you have, until you have learned at least a
    little about the new standard, are totally worthless.

    So you think I've never browsed anything to do with 23? Thats a hell of an >> assumption.


    You wrote: "Being serious, I haven't even checked whats new in it..." >followed by assumptions about C++23. The only assumption /I/ made was
    that you were telling the truth - was that unreasonable?

    I'd skimmed the wiki entry, nothing in depth. It was enough. But hey, they've renamed puts() to println() so win! Not.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Mon Dec 30 15:52:02 2024
    On 30/12/2024 13:00, [email protected] wrote:
    On Mon, 30 Dec 2024 03:17:17 -0800
    Tim Rentsch <[email protected]> wibbled:
    Michael S <[email protected]> writes:

    On Mon, 30 Dec 2024 00:12:31 +0200
    Paavo Helde <[email protected]> wrote:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.

    It seems that [email protected] still didn't figure out why
    stating strong opinion about something that you not just didn't learn
    in depth, but didn't even look at casually is less than optimal.

    For some time now I have simply stopped reading his comments.
    I don't know why anyone bothers with him for more than a handful
    of interactions.

    The same could be said about you.


    There are plenty of people here who have stopped reading posts by
    particular other people - or at least, specifically stopped reply to
    them. I think the group would be poorer if everyone refused to respond
    to someone they judge to be trolling, rude, or otherwise unpleasant in
    some way. Sometimes the replies might be of interest or use to others
    (I don't expect Muttley to stop giving uninformed opinions, but it is conceivable that some other posters will at least look at what's new in
    C++23 before telling us all how terrible it is). And of course
    sometimes even the worst trolls make good points or raise interesting questions.

    Tim never replies to my posts directly - though he occasionally
    indirectly shows signs of reading them. I believe I have at least some understanding of his reasons for ignoring me. (I am not a model poster
    by any means.) But I'd prefer it if he did as many others here try to
    do - reply to posts, not to posters.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Michael S on Mon Dec 30 17:15:43 2024
    On 30/12/2024 12:25, Michael S wrote:
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> wrote:

    On 29/12/2024 10:32, [email protected] wrote:
    On Sat, 28 Dec 2024 16:20:57 +0100
    David Brown <[email protected]> gabbled:
    On 28/12/2024 11:19, [email protected] wrote:
    Being serious, I haven't even checked whats new in it but going
    by C++ 2020
    it'll be yet more syntactic soup to support features absolutely
    no one outside
    of ivory tower academic discussions asked for. It'll just add yet
    morecomplexity to compilers, hence more potential bugs and make
    the C++ learning
    curve even steeper meaning yet more new programmers abandon it -
    or don't
    even start - for languages such as Python.


    Ah, yes - the classic well-reasoned argument.  Why would one ever
    want to /look/ at the new standard before condemning it?

    Ah yes, the same logic that has produced cars with ever more,
    harder to use complexity that no one wants.

    No, not remotely. But then, you knew that before making what you
    mistakenly thought was a smart or witty reply.

    If you don't like the complexity of newer C++ standards, that's fine.
    If you don't think it is a good direction for the language, fair
    enough. You can choose a different language, or stick to an older
    standard, or make your own language, or get involved in the C++
    standardisation processes and try to influence them.

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to anyone.

    So go away, and read about C++23. Learn what is new or changed.
    /Then/ you can come back and tell us what you don't like about it -
    or perhaps you'll find some things that you /do/ like about it.
    Either way, you'll be at least vaguely qualified to express an
    opinion on it.

    <https://en.wikipedia.org/wiki/C%2B%2B23>


    Comments after cursory view:

    C++20 introduces two promising language features - concepts and
    coroutines. Both were introduces without proper support in standard
    library. Absence of support in library in both cases was justified by probably correct claim that the best library constructs are still in
    research state, non-crystallized. The hope was that universal
    availability of this features at compiler level will help to best
    library constructs to mature.

    In case of coroutines developers were left with choice of 3 options:
    1. To write a lot of boiler-plate code each time they a going to use coroutines.
    2. To try to organize repetitive patterns in the library (likely
    template library) of their own and reuse it between parts of the
    programs and multiple projects. Hopefully, share with community.
    Hopefully, under liberal license.
    3. Don't use coroutines

    In case of concepts, the choice was even narrower:
    1. Use concepts when you occasionally are writing container-like or algorithm-like template of your own.
    2. Don't use concepts.

    Nobody was realistically expecting that grassroots developers will use concepts to develop comprehensive widely reusable library that
    duplicates functionality of STL, but brings advantage of sane error
    messages.


    So, where we are 3 years later?
    W.r.t. concepts, in the same unfortunate place.
    W.r.t. coroutines, library provides std::generator. I didn't look at it
    yet. Hopefully, it works. Hopefully it is easy to use. But it is just
    one of many possible uses of coroutines, and I would think that
    it is not the one that could be considered most common.


    Did I miss something?


    Disclaimer - my work is mostly with long-running projects, and the
    standard to use is generally set at the start and left unchanged (I have
    a couple of projects that are still "live" written in C90). So C++17 is
    the latest C++ version I have used in real work. Additionally, working
    with small embedded systems means I use a somewhat restricted subset of
    the language and a very restricted subset of the standard library. So
    while I try to learn about newer standards, my experience of some
    features is limited.

    I would say that the major changes in C++20 are concepts, coroutines,
    modules and ranges. So there was actually quite a lot there.


    I like the idea of concepts. The syntax is somewhat ugly, but the
    little I have tried so far has been good. It's a lot nicer than
    enable_if<>, and it seems to live up to the promise of less horrible
    error messages from templates.

    (There seems to be an inevitable issue with C++, since everything has to
    be squeezed into a base syntax that dates back to C and was designed
    long before modern C++ ideas, that syntax will be ugly and at least some
    new features take a lot of effort to understand. I wonder if anything
    will come of the "Cpp2" project, aiming to re-do C++ with a newer syntax?)


    I also like the idea of modules, but implementation has taken longer
    than most C++20 features. I look forward to trying them now that there
    is an "official" gcc 14 toolchain package for embedded ARM.


    I have no experience with coroutines, so I can't really judge them.
    They do not appear to me to be a "thread alternative" - rather, they are
    trying to get the kind of lightweight asynchronous support that is
    increasingly popular in other languages (Python, Go, Javascript, etc.).
    Like C++ threading, locks and atomics, they don't really fit in the kind
    of system I work with.


    Ranges can be a good way to express some things in code, but again are
    somewhat crippled by a very verbose syntax compared to, say, list comprehensions in Python. (I don't know how something better could have
    been made and still fit within C++.)


    std::format is another major library addition.


    Most of the rest of C++20 was evolutionary, rather than revolutionary.



    As for C++23, I think most of the changes are small, but some of them
    will be very useful. Once "import std;" is properly supported by common toolchains, that will be a very nice feature that pretty much justifies
    the whole modules feature.

    For those that like ranges, the "views" library gives lazy evaluation.
    Many people who deal with non-ASCII characters will appreciate named
    UTF-8 characters. The multi-dimensional [] operator is something people
    have wanted since the first version of C++.

    As a fan of std::optional<> and std::variant<>, I think std::expected<>
    is a natural addition. I hope to see that as common practice instead of exceptions, which do not fit well with my line of work.


    I expect that the next big project I start on will use C++23, to pick up
    some of these small improvements. I don't expect to use more than a
    small fraction of the new C++23 features - but then, I never use more
    than a fraction of C++ features.


    Features I am looking forward to in the future are contracts, reflection
    / metaprogramming, pattern matching, and perhaps static exceptions.
    They keep getting delayed, unfortunately.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to [email protected] on Mon Dec 30 18:06:22 2024
    On 12/30/24 10:08, [email protected] wrote:
    On Mon, 30 Dec 2024 15:37:45 +0100
    David Brown <[email protected]> wibbled:
    ...
    You wrote: "Being serious, I haven't even checked whats new in it..."
    followed by assumptions about C++23. The only assumption /I/ made was
    that you were telling the truth - was that unreasonable?

    I'd skimmed the wiki entry, nothing in depth. It was enough. But hey, they've renamed puts() to println() so win! Not.

    So, David's assumption was unreasonable?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Chris M. Thomasson on Mon Dec 30 17:58:33 2024
    "Chris M. Thomasson" <[email protected]> writes:

    On 12/30/2024 3:14 AM, Tim Rentsch wrote:
    [...]

    Personal opinion: the comments from David Brown do more harm than
    good here. At some level he is just a guilty of giving a preachy
    opinion as the person he is responding to. It seems likely that
    his statements will exacerbate the offending behavior rather than
    diminish it.

    I had some arguments with David Brown. Everything was rather
    cordial. No flame wars, or anything like that.

    Please note that my comments were not about David Brown in general
    but only about the statements of his that were quoted in the posting
    I was responding to. What I said was not meant as a general
    statement, only a specific one, and was not meant about David as a
    person but only about the (quoted) words that appeared in the
    posting.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to [email protected] on Mon Dec 30 18:06:59 2024
    [email protected] writes:

    On Mon, 30 Dec 2024 03:17:17 -0800
    Tim Rentsch <[email protected]> wibbled:

    Michael S <[email protected]> writes:

    On Mon, 30 Dec 2024 00:12:31 +0200
    Paavo Helde <[email protected]> wrote:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.

    It seems that [email protected] still didn't figure out why
    stating strong opinion about something that you not just didn't learn
    in depth, but didn't even look at casually is less than optimal.

    For some time now I have simply stopped reading his comments.
    I don't know why anyone bothers with him for more than a handful
    of interactions.

    The same could be said about you.

    I assume you mean that someone might have the same reaction to me
    as you imagine I have to Muttley. Note that I didn't say anything
    about Muttley; my comments were statements only about myself, not
    about anyone else.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pavel@21:1/5 to Michael S on Mon Dec 30 22:26:52 2024
    Michael S wrote:
    On Mon, 30 Dec 2024 00:12:31 +0200
    Paavo Helde <[email protected]> wrote:

    On 29.12.2024 15:51, David Brown wrote:

    You can have an informed opinion about C++, and agree or disagree
    with the opinions of the committee members.

    But what you don't get to do - or at least, don't get to do if you
    want to be viewed seriously - is spout an /uninformed/ opinion.
    That's no more than mindless prejudice, and of no interest to
    anyone.

    Thanks David, for standing against the trolls. It's a pity that
    personal freedoms are often interpreted as "my ignorant opinion has
    exactly the same worth as your expert knowledge".

    I'm all for personal freedoms, but my freedoms end where they might
    hurt other people, or the nature for that matter. Boasting ignorant
    jumble can easily do that.


    It seems that [email protected] still didn't figure out why
    stating strong opinion about something that you not just didn't learn
    in depth, but didn't even look at casually is less than optimal.

    Tried to apply your principle by not opining on US tax code before learning it in depth. Neither worked.

    -Pavel

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Tim Rentsch on Tue Dec 31 10:54:05 2024
    On 31/12/2024 02:58, Tim Rentsch wrote:
    "Chris M. Thomasson" <[email protected]> writes:

    On 12/30/2024 3:14 AM, Tim Rentsch wrote:
    [...]

    Personal opinion: the comments from David Brown do more harm than
    good here. At some level he is just a guilty of giving a preachy
    opinion as the person he is responding to. It seems likely that
    his statements will exacerbate the offending behavior rather than
    diminish it.

    I had some arguments with David Brown. Everything was rather
    cordial. No flame wars, or anything like that.

    (I have been less than cordial with some people - sometimes to an extent
    that I later regretted.)


    Please note that my comments were not about David Brown in general
    but only about the statements of his that were quoted in the posting
    I was responding to. What I said was not meant as a general
    statement, only a specific one, and was not meant about David as a
    person but only about the (quoted) words that appeared in the
    posting.

    And that's all fine by me.


    """
    Well, sir, my friends praise me and in so doing make a fool of me, while
    my enemies tell me plainly that I am a fool. Therefore my enemies help
    me gain knowledge of myself, while my friends deceive me.
    """

    Twelfth Night



    (Not that I view Tim as "my enemy" in any sense!)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Wed Jan 1 16:05:37 2025
    On Wed, 1 Jan 2025 17:55:01 +0200
    Michael S <[email protected]> gabbled:
    On Mon, 30 Dec 2024 15:08:13 -0000 (UTC)
    [email protected] wrote:


    I'd skimmed the wiki entry, nothing in depth. It was enough. But hey,
    they've renamed puts() to println() so win! Not.


    Congratulations. You are not an ordinary idiot, but quite extraordinary
    one. Not the best, but likely you belong to top 5%.

    That your considered opinion is it aspie?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to [email protected] on Wed Jan 1 17:55:01 2025
    On Mon, 30 Dec 2024 15:08:13 -0000 (UTC)
    [email protected] wrote:


    I'd skimmed the wiki entry, nothing in depth. It was enough. But hey,
    they've renamed puts() to println() so win! Not.


    Congratulations. You are not an ordinary idiot, but quite extraordinary
    one. Not the best, but likely you belong to top 5%.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Wed Jan 1 16:33:56 2025
    On Wed, 1 Jan 2025 18:25:27 +0200
    Michael S <[email protected]> gabbled:
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to >format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    Plus overloading << and >> was a cretinous decision. There was zero reason
    he couldn't have created some new operators to avoid confusion, <<< and >>>
    or <= , => for example where such combinations in C would never be legal
    syntax anyway.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Stefan Ram on Wed Jan 1 18:25:27 2025
    On 27 Dec 2024 14:47:51 GMT
    [email protected] (Stefan Ram) wrote:

    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)



    I tried std::print both with gcc 14.2 and with clang 19.1.6 under
    Windows/msys2 (ucrt variant of x86-64 toolsests). It works as
    advertised.
    That is, an Windows 7 in default console windows it works as advertised
    for as long as you had chosen a font that supports all languages that
    you want to see. A default (Lucudia Console) was not good enough for my
    mix of languages, but (less elegantly looking) Currier New did the job. Supposedly, on newer versions of Windows it will work with default
    fonts as well.
    For those who want to try it: new version of compiler is not enough,
    you have to install new C++ libraries (in my case, mingw-w64-ucrt-x86_64-libc++). And don't forget to specify -lstdc++exp
    during linking.

    Now to why, despite said above, I wouldn't use std::print() in its
    current incarnation neither in production nor in hobby programs:
    because compilation is too slow. ~4 seconds on the old home PC. I
    didn't try on newer machines yet, but would be surprised if any of them
    beats 2 seconds. Which is way above my threshold of inconvenience.


    Nevertheless, it is a step in right direction.
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rosario19@21:1/5 to Stefan Ram on Wed Jan 1 18:27:44 2025
    On 27 Dec 2024 14:47:51 GMT, (Stefan Ram) wrote:

    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)


    ot i prefer
    https://en.cppreference.com/w/c/23

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Michael S on Wed Jan 1 22:43:35 2025
    On 01.01.2025 18:25, Michael S wrote:
    On 27 Dec 2024 14:47:51 GMT
    [email protected] (Stefan Ram) wrote:

    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)



    I tried std::print both with gcc 14.2 and with clang 19.1.6 under Windows/msys2 (ucrt variant of x86-64 toolsests). It works as
    advertised.
    That is, an Windows 7 in default console windows it works as advertised
    for as long as you had chosen a font that supports all languages that
    you want to see. A default (Lucudia Console) was not good enough for my
    mix of languages, but (less elegantly looking) Currier New did the job. Supposedly, on newer versions of Windows it will work with default
    fonts as well.
    For those who want to try it: new version of compiler is not enough,
    you have to install new C++ libraries (in my case, mingw-w64-ucrt-x86_64-libc++). And don't forget to specify -lstdc++exp
    during linking.

    Now to why, despite said above, I wouldn't use std::print() in its
    current incarnation neither in production nor in hobby programs:
    because compilation is too slow. ~4 seconds on the old home PC. I
    didn't try on newer machines yet, but would be surprised if any of them
    beats 2 seconds. Which is way above my threshold of inconvenience.

    Whenever I recompile my program, the company-mandated security software
    will check it against viruses (again!) for 5 seconds at least. I have
    (almost) got used to it...



    Nevertheless, it is a step in right direction.
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    Half of the slowness of both in C printf() and C++ streams comes from
    the locale support, which is often unneeded and would just slow things
    down. If I have understood correctly, std::print() does not use locale
    by default, so has a chance to be much faster. If so, then definitely
    this is a step in the right direction.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Thu Jan 2 08:06:05 2025
    On 01/01/2025 17:33, [email protected] wrote:
    On Wed, 1 Jan 2025 18:25:27 +0200
    Michael S <[email protected]> gabbled:
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to
    format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    Plus overloading << and >> was a cretinous decision. There was zero reason
    he couldn't have created some new operators to avoid confusion, <<< and >>> or <= , => for example where such combinations in C would never be legal syntax anyway.


    I don't actually agree - I think the choice of << and >> was not a bad
    one, though <= and => could have worked too. Adding new operators just
    for the purpose of streams would have been overkill, IMHO. The big
    alternative would have been to have a way to add new operators to the
    language. That would have been a huge change to C++ - the language, the
    tools, and the way we write code. Maybe it would have been good, maybe
    bad, but certainly it would have been big.

    IMHO the real mistake for iostreams for formatted output was making them
    modal - IO manipulators are a /terrible/ idea. The type system and
    overloading should have been used instead, so that we would write :

    cout << hex(x);

    instead of

    cout << hex << x << dec;


    There are still plenty of other issues with the iostreams formatted
    output, but the choice of operator is the least of the problems.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Paavo Helde on Thu Jan 2 07:56:25 2025
    On 01/01/2025 21:43, Paavo Helde wrote:
    On 01.01.2025 18:25, Michael S wrote:

    Nevertheless, it is a step in right direction.
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to
    format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    Half of the slowness of both in C printf() and C++ streams comes from
    the locale support, which is often unneeded and would just slow things
    down. If I have understood correctly, std::print() does not use locale
    by default, so has a chance to be much faster. If so, then definitely
    this is a step in the right direction.



    I have not tried std::format or std::print at all.

    For my use, the old-style C++ iostreams are far too big - in small
    embedded systems, the amount of code pulled in to the link by even the
    simplest use is enormous. (On many small systems, even standard
    "printf" is too bulky.)


    If std::format and/or std::print can avoid such bulk, and be easily used
    with custom backends (typically I want the output sent to a serial
    port), it might be useful for me.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Paavo Helde on Thu Jan 2 00:39:54 2025
    Paavo Helde <[email protected]> writes:

    [...]

    Half of the slowness of both in C printf() and C++ streams comes
    from the locale support, [...]

    I find this assertion very hard to believe (specifically, for
    printf(); I might guess that C++ streams have similar
    performance characteristics, but I don't have nearly as much
    experience with C++ streams as I do with printf()).

    Is there anything else you can say about it besides an
    unsupported assertion?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Thu Jan 2 09:23:59 2025
    On Thu, 2 Jan 2025 08:06:05 +0100
    David Brown <[email protected]> gabbled:
    On 01/01/2025 17:33, [email protected] wrote:
    On Wed, 1 Jan 2025 18:25:27 +0200
    Michael S <[email protected]> gabbled:
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to
    format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    Plus overloading << and >> was a cretinous decision. There was zero reason >> he couldn't have created some new operators to avoid confusion, <<< and >>> >> or <= , => for example where such combinations in C would never be legal
    syntax anyway.


    I don't actually agree - I think the choice of << and >> was not a bad
    one, though <= and => could have worked too. Adding new operators just
    for the purpose of streams would have been overkill, IMHO. The big

    Now maybe, but when the language was new I don't see the problem in creating new
    operators specifically for I/O. After all, he had to create new keywords so
    why not operators? Even Bjarne must've thought at the time that something like:

    cout << 0xFF << 2 << 1234;

    would require brackets whereas

    cout <= OxFF << 2 <= 1234;

    is a lot clearer and doesn't.

    alternative would have been to have a way to add new operators to the >language. That would have been a huge change to C++ - the language, the

    Why would it?

    IMHO the real mistake for iostreams for formatted output was making them >modal - IO manipulators are a /terrible/ idea. The type system and >overloading should have been used instead, so that we would write :

    cout << hex(x);

    instead of

    cout << hex << x << dec;

    Agreed.

    There are still plenty of other issues with the iostreams formatted
    output, but the choice of operator is the least of the problems.

    Personally I think printf() should have been upgraded for C++ from the start
    so you could use all the normal formatters but have new ones for object output with a slightly different format that would achieve similar. eg:

    int i = 123;
    const std::string s = "hello";
    printf("%d: %$o\n",i,s);

    In this case %$o would mean output yourself as a C char*.

    Presumably this is what the new print() and println() functions will do
    except they seem to be using python style formatters for [reasons].

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Tim Rentsch on Thu Jan 2 12:31:08 2025
    On 02.01.2025 10:39, Tim Rentsch wrote:
    Paavo Helde <[email protected]> writes:

    [...]

    Half of the slowness of both in C printf() and C++ streams comes
    from the locale support, [...]

    I find this assertion very hard to believe (specifically, for
    printf(); I might guess that C++ streams have similar
    performance characteristics, but I don't have nearly as much
    experience with C++ streams as I do with printf()).

    Is there anything else you can say about it besides an
    unsupported assertion?

    Probably you were misled by my vague word usage. I said "half of the
    slowness", not "half of the total time". As "slowness" is nowhere
    exactly defined, this was just a figure of speech, no need to get overly
    upset about that.

    Anyway, I have profiled the writing of large CSV tables (multi-GB) which
    was deemed too slow. 90% of time was spent in sprintf() calls, from
    which 10% was spent in locale-related routines, presumably for checking
    that the global process locale has not changed during the last
    microsecond. Considering that our CSV file format had to always use the
    fixed C-locale format anyway, this locale checking was something which
    was absolutely unneeded.

    We tried to parallelize the writing, expecting to increase the speed N
    times by using N threads, but alas, as the locale is a global
    thread-shared object, now the threads started to fight over it and the performance did not scale nowhere near to our expectations. (The thread-specific locales were not available an all needed platforms).

    We resolved it finally by using std::to_chars() for integer data and
    Google's double-conversion library for floating-point data (our C++ implementations did not support std::to_chars() on floating-point data
    on all needed platforms at that time).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Paavo Helde on Thu Jan 2 14:59:52 2025
    On Thu, 2 Jan 2025 12:31:08 +0200
    Paavo Helde <[email protected]> wrote:

    We resolved it finally by using std::to_chars() for integer data and
    Google's double-conversion library for floating-point data (our C++ implementations did not support std::to_chars() on floating-point
    data on all needed platforms at that time).


    What do you consider "resolved" ?
    Suppose, we write to modern M.2 SSD. Not top speed, like Corsair MP700
    Pro, but something more modest, like Samsung 990 Pro. Sequential write
    speed of this popular SSD is close to 7 GB/s.
    Is the problem considered "resolved" when you are able to write your
    CVS at 2 GB/s, i.e. ~30% of what is theoretically possible?
    Me thinks, not quite. Client that paid for SSD would still be
    disappointed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Thu Jan 2 13:51:53 2025
    On 02/01/2025 10:23, [email protected] wrote:
    On Thu, 2 Jan 2025 08:06:05 +0100
    David Brown <[email protected]> gabbled:
    On 01/01/2025 17:33, [email protected] wrote:
    On Wed, 1 Jan 2025 18:25:27 +0200
    Michael S <[email protected]> gabbled:
    Introduction of format() already showed that C++ committee is aware of >>>> of the fact that "Stroustrup streams" are crap not only relatively to
    format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not >>>> only aware of the fact, but finally willing to consider fixes.

    Plus overloading << and >> was a cretinous decision. There was zero
    reason
    he couldn't have created some new operators to avoid confusion, <<<
    and >>>
    or <= , => for example where such combinations in C would never be legal >>> syntax anyway.


    I don't actually agree - I think the choice of << and >> was not a bad
    one, though <= and => could have worked too.  Adding new operators
    just for the purpose of streams would have been overkill, IMHO.  The big

    Now maybe, but when the language was new I don't see the problem in
    creating new
    operators specifically for I/O. After all, he had to create new keywords so why not operators?

    C++ added "::", ".*" and "->*" early on, and C++20 added <=>. (There
    are also some new non-punctuation operators - like "new".) Adding new operators is certainly something that was done, but not done lightly.

    Even Bjarne must've thought at the time that
    something like:

    cout << 0xFF << 2 << 1234;

    That doesn't require brackets (unless you are a fan of smart-arse
    obfuscated code, and really wanted "cout << (0xff << 2) << 1234;").


    would require brackets whereas

    cout <= OxFF << 2 <= 1234;

    is a lot clearer and doesn't.

    It is not a lot clearer - it is no clearer at all. If someone wrote
    that (in a parallel universe where <= was used for output streams), I'd
    ask two questions. First, is it a typo and the programmer meant to use
    "<=" instead of "<<" ? Secondly, I'd wonder what the *beep* the
    programmer had intended at all, typo or not.

    Maybe there /are/ good reasons for preferring <= to <<. But arguing
    about clarity in inherently unclear and unrealistic code is not going to
    show them.


    According to "The Design and Evolution of C++", Unix redirection
    operators were a major inspiration for the choice of << and >>.
    Operator precedence and associativity were important too. (<<= and >>=
    have the wrong binding.)


    alternative would have been to have a way to add new operators to the
    language.  That would have been a huge change to C++ - the language, the

    Why would it?


    It would be a significant change to the syntax and grammar of the
    language, complicating parsing, analysis and compilation. And they
    would, presumably, be used - for good and for bad, with that distinction
    being very subjective. You have said before (and not without reason)
    that C++ can be hard to learn. A plethora of new operators would not help.


    IMHO the real mistake for iostreams for formatted output was making
    them modal - IO manipulators are a /terrible/ idea.  The type system
    and overloading should have been used instead, so that we would write :

        cout << hex(x);

    instead of

        cout << hex << x << dec;

    Agreed.

    There are still plenty of other issues with the iostreams formatted
    output, but the choice of operator is the least of the problems.

    Personally I think printf() should have been upgraded for C++ from the
    start
    so you could use all the normal formatters but have new ones for object output with a slightly different format that would achieve similar. eg:

    int i = 123;
    const std::string s = "hello";
    printf("%d: %$o\n",i,s);

    In this case %$o would mean output yourself as a C char*.

    Presumably this is what the new print() and println() functions will do except they seem to be using python style formatters for [reasons].


    A key point is that the format string should never have to have
    information about the type of the operands - thus it is type-safe
    (unlike C "printf"). Format strings (for std::format and std::print)
    are parsed at compile-time, checking both the numbers of parameters,
    types, and format specifiers. This means that they need a significantly different style of format specifiers than printf used - and the Python
    ones were probably as good as any other option because they solve the
    same problem.

    Could this all have been done from the start of C++? In theory, yes -
    in practice no. std::format and std::print rely on various modern C++ features, such as compile-time evaluation of functions, and are
    dependent on optimising compilers to produce anything remotely
    efficient. (This has become steadily more important - C++ code
    generation would usually be terrible if the compiler cannot inline small utility functions.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Thu Jan 2 14:07:34 2025
    On Thu, 2 Jan 2025 13:51:53 +0100
    David Brown <[email protected]> wibbled:
    On 02/01/2025 10:23, [email protected] wrote:
    Now maybe, but when the language was new I don't see the problem in
    creating new
    operators specifically for I/O. After all, he had to create new keywords so >> why not operators?

    C++ added "::", ".*" and "->*" early on, and C++20 added <=>. (There
    are also some new non-punctuation operators - like "new".) Adding new >operators is certainly something that was done, but not done lightly.

    When the language is first created thats irrelevant. You add what you need
    to add. Overloading << and >> was unnecessary and confusing.

    cout << 0xFF << 2 << 1234;

    That doesn't require brackets (unless you are a fan of smart-arse
    obfuscated code, and really wanted "cout << (0xff << 2) << 1234;").

    So adding brackets to differential shift from stream I/O is obfuscating is it?

    cout <= OxFF << 2 <= 1234;

    is a lot clearer and doesn't.

    It is not a lot clearer - it is no clearer at all. If someone wrote

    Its far clearer and you're just arguing for the sake of it. Extending your logic why not just have one operator that does everything which varies with context?

    that (in a parallel universe where <= was used for output streams), I'd
    ask two questions. First, is it a typo and the programmer meant to use
    "<=" instead of "<<" ? Secondly, I'd wonder what the *beep* the
    programmer had intended at all, typo or not.

    Now you're trolling.

    According to "The Design and Evolution of C++", Unix redirection
    operators were a major inspiration for the choice of << and >>.

    Perhaps they shouldn't have been. Perl munged shell and C style syntax and
    look what a mess that turned out to be.

    Why would it?


    It would be a significant change to the syntax and grammar of the
    language, complicating parsing, analysis and compilation. And they

    Huh? How would it make parsing MORE complicated? Have you ever written a parser?

    being very subjective. You have said before (and not without reason)
    that C++ can be hard to learn. A plethora of new operators would not help.

    Having specific operators for specific tasks would actually make it easier
    to learn and read in the same way having specific keywords for specific
    tasks does. C++ problems due to arn't too many operators.

    Presumably this is what the new print() and println() functions will do
    except they seem to be using python style formatters for [reasons].


    A key point is that the format string should never have to have
    information about the type of the operands - thus it is type-safe

    It wouldn't need to. A particular formatter could just call some default
    object output method just like streams do.

    Could this all have been done from the start of C++? In theory, yes -

    Thats when I'm refering to.

    in practice no. std::format and std::print rely on various modern C++ >features, such as compile-time evaluation of functions, and are

    Umm, you do realise most compilers already do compile time analysis of
    printf formatters otherwise they wouldn't be able to give warnings about invalid types being passed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Michael S on Thu Jan 2 15:50:27 2025
    On 02.01.2025 14:59, Michael S wrote:
    On Thu, 2 Jan 2025 12:31:08 +0200
    Paavo Helde <[email protected]> wrote:

    We resolved it finally by using std::to_chars() for integer data and
    Google's double-conversion library for floating-point data (our C++
    implementations did not support std::to_chars() on floating-point
    data on all needed platforms at that time).


    What do you consider "resolved" ?
    Suppose, we write to modern M.2 SSD. Not top speed, like Corsair MP700
    Pro, but something more modest, like Samsung 990 Pro. Sequential write
    speed of this popular SSD is close to 7 GB/s.
    Is the problem considered "resolved" when you are able to write your
    CVS at 2 GB/s, i.e. ~30% of what is theoretically possible?
    Me thinks, not quite. Client that paid for SSD would still be
    disappointed.

    The case is resolved when it gets closed in the issue tracker :-) And
    there is always the law of diminishing returns, meaning that there is
    only so much effort which we can spend on a specific case.

    A performance case like that gets closed when I say I do not see any
    further feasible possibilities for improvement, and my team leader
    agrees. If the file writing is still perceived as too slow, then one
    would need to consider radically different alternatives (which would be
    then tracked as new cases in the issue tracker ;-)

    In this case of CSV serialization, an obvious speedup would be to write
    binary files instead of text files, but this would complicate
    interoperability and disrupt all existing data processing pipelines
    involving both multiple departments in our company and also our
    customers, so most probably this would never happen.

    In other more contained situations, what we have done e.g. in the past,
    was to use shared memory instead of HTTP downloads for file transfer
    from one process to another. I suspect the HTTP slowness was actually
    caused by some overeager antivirus scanner, but I think they never
    figured it out for sure.

    And finally, if all else fails, then it will be the task for the
    customer support to explain the customers that processing their always
    growing amounts of data needs some actual work and does not happen
    instantly.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Michael S on Thu Jan 2 16:47:50 2025
    On Wed, 1 Jan 2025 18:25:27 +0200
    Michael S <[email protected]> wrote:


    Now to why, despite said above, I wouldn't use std::print() in its
    current incarnation neither in production nor in hobby programs:
    because compilation is too slow. ~4 seconds on the old home PC. I
    didn't try on newer machines yet, but would be surprised if any of
    them beats 2 seconds. Which is way above my threshold of
    inconvenience.


    More experiments showed that slowness of compilation is caused by C++20
    part (format()) rather than by C++23 addition.
    It's somewhat less bad with -O1, instead of original -O2 and yet less
    bad with -Og or -O0. But even for -O0 compilation takes over 2 sec.
    Still above my personal threshold for annoyance.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to David Brown on Thu Jan 2 17:35:14 2025
    On Thu, 2 Jan 2025 13:51:53 +0100
    David Brown <[email protected]> wrote:


    Could this all have been done from the start of C++? In theory, yes
    - in practice no. std::format and std::print rely on various modern
    C++ features, such as compile-time evaluation of functions,

    It does not look like dependence of std::format on compile-time
    evaluation is a requirement of standard rather than implementation
    choice of g++ and of clang++.

    MSVC 19.30.30706 compiles the following code just fine:

    #include <cstdio>
    #include <format>

    int main(int argc, char** argv)
    {
    if (argc >= 3) {
    std::string s = std::format(argv[1], argv[2]);
    printf("%s\n", s.c_str());
    }
    return 0;
    }

    When run, it produces expected results.

    Or, may be, it's because this version of MSVC is not fully C++20
    complient.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Michael S on Thu Jan 2 17:57:06 2025
    On 02/01/2025 16:35, Michael S wrote:
    On Thu, 2 Jan 2025 13:51:53 +0100
    David Brown <[email protected]> wrote:


    Could this all have been done from the start of C++? In theory, yes
    - in practice no. std::format and std::print rely on various modern
    C++ features, such as compile-time evaluation of functions,

    It does not look like dependence of std::format on compile-time
    evaluation is a requirement of standard rather than implementation
    choice of g++ and of clang++.

    MSVC 19.30.30706 compiles the following code just fine:

    #include <cstdio>
    #include <format>

    int main(int argc, char** argv)
    {
    if (argc >= 3) {
    std::string s = std::format(argv[1], argv[2]);
    printf("%s\n", s.c_str());
    }
    return 0;
    }

    When run, it produces expected results.

    Or, may be, it's because this version of MSVC is not fully C++20
    complient.


    <https://en.cppreference.com/w/cpp/utility/format/format>

    Apparently P2216R3 made compile-time checks for std::format a
    requirement. I don't know where that fits with standard versions, or
    compiler support. I am just going by what it says in the reference here.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Thu Jan 2 17:15:19 2025
    On Thu, 2 Jan 2025 17:54:18 +0100
    David Brown <[email protected]> wibbled:
    On 02/01/2025 15:07, [email protected] wrote:
    Overloading << and >> was unnecessary and confusing.

    Disagreed. I really don't think it was problematic. Nor did any of the >/many/ people who were involved in the design of C++. Remember, the
    language and library has always been discussed, prototyped, and tested
    by lots of people before being released. Stroustrup was the main
    language designer, but he was far from alone.

    Committees often don't come up with optimal solutions. Using the same operator for 2 entirely different operations unrelated in either concept or function when there was no need to was illogical and perverse.

    The meaning of "cout << 0xFF << 2 << 1234;" is obviously a chain of
    outputs - output 0xff, output 2, output 1234. Regardless of the

    I would expect all mathematical operations to work in EXACTLY the same way
    in an output stream. Eg I expect the output to be 256 here:

    std::cout << 255 + 1 << std::endl;

    Yet here there is no maths involved:

    std::cout << 255 << 1 << std::endl;

    Thats perverse.

    Its far clearer and you're just arguing for the sake of it. Extending your >> logic why not just have one operator that does everything which varies with >> context?


    That's not "extending" my logic - it is simply failing to understand it.

    I understand it perfectly. Your logic and reasoning are flawed and you're trying to justify an unjustifiable design decision.

    Having specific operators for specific tasks would actually make it easier >> to learn and read in the same way having specific keywords for specific
    tasks does. C++ problems due to arn't too many operators.


    I agree that C++ does not have a problem of having too many operators -
    but if there were a free-for-all to define operators, then I think that

    Straw man. Thats not what I'm suggesting.

    Umm, you do realise most compilers already do compile time analysis of
    printf formatters otherwise they wouldn't be able to give warnings about
    invalid types being passed.


    Yes - they do /now/. But they did not do so previously. And the

    So what? They could have done so in the past, its not rocket science.

    compiler-specific warning checks on printf-style functions is a very
    fragile solution, and depends on close matches between the compiler and

    So what do you think the compiler will do with the new functions? Use unicorns and moonbeams to check the format?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Thu Jan 2 17:54:18 2025
    On 02/01/2025 15:07, [email protected] wrote:
    On Thu, 2 Jan 2025 13:51:53 +0100
    David Brown <[email protected]> wibbled:
    On 02/01/2025 10:23, [email protected] wrote:
    Now maybe, but when the language was new I don't see the problem in
    creating new
    operators specifically for I/O. After all, he had to create new keywords so >>> why not operators?

    C++ added "::", ".*" and "->*" early on, and C++20 added <=>. (There
    are also some new non-punctuation operators - like "new".) Adding new
    operators is certainly something that was done, but not done lightly.

    When the language is first created thats irrelevant. You add what you need
    to add.

    Agreed.

    Overloading << and >> was unnecessary and confusing.

    Disagreed. I really don't think it was problematic. Nor did any of the
    /many/ people who were involved in the design of C++. Remember, the
    language and library has always been discussed, prototyped, and tested
    by lots of people before being released. Stroustrup was the main
    language designer, but he was far from alone.

    Over the decades, C++ programmers have had plenty of complaints about
    the iostreams library. While it is true that some people complain about
    the operators used, I don't believe it is the main complaint.


    cout << 0xFF << 2 << 1234;

    That doesn't require brackets (unless you are a fan of smart-arse
    obfuscated code, and really wanted "cout << (0xff << 2) << 1234;").

    So adding brackets to differential shift from stream I/O is obfuscating is it?

    The meaning of "cout << 0xFF << 2 << 1234;" is obviously a chain of
    outputs - output 0xff, output 2, output 1234. Regardless of the
    precedences of operators or what operators are used, the only reason to
    write code that tries to use a chain of operators for something other
    than the obvious meaning is to try to look smart.

    So "cout << 0xFF << 2 << 1234;" does not require brackets - it does what
    it appears to do.


    If you had intended that the bit "0xff << 2" was to be evaluated as a
    shift, then you /do/ need parenthesis. And unless you were trying (and failing) to look smart, you would use them even if the output used "<="
    - or "<<<", or a dedicated new Unicode symbol like "⬱".


    cout <= OxFF << 2 <= 1234;

    is a lot clearer and doesn't.

    It is not a lot clearer - it is no clearer at all. If someone wrote

    Its far clearer and you're just arguing for the sake of it. Extending your logic why not just have one operator that does everything which varies with context?


    That's not "extending" my logic - it is simply failing to understand it.
    I didn't suggest that "cout << 0xFF << 2 << 1234;" was clearer than
    "cout <= 0xFF << 2 <= 1234;" if you wanted the shift operation - I said
    they are /both/ unclear.

    Clarity is, of course, a matter of opinion - and your opinions on code
    clarity may differ from mine. But please try to understand what I write.

    that (in a parallel universe where <= was used for output streams), I'd
    ask two questions. First, is it a typo and the programmer meant to use
    "<=" instead of "<<" ? Secondly, I'd wonder what the *beep* the
    programmer had intended at all, typo or not.

    Now you're trolling.


    No.

    Can you give any kind of realistic situation where you'd want to write
    code like this? No, neither can I. When someone writes code that has
    no clear purpose, the natural think is to question it.

    According to "The Design and Evolution of C++", Unix redirection
    operators were a major inspiration for the choice of << and >>.

    Perhaps they shouldn't have been. Perl munged shell and C style syntax and look what a mess that turned out to be.


    You wondered about the reasoning for the choices, I told you the reasoning.

    Why would it?


    It would be a significant change to the syntax and grammar of the
    language, complicating parsing, analysis and compilation. And they

    Huh? How would it make parsing MORE complicated? Have you ever written a parser?

    I haven't written a C++ parser. But I believe (because I naïvely belief
    some things I have read on the internet without checking them) that it
    is impossible to make a parser for Raku (né Perl) that can parse all
    correct Perl code - and that key to this is the fact that you can define
    your own operators in Perl.

    (Adding specific fixed operators would be a different matter.)


    being very subjective. You have said before (and not without reason)
    that C++ can be hard to learn. A plethora of new operators would not help.

    Having specific operators for specific tasks would actually make it easier
    to learn and read in the same way having specific keywords for specific
    tasks does. C++ problems due to arn't too many operators.


    I agree that C++ does not have a problem of having too many operators -
    but if there were a free-for-all to define operators, then I think that
    /would/ become a problem. A few more might be okay, but not too many -
    and I really don't think input and output needs dedicated operators.


    Presumably this is what the new print() and println() functions will do
    except they seem to be using python style formatters for [reasons].


    A key point is that the format string should never have to have
    information about the type of the operands - thus it is type-safe

    It wouldn't need to. A particular formatter could just call some default object output method just like streams do.

    Could this all have been done from the start of C++? In theory, yes -

    Thats when I'm refering to.

    in practice no. std::format and std::print rely on various modern C++
    features, such as compile-time evaluation of functions, and are

    Umm, you do realise most compilers already do compile time analysis of
    printf formatters otherwise they wouldn't be able to give warnings about invalid types being passed.


    Yes - they do /now/. But they did not do so previously. And the compiler-specific warning checks on printf-style functions is a very
    fragile solution, and depends on close matches between the compiler and
    the printf implementation. It is not extendable to different types.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to David Brown on Thu Jan 2 19:55:42 2025
    On Thu, 2 Jan 2025 17:57:06 +0100
    David Brown <[email protected]> wrote:

    On 02/01/2025 16:35, Michael S wrote:
    On Thu, 2 Jan 2025 13:51:53 +0100
    David Brown <[email protected]> wrote:


    Could this all have been done from the start of C++? In theory,
    yes
    - in practice no. std::format and std::print rely on various
    modern C++ features, such as compile-time evaluation of functions,


    It does not look like dependence of std::format on compile-time
    evaluation is a requirement of standard rather than implementation
    choice of g++ and of clang++.

    MSVC 19.30.30706 compiles the following code just fine:

    #include <cstdio>
    #include <format>

    int main(int argc, char** argv)
    {
    if (argc >= 3) {
    std::string s = std::format(argv[1], argv[2]);
    printf("%s\n", s.c_str());
    }
    return 0;
    }

    When run, it produces expected results.

    Or, may be, it's because this version of MSVC is not fully C++20
    complient.


    <https://en.cppreference.com/w/cpp/utility/format/format>

    Apparently P2216R3 made compile-time checks for std::format a
    requirement. I don't know where that fits with standard versions, or compiler support. I am just going by what it says in the reference
    here.



    P2216R3 was published 2 or 3 months after C++20. I also don't know if
    rules allow for edition of the Standard to be changed retroactively. Supposedly, it is part of C++23.

    Anyway, I believe in good intention of the committee, but [so far]
    results in practice are not great.
    That is, on the MS side (19.30.30706) std::format() accepts any crap
    without blinking. Hopefully, more recent versions work better.
    On the gcc and clang sides quite new versions that I have installed
    were able to catch few simple argument type bugs that I tried to
    introduce, but error message were unhelpful.

    For comparison, when the same type bugs are made in printf then all 3
    compilers produce very informative warnings.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to David Brown on Thu Jan 2 15:20:45 2025
    David Brown writes:

    On 02/01/2025 15:07, [email protected] wrote:

    Overloading << and >> was unnecessary and confusing.

    Disagreed. I really don't think it was problematic. Nor did any of the /many/ people who were involved in the design of C++. Remember, the
    language and library has always been discussed, prototyped, and tested by lots of people before being released.

    And none of those "lots of people" recognized the major clusterfark that was dumped into C++98, in the form of throw specifiers, when they came about?

    Let's see…: JDK 1.0 came out in 1996. I'm supposed to believe that not even one of those "lots of people" were aware of Java; were aware that in Java
    throw specifications were a part of, essentially, what C++ would call a
    method signature, and enforced by the compiler; and that if any code path
    fails to catch an exception it is ill-formed. And not /one/ of those people
    had the obvious "hey, that's what C++ should do, too" epiphany?

    And when everyone was dragged, kicking and screaming, into admitting that
    throw specifications were a clusterfark, instead of fixing the mess it just
    got handwaived away, leaving behind just a token "noexcept" keyword, and a
    huge pile of code that now needs to be fixed, before it compiles again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Scott Lurndal@21:1/5 to Paavo Helde on Thu Jan 2 20:51:09 2025
    Paavo Helde <[email protected]> writes:
    On 01.01.2025 18:25, Michael S wrote:
    On 27 Dec 2024 14:47:51 GMT
    [email protected] (Stefan Ram) wrote:


    Nevertheless, it is a step in right direction.
    Introduction of format() already showed that C++ committee is aware of
    of the fact that "Stroustrup streams" are crap not only relatively to
    format/printing facilities of more modern languages, but relatively
    to what we have in C as well. std::print() proves that committee is not
    only aware of the fact, but finally willing to consider fixes.

    Half of the slowness of both in C printf() and C++ streams comes from

    Don't lump them together. C printf/snprintf is rather efficient when using the
    POSIX C locale. Faster by orders of magnitude when comparing with C++
    output streams.

    C++ streams, on the other hand, cannot be made efficient without
    completely replacing the paradigm. To that end, std::print is a
    start - although being built on the standard C++ streams paradigm
    inevitiably leads to sub-optimal performance.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rosario19@21:1/5 to Keith Thompson on Thu Jan 2 22:48:53 2025
    On Wed, 01 Jan 2025 14:44:37 -0800, Keith Thompson wrote:
    Rosario19 <[email protected]d> writes:
    On 27 Dec 2024 14:47:51 GMT, (Stefan Ram) wrote:
    According to one web site, C++23 (ISO/IEC 14882:2024) was released
    October 19, 2024.

    (Sorry if it was mentioned here then, and I just did not notice!)

    ot i prefer
    https://en.cppreference.com/w/c/23

    That has information about C23. Did you mean
    https://en.cppreference.com/w/cpp/23
    which describes C++23?

    (If you meant to say that you prefer C over C++, that's not helpful.)

    it seems C23 and C++23 standars are out as last standard of C and C++
    now

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Keith Thompson on Fri Jan 3 09:42:19 2025
    On 02/01/2025 22:40, Keith Thompson wrote:
    David Brown <[email protected]> writes:
    [...]
    IMHO the real mistake for iostreams for formatted output was making
    them modal - IO manipulators are a /terrible/ idea.

    Agreed.

    The type system
    and overloading should have been used instead, so that we would write
    :

    cout << hex(x);

    instead of

    cout << hex << x << dec;

    Note that the latter sets cout to decimal mode, not to whatever mode it
    had before.


    And that is the biggest problem with modal settings like this. Putting
    it to what you guess is the most likely previous setting is the best you
    can do (without using extra wrapper code).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Fri Jan 3 10:09:19 2025
    On Thu, 02 Jan 2025 13:38:17 -0800
    Keith Thompson <[email protected]> wibbled:
    [email protected] writes:
    [...]
    Plus overloading << and >> was a cretinous decision. There was zero reason >> he couldn't have created some new operators to avoid confusion, <<< and >>> >> or <= , => for example where such combinations in C would never be legal
    syntax anyway.

    <= is already an operator. <<< and >>> are not, but at least >>>

    True, my bad.

    exists in some other languages, which could lead to confusion
    (admittedly that's not a very strong argument).

    Not sure why an operator existing in another language would cause confusion. Does the "for" keyword being almost universal confuse C++ devs?

    I wouldn't have minded having new operators for I/O, but I'm not sure
    what characters would have been used. Perhaps something involving
    "@"?

    It doesn't have to be pretty, so long as its unique.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Fri Jan 3 10:13:51 2025
    On Thu, 02 Jan 2025 13:58:34 -0800
    Keith Thompson <[email protected]> wibbled:
    [email protected] writes:
    On Thu, 2 Jan 2025 17:54:18 +0100
    David Brown <[email protected]> wibbled:
    On 02/01/2025 15:07, [email protected] wrote:
    Overloading << and >> was unnecessary and confusing.

    Disagreed. I really don't think it was problematic. Nor did any of the >>>/many/ people who were involved in the design of C++. Remember, the >>>language and library has always been discussed, prototyped, and tested
    by lots of people before being released. Stroustrup was the main >>>language designer, but he was far from alone.

    Committees often don't come up with optimal solutions. Using the same >operator
    for 2 entirely different operations unrelated in either concept or function >> when there was no need to was illogical and perverse.

    Like "*" for multiplication and pointer dereferencing? Like "&" for
    bitwise "and" and address-of? Like "-" for negation and subtraction?

    As you well know they derived from C and couldn't be changed. However I don't believe using "&" for references was the best choice but at least it sort of makes sense in context.

    I would expect all mathematical operations to work in EXACTLY the same way >> in an output stream.

    I would expect << and >> to have their usual precedence whether
    overloaded or not.

    You're missing the point.

    Eg I expect the output to be 256 here:

    std::cout << 255 + 1 << std::endl;

    Which it is.

    No shit.

    std::cout << 255 << 1 << std::endl;

    Thats perverse.

    Apparently your expectation was incorrect.

    Don't be obtuse for the sake of arguing.

    std::cout << n = 42 << "\n";

    and it won't compile, but parentheses are an easy fix and a good idea
    anyway.

    How often has it really been a problem for you?

    Given I do a lot of bit twiddling low level code, more than you might
    expect. And its not a problem per se as it can be solved with brackets, I'm simply saying it was a daft design decision to overload << and >> when Bjarne could have easily created new operators at no cost. There was NO requirement
    in this case to be compatible with C because streams were C++ specific functionality.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Sam on Fri Jan 3 13:43:10 2025
    On 02/01/2025 21:20, Sam wrote:
    David Brown writes:

    On 02/01/2025 15:07, [email protected] wrote:

    Overloading << and >> was unnecessary and confusing.

    Disagreed.  I really don't think it was problematic.  Nor did any of
    the /many/ people who were involved in the design of C++.  Remember,
    the language and library has always been discussed, prototyped, and
    tested by lots of people before being released.

    And none of those "lots of people" recognized the major clusterfark that
    was dumped into C++98, in the form of throw specifiers, when they came
    about?

    Let's see…: JDK 1.0 came out in 1996. I'm supposed to believe that not
    even one of those "lots of people" were aware of Java; were aware that
    in Java throw specifications were a part of, essentially, what C++ would
    call a method signature, and enforced by the compiler; and that if any
    code path fails to catch an exception it is ill-formed. And not /one/ of those people had the obvious "hey, that's what C++ should do, too"
    epiphany?


    You can believe what you want - /I/ am not going to tell you what you
    are "supposed" to believe. If you want to know the details of how C++
    was designed and how it evolved, you can buy and read "The Design and
    Evolution of C++" covering up to about 1994. For later information on
    why C++ is the way it is, Stroustrup published some more papers later.
    They are not hard to find: <https://en.wikipedia.org/wiki/Bjarne_Stroustrup#C++>

    I am not a Java programmer, but I believe it has two kinds of exceptions
    - "checked exceptions" that are considered part of the "method
    signature", and "unchecked exceptions" that, like C++ exceptions, are
    /not/ part of the "method signature". Java certainly seems to have
    viewed both types of exceptions as having their uses and advantages.

    Much of Java - including its exceptions - are inspired by C++. So long
    before Java was conceived, and certainly before checked exceptions were
    added and tried out in real-world code, C++ had already fixed on their
    style of exception that is not part of the function signature, and
    changing that would not have been at all easy.

    And when everyone was dragged, kicking and screaming, into admitting
    that throw specifications were a clusterfark, instead of fixing the mess
    it just got handwaived away, leaving behind just a token "noexcept"
    keyword, and a huge pile of code that now needs to be fixed, before it compiles again.


    I think it became fairly quickly apparent that "throw(...)" specifiers
    were not as useful in practice as had been hoped, and relatively few programmers used them except in the form "throw()". So "throw(...)" was deprecated in C++11 and has been valid until C++17 (with compilers implementations being free to accept it as a non-standard extension far
    beyond that). "throw()" was valid until C++20. For most code, the fix
    needed to go from old-style "throw" specifiers to "noexcept" specifiers
    is to replace "throw()" with "noexcept()" - it can be done with a macro
    if you like.


    (For my own use, I disable exceptions for C++.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to David Brown on Fri Jan 3 08:11:41 2025
    David Brown writes:

    I think it became fairly quickly apparent that "throw(...)" specifiers were not as useful in practice as had been hoped, and relatively few programmers used them except in the form "throw()". So "throw(...)" was deprecated in C++11 and has been valid until C++17 (with compilers implementations being free to accept it as a non-standard extension far beyond that).

    It should be painfully obvious that the right thing to do should've been to merge throw specifications into function signatures, allowing exception handling to be validated at compile-time, i.e. what Java did. Instead of
    that we have the current state of affairs where the only half-assed solution
    is to have all exception classes derived from a superclass, i.e. std::exception, and then play musical chairs to catch exceptions.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Sam on Fri Jan 3 16:33:21 2025
    On 03.01.2025 15:11, Sam wrote:
    David Brown writes:

    I think it became fairly quickly apparent that "throw(...)" specifiers
    were not as useful in practice as had been hoped, and relatively few
    programmers used them except in the form "throw()".  So "throw(...)"
    was deprecated in C++11 and has been valid until C++17 (with compilers
    implementations being free to accept it as a non-standard extension
    far beyond that).

    It should be painfully obvious that the right thing to do should've been
    to merge throw specifications into function signatures, allowing
    exception handling to be validated at compile-time, i.e. what Java did. Instead of that we have the current state of affairs where the only

    It might be obvious to you, but not for everybody. What exact problem
    can be solved by validating thrown exception classes at compile time?
    And how would a developer of a base class know which exceptions I might
    want to throw from an overridden virtual function in a derived class,
    which might be developed and compiled fully separately from the base class?


    half-assed solution is to have all exception classes derived from a superclass, i.e. std::exception, and then play musical chairs to catch exceptions.

    My Java is rusty, but isn't it in Java that all exception classes must
    be derived from a single superclass (Throwable)?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Fri Jan 3 16:09:39 2025
    On Fri, 03 Jan 2025 10:50:51 -0500
    Sam <[email protected]> wibbled:
    Paavo Helde writes:
    Here's a free clue. Define "function X throws exception Y" if it throws that >exception (and it doesn't catch it itself), or if it calls function Z that's >declared (in Z's throw specifier) as throwing that exception. The compiler >has all the information needed to know which exception can be thrown out of >that function.

    This is not C. This is C++. The compiler has the signature of every function >called by code.

    It needs more than that when function pointers are involved. It cannot necessarily know at compile time which function will be assigned to the
    pointer so how is it supposed to know if the exception sig is valid? Unless you're suggesting also have an exception sig for function pointers which would probably break a whole load of code and make life difficult for zero gain.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Sam on Fri Jan 3 17:12:09 2025
    On 03/01/2025 14:11, Sam wrote:
    David Brown writes:

    I think it became fairly quickly apparent that "throw(...)" specifiers
    were not as useful in practice as had been hoped, and relatively few
    programmers used them except in the form "throw()".  So "throw(...)"
    was deprecated in C++11 and has been valid until C++17 (with compilers
    implementations being free to accept it as a non-standard extension
    far beyond that).

    It should be painfully obvious that the right thing to do should've been
    to merge throw specifications into function signatures, allowing
    exception handling to be validated at compile-time, i.e. what Java did.

    That's wrong on many levels.

    First, what you think should be "obvious" now might not have been
    obvious at the time the relevant decisions were made - it's a lot easier
    to see problems with hindsight than to predict them in advance.

    Secondly, what /you/ think is "obvious" can differ greatly from what
    other people think is obvious. To /me/, it's obvious that dynamic
    exceptions are a bad idea in any compiled language suitable for systems programming. Exceptions that can pass through functions are "hidden
    gotos" - clearly worse even than explicit "gotos". Rather, it is
    "obvious" that the language should have had something akin to
    std::expected<> from the start, with syntactic sugar to reduce the
    boilerplate code to a minimal and compiler implementations using flag
    registers to get optimised code generation. That's /obvious/.

    Thirdly, you are again mistaking how Java supports exceptions.
    Unchecked exceptions in Java are not validated at compile time in any way.

    Fourthly, you appear to be completely ignorant about the tools available
    in the early days of C++. C++ had to work alongside existing linkers
    and related tools, which would not have been able to support such a
    system. Even with more modern tools, to get a good system of checked exceptions without having to add an enormous source code burden on the programmer, you would need some kind of compiled interface file tracking exactly which exceptions each function could throw and pass on.
    Otherwise if "foo" calls "bar" and passes on any exception thrown by
    "bar" up the chain to the caller of "foo", you'd need to change the
    declaration of "foo" every time the list of exceptions throwable by
    "bar" (or any function it calls) changes. That would be a nightmare in maintenance, and loses the whole point of exceptions.

    Fifthly, you appear to be completely ignorant of how C++ is intended to
    work beside code written in C - the exception mechanism in C++ is
    designed to be transparent to C functions. Without that, there would be
    no object code level compatibility.

    Instead of that we have the current state of affairs where the only half-assed solution is to have all exception classes derived from a superclass, i.e. std::exception, and then play musical chairs to catch exceptions.


    There is no such requirement in C++. For convenience, the exceptions
    thrown by standard library functions are all derived from
    std::exception, but you are free to throw whatever types you like.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to Paavo Helde on Fri Jan 3 10:50:51 2025
    Paavo Helde writes:

    It might be obvious to you, but not for everybody. What exact problem can be solved by validating thrown exception classes at compile time?

    Ummm… Making it logically impossible to throw an uncaught exception? The
    code will refuse to compile because it will be ill-formed. Getting rid of std::uncaught_exception(), completely?

    And how would a developer of a base class know which exceptions I might want to throw from an overridden virtual function in a derived class, which might be developed and compiled fully separately from the base class?

    The developer doesn't need to figure it out, the compiler will tell him.

    half-assed solution is to have all exception classes derived from a superclass, i.e. std::exception, and then play musical chairs to catch exceptions.

    My Java is rusty, but isn't it in Java that all exception classes must be derived from a single superclass (Throwable)?

    Not all exception classes, but all classes. But this has absolutely nothing
    to do, whatsoever, with validating that all exceptions will be caught by well-formed code.

    Here's a free clue. Define "function X throws exception Y" if it throws that exception (and it doesn't catch it itself), or if it calls function Z that's declared (in Z's throw specifier) as throwing that exception. The compiler
    has all the information needed to know which exception can be thrown out of that function.

    This is not C. This is C++. The compiler has the signature of every function called by code.

    Then:

    void throwing_function() throw(ExceptionClass)
    {
    }

    … this function is allowed to throw ExceptionClass or any derived class. If it throws something else, it is ill-formed, and will refuse to compile.

    void catching_function() // TBD
    {
    throwing_function();
    }

    One of the following must be true for the catching_function(). Either:

    1) The call to throwing function must be inside a try/catch that catches
    either ExceptionClass or any of its superclasses, which means that this exception gets caught and does not get propagated, and catching_function()
    can be declared noexcept. Or throw() for all that matters. Or, at some point
    in the bright future all functions without a throw specification will be treated as noexcept. Until then, something else will need to be done, but that's a separate discussion.

    Or:

    2) The catching function must be declared as throw(ExceptionClass), or as throwing any of its superclasses, thus propagating the exception, passing
    the hot potato to its callers.

    With this, your suffering C++ compiler can now tell you that your C0D3Z are ill-formed, unless your code is logically guaranteed to catch every thrown exception. std::uncaught_exception() is deprecated.

    The issue of overriding throwing_function() or catching_function() in a subclass is orthogonal, and can be resolved consistently with the same way analogous signature differences are resolved by C++'s current rules.

    This is how exceptions are handled in Java, more or less, and /that's/ how throw specifications should've been handled in C++ from the begining,
    instead of that mess.

    I'll go even as far as stating, that either:

    A) I'm missing something obvious, something fundamental to C++ that would've prevented this implementation.

    B) The original implementation of throw specifiers in C++ was written by
    (fill in your favorite perjorative here, mine is "morons").

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to David Brown on Fri Jan 3 11:56:58 2025
    David Brown writes:

    That's wrong on many levels.

    First, what you think should be "obvious" now might not have been obvious at the time the relevant decisions were made - it's a lot easier to see
    problems with hindsight than to predict them in advance.

    It was obvious to me at the turn of the century, when I returned to C++
    after spending a brief time hacking Java, looked at what C++ did with exceptions, and LOLed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Fri Jan 3 17:10:35 2025
    On Fri, 03 Jan 2025 11:53:11 -0500
    Sam <[email protected]> gabbled:
    A full throw specifier can also be validated for correctness, in the same >exact FUCKING way, at compile time. This would look like…

    You seem to be getting very worked up about it. I don't know about java but
    in C++ exceptions are just that - for exceptional circumstances. They're not supposed to be used as glorified return statements so should be rarely used anyway so frankly who gives a fuck about sigs?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to [email protected] on Fri Jan 3 12:14:00 2025
    [email protected] writes:

    On Fri, 03 Jan 2025 11:53:11 -0500
    Sam <[email protected]> gabbled:
    A full throw specifier can also be validated for correctness, in the same
    exact FUCKING way, at compile time. This would look like…

    You seem to be getting very worked up about it. I don't know about java but in C++ exceptions are just that - for exceptional circumstances. They're not supposed to be used as glorified return statements so should be rarely used anyway so frankly who gives a fuck about sigs?

    You convinced me. Let's just get rid of function signatures entirely. It's
    time to get to basics, the K&R way.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to [email protected] on Fri Jan 3 11:53:11 2025
    [email protected] writes:

    On Fri, 03 Jan 2025 10:50:51 -0500
    Sam <[email protected]> wibbled:
    Paavo Helde writes:
    Here's a free clue. Define "function X throws exception Y" if it throws that >exception (and it doesn't catch it itself), or if it calls function Z that's >declared (in Z's throw specifier) as throwing that exception. The compiler >has all the information needed to know which exception can be thrown out of >that function.

    This is not C. This is C++. The compiler has the signature of every function >called by code.

    It needs more than that when function pointers are involved. It cannot

    Do you happen to recall how a function pointer indicates that it's pointing
    to a noexcept function, by any chance?

    Newflash: this already exists in C++. But instead of noexcept you put down
    the throw specification, and it works the same way.

    necessarily know at compile time which function will be assigned to the pointer so how is it supposed to know if the exception sig is valid?

    The same way the compiler already prohibits you from assigning a pointer to
    a throwing function to a pointer to a noexcept function.

    Am I the only one around here who doesn't see this as rocket science?

    =========================================================================
    int (*noexcept_func)() noexcept;

    int (*except_func)();

    void foo()
    {
    except_func=noexcept_func; // OK
    noexcept_func=except_func; // Error
    }
    =========================================================================

    A full throw specifier can also be validated for correctness, in the same
    exact FUCKING way, at compile time. This would look like…

    =========================================================================
    int (*noexcept_func)() throw(ExceptionA);

    int (*except_func)() throw(ExceptionA, ExceptionB);

    void foo()
    {
    except_func=noexcept_func; // OK
    noexcept_func=except_func; // Error
    }
    =========================================================================

    Sheesh, dark magic, isn't it?

    (add a few more rules dealing how subclasses and superclasses are compared,
    in the throw specifier, for completeness)

    Unless
    you're suggesting also have an exception sig for function pointers which would
    probably break a whole load of code and make life difficult for zero gain.

    Not any more than existing code had to be rewritten when throw exceptions
    were removed leaving behind just noexcept.

    For all that talk about not breaking existing code, it sure got broken many times, in C++'s history. If someone with a brain actually does a Picard, and makes it so, backwards compatibility won't be much of a concern.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Sam on Fri Jan 3 18:17:21 2025
    On 03/01/2025 16:50, Sam wrote:

    I'll go even as far as stating, that either:

    A) I'm missing something obvious, something fundamental to C++ that
    would've prevented this implementation.

    B) The original implementation of throw specifiers in C++ was written by (fill in your favorite perjorative here, mine is "morons").


    The answer is obviously A.

    Be a little less obnoxious in your posts, and maybe someone will explain
    it to you (if you are unable to understand the posts I've already made).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to David Brown on Fri Jan 3 13:58:00 2025
    David Brown writes:

    On 03/01/2025 16:50, Sam wrote:

    I'll go even as far as stating, that either:

    A) I'm missing something obvious, something fundamental to C++ that would've >> prevented this implementation.

    B) The original implementation of throw specifiers in C++ was written by
    (fill in your favorite perjorative here, mine is "morons").


    The answer is obviously A.

    Maybe to a super-genius like yourself, but mere mortals may have some
    trouble figuring it out.

    Be a little less obnoxious in your posts, and maybe someone will explain it to you (if you are unable to understand the posts I've already made).

    Sir: this is Usenet, and not Facebook. Go down the hall, last door on your left.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Sam on Fri Jan 3 21:46:15 2025
    On 03.01.2025 17:50, Sam wrote:
    Paavo Helde writes:

    It might be obvious to you, but not for everybody. What exact problem
    can be solved by validating thrown exception classes at compile time?

    Ummm… Making it logically impossible to throw an uncaught exception? The code will refuse to compile because it will be ill-formed. Getting rid
    of std::uncaught_exception(), completely?

    I have never used std::uncaught_exception(). Well, I think I tried to
    use it once, 20 years ago, but it did not work in any useful way IIRC.

    Anyway, avoiding uncaught exceptions is easy, one just has to place
    catch(...) in main() and in all thread functions. Problem solved.

    Double exceptions appearing during stack unwind are more tricky. Here
    some compiler support enforcing noexcept would be nice indeed. But this
    would not need any more detailed exception specifications.

                                                                   And how
    would a developer of a base class know which exceptions I might want
    to throw from an overridden virtual function in a derived class, which
    might be developed and compiled fully separately from the base class?

    The developer doesn't need to figure it out, the compiler will tell him.

    You misunderstood my point. Yes, the compiler will refuse to compile my
    code because a new algorithm implementation throws a new kind of SocketException or whatever. So what next? The goal is to compile my
    code, not to get compiler errors.

    Now I have to change the signatures of the umpteen functions in the call
    stack in umpteen classes in umpteen projects to let the new required
    exception through (or translate it to something else via an even more questionable hack). The point is that those umpteen functions could not
    care less about what exceptions go through them as they will just pass
    them all through. So what's the point?

    At any frame in the call stack, if I want to catch a specific exception,
    I can do that. Everything else goes up to the top-level catch(...) and
    gets logged or converted to an error message as appropriate.

    Why should I arbitrarily restrict what exceptions I can throw in some
    function? Seems to me like arbitrarily deciding that some functions may
    not use switch() and some other functions may not use while(). Why?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to Paavo Helde on Fri Jan 3 21:06:35 2025
    Paavo Helde writes:

    On 03.01.2025 17:50, Sam wrote:
    Paavo Helde writes:

    It might be obvious to you, but not for everybody. What exact problem can be
    solved by validating thrown exception classes at compile time?

    Ummm… Making it logically impossible to throw an uncaught exception? The >> code will refuse to compile because it will be ill-formed. Getting rid of
    std::uncaught_exception(), completely?

    I have never used std::uncaught_exception().

    It's not typically used directly. Its primary user is your suffering C++ compiler, when it automatically injects a call to it in the code path for uncaught exceptions.

    Well, I think I tried to use it once, 20 years ago, but it did not work in any useful way IIRC.

    Anyway, avoiding uncaught exceptions is easy, one just has to place catch(...) in main() and in all thread functions. Problem solved.

    Sure, catch(...) deals with it. But it gives you nothing useful to work
    with. A valiant attempt to send a bat-signal to std::current_exception will
    eke out a few useful bits, if one's lucky, but the end result will just be
    more spaghetti code.

    If C++, the language, forced uncaught exception to be ill-formed then this
    will pretty much negate the need for a wildcard catch, solving that problem.
    I suppose that a wildcard catch can still be around, if someone needed it.
    But it'll be viewed as an indication of lack of core C++ knowledge and experience.

    Double exceptions appearing during stack unwind are more tricky. Here some compiler support enforcing noexcept would be nice indeed. But this would not need any more detailed exception specifications.

    I think that double exceptions would naturally be minimized, in my ideal C++ world. I think that exception-correctness would naturally eliminate them. Exception correctness enforces strict exception handling, making it more prominent.

    Think about it. Destructors would be a hard noexcept. C++ then forces you to write an explicit catch for any exceptions that get thrown from a
    destructor. Mission accomplished.

                                                                   And how would
    a developer of a base class know which exceptions I might want to throw from
    an overridden virtual function in a derived class, which might be developed >>> and compiled fully separately from the base class?

    The developer doesn't need to figure it out, the compiler will tell him.

    You misunderstood my point. Yes, the compiler will refuse to compile my code because a new algorithm implementation throws a new kind of SocketException or whatever. So what next?

    Fix the code, that's what's next.

    The goal is to compile my code, not to get compiler errors.

    The only way to achieve the lofty goal is to fix the compiler errors. So:
    fix them. This is no different than any other ABI break from a new library version.

    Now I have to change the signatures of the umpteen functions in the call stack in umpteen classes in umpteen projects to let the new required exception through (or translate it to something else via an even more questionable hack).

    This is the logically equivalent to a changed return type, a changed
    parameter, or a type of any other object that's used commonly in the code.

    I recall one time when I replaced a container that was used for important
    stuff in my code. A whole bunch of functions returned this container. The container used to be a std::list. It was now a std::vector. I don't remember exactly how many functions referenced it. Maybe 30-40, or so.

    Now, I'm going to tell you something that will blow you away. Prepare to be shocked. This revelation will rock your world. Make sure you're sitting
    down. Seal all exits. Cancel the three-ring circus. Secure all elephants in
    the zoo. Guess what?

    I did not have to monotonically go through and update the 30-40 function declarations.

    Are you still with us, my friend? You survived such a shocking reveleation? Good! Because, you see, C++ has this highly advanced, space-age tool that
    only a select few C++ gurus know about.

    It's called a "typedef". These days it's also known as a "using" declaration.

    All I had to do is change one typedef, and all those functions were now returning a vector. After changing

    typedef std::list<Widget> all_my_widgets;

    to

    typedef std::vector<Widget> all_my_widgets;

    Then all the existing code, referencing "all_my_widgets", or "all_my_widgets::iterator", or "all_my_widget_instance.begin()", and so
    on – guess what? It's still compiled! OMIGOSH!!!!

    I think I only needed to fix one or two things, that specifically
    depended on the actual underlying implementation. The rest of the code, that didn't care for the actual container, remained unchanged, and only had to be recompiled.

    So, in your case, your "umpteen functions" just need to be declared
    correctly. Here's what happened on Alternate Earth, where exceptions were actually implemented like that: the point you raised would've been
    identified as a pain point early on, and something analogous to "typedef",
    but for throw specifiers, was added to the language.

    I dunno, maybe something like:

    typedef throws(ClassA, ClassB) AlgoThrownClasses;

    Then you go ahead and declare your algorithm:

    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    I'm now married to the actual syntax or grammar, that's just the syntax that was used on Earth 2. Earth 3 used different syntax, and I don't recall what
    it is, so I'll just focus on Earth 2's implementation. The code you would write, on Earth 2, would use the alias:

    void my_function_that_uses_algorithmm() throws(AlgoThrownClasses)
    {
    algorithm_info_t info;

    my_algorithm(info);
    }

    Your Earth 2 doppelganger also threw its own exceptions:

    void my_function_that_uses_algorithm() throws(AlgoThrownClasses,MyError)

    All callers of my_function_that_uses_algorithm(), on Earth 2, used the same alias.

    * Pedantic note: your Earth 2 doppelganger will achieve greybeard status by using, instead, "typedef throws(AlgoThrownClasses, MyError) MyThrownClasses" and use that alias, instead.

    Now, my friend, guess what happened if the algorithm was updated on Earth 2
    to throw a different exception:

    typedef throws(ClassA, ClassB, ClassC) AlgoThrownClasses;

    You'll be shocked and awed to learn that all those "umpteen functions" will still compile just fine, on Earth 2.

    The only additional work was done wherever in your code, on Earth 2, you
    caught and handled the exceptions from the algorithms. And your suffering
    C++ compiler, on Earth 2, will tell you exactly where the code needs to be fixed, because it will now have an uncaught exception.

    I wish I could move to Earth 2. But, on Earth 2, Donald Trump just won his third term, and their border is already closed, and will be closed for the foreseeable future.

    Now, another thing just occured to me: what if the algorithm was changed and
    it no longer throws one of the exceptions on Earth 2, and the typedef alias
    was changed accordingly?

    Well, in the existing code this results in a catch for an exception that
    cannot possibly be thrown.

    On Earth 2 it's an informational compiler diagnostic.

    -Wall -Werror happily deals with it, on Earth 2.

    The point is that those umpteen functions could not care less about what exceptions go through them as they will just pass them all through. So what's the point?

    The point is that Earth 2 designed C++ properly, and on Earth 2 they learned how to use C++ properly.

    At any frame in the call stack, if I want to catch a specific exception, I can do that. Everything else goes up to the top-level catch(...) and gets logged or converted to an error message as appropriate.

    Why should I arbitrarily restrict what exceptions I can throw in some function?

    You can throw whatever you want, on Earth 2, you just have to declare what
    you throw, and force yourself to catch everything you throw, and your C++ compiler will force you to do the right thing. Resistance is futile. You
    will be caught.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sat Jan 4 10:13:52 2025
    On Fri, 03 Jan 2025 12:14:00 -0500
    Sam <[email protected]> gabbled:
    [email protected] writes:

    On Fri, 03 Jan 2025 11:53:11 -0500
    Sam <[email protected]> gabbled:
    A full throw specifier can also be validated for correctness, in the same >>> exact FUCKING way, at compile time. This would look like…

    You seem to be getting very worked up about it. I don't know about java but >> in C++ exceptions are just that - for exceptional circumstances. They're not >> supposed to be used as glorified return statements so should be rarely used >> anyway so frankly who gives a fuck about sigs?

    You convinced me. Let's just get rid of function signatures entirely. It's >time to get to basics, the K&R way.

    Parameter types are a *teensy* bit more important.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sat Jan 4 10:15:56 2025
    On Fri, 03 Jan 2025 11:19:53 -0800
    Keith Thompson <[email protected]> gabbled:
    [email protected] writes:
    On Thu, 02 Jan 2025 13:38:17 -0800
    Keith Thompson <[email protected]> wibbled:
    [...]
    I wouldn't have minded having new operators for I/O, but I'm not sure >>>what characters would have been used. Perhaps something involving
    "@"?

    It doesn't have to be pretty, so long as its unique.

    It doesn't have to be unique, as demonstrated by several decades of >experience with << and >>.

    Something being used for decades doesn't mean its any good or C++ would
    never have evolved from C with Classes.

    In my opinion, legibility and ease of typing are more important than >uniqueness. << and >> are easier to type and more visually suggestive
    than, say, @< and @>.

    Easier to type? You're seriously going with that as a reason? How hard
    exactly would <@ or <# be to type?

    Note that operators don't have to consist of punctuation symbols (see
    sizeof, new, etc.). An alternative might have been to introduce "in"
    and "out" operators in place of ">> and "<<". But I wouldn't suggest
    making such a change now.

    No one is suggesting making the change now. This is with hindsight.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sat Jan 4 10:17:26 2025
    On Fri, 03 Jan 2025 11:22:09 -0800
    Keith Thompson <[email protected]> gabbled:
    [email protected] writes:
    Don't be obtuse for the sake of arguing.

    You used the word "expect". I think you meant that you *want* it to
    behave in certain ways. You know the existing rules, and you strongly >dislike them.

    What I would expect in a language is for mathematical operators to have the same precendence with numeric types whether overloaded or not. This isn't the case with << and >>.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Sat Jan 4 12:31:33 2025
    On 04/01/2025 11:17, [email protected] wrote:
    On Fri, 03 Jan 2025 11:22:09 -0800
    Keith Thompson <[email protected]> gabbled:
    [email protected] writes:
    Don't be obtuse for the sake of arguing.

    You used the word "expect". I think you meant that you *want* it to
    behave in certain ways. You know the existing rules, and you strongly
    dislike them.

    What I would expect in a language is for mathematical operators to have the same precendence with numeric types whether overloaded or not. This isn't the case with << and >>.


    In C++, << and >> have the same precedence with all types - just like
    all the other operators. The precedences are built into the grammar of
    the language.

    Are you suggesting that C++ compilers should somehow have omniscient
    knowledge of user-defined types to know whether some class is a
    "numeric" type or some other kind of type which should have different precedences for different operators? Do you think that would lead to a language that is clearer and easier to learn?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sat Jan 4 11:34:44 2025
    On Sat, 4 Jan 2025 12:31:33 +0100
    David Brown <[email protected]> gabbled:
    On 04/01/2025 11:17, [email protected] wrote:
    On Fri, 03 Jan 2025 11:22:09 -0800
    Keith Thompson <[email protected]> gabbled:
    [email protected] writes:
    Don't be obtuse for the sake of arguing.

    You used the word "expect". I think you meant that you *want* it to
    behave in certain ways. You know the existing rules, and you strongly
    dislike them.

    What I would expect in a language is for mathematical operators to have the >> same precendence with numeric types whether overloaded or not. This isn't the

    case with << and >>.


    In C++, << and >> have the same precedence with all types - just like
    all the other operators. The precedences are built into the grammar of
    the language.

    Are you suggesting that C++ compilers should somehow have omniscient >knowledge of user-defined types to know whether some class is a
    "numeric" type or some other kind of type which should have different >precedences for different operators? Do you think that would lead to a >language that is clearer and easier to learn?

    I'm tired of your straw men. If you can't discuss what I'm talking about
    then maybe stay silent.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to Sam on Sat Jan 4 12:39:57 2025
    On 03/01/2025 19:58, Sam wrote:
    David Brown writes:

    On 03/01/2025 16:50, Sam wrote:

    I'll go even as far as stating, that either:

    A) I'm missing something obvious, something fundamental to C++ that
    would've prevented this implementation.

    B) The original implementation of throw specifiers in C++ was written
    by (fill in your favorite perjorative here, mine is "morons").


    The answer is obviously A.

    Maybe to a super-genius like yourself, but mere mortals may have some
    trouble figuring it out.


    Right. The super-geniuses - like Stroustrup and his colleagues -
    understood what they were doing. They understood that any language
    design decision is a compromise, and picked the balance that they
    believed worked best for the kind of language they were creating. Then
    40-odd years later some mere mortal comes along and says they were all
    morons.

    I don't need to be a super-genius to see that the answer is obviously A.

    Be a little less obnoxious in your posts, and maybe someone will
    explain it to you (if you are unable to understand the posts I've
    already made).

    Sir: this is Usenet, and not Facebook. Go down the hall, last door on
    your left.


    I can't stop you being obnoxious in your posts. But I /can/ tell you it greatly reduces your chances of getting helpful answers to your posts.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Brown@21:1/5 to [email protected] on Sat Jan 4 14:01:00 2025
    On 04/01/2025 12:34, [email protected] wrote:
    On Sat, 4 Jan 2025 12:31:33 +0100
    David Brown <[email protected]> gabbled:
    On 04/01/2025 11:17, [email protected] wrote:
    On Fri, 03 Jan 2025 11:22:09 -0800
    Keith Thompson <[email protected]> gabbled:
    [email protected] writes:
    Don't be obtuse for the sake of arguing.

    You used the word "expect".  I think you meant that you *want* it to
    behave in certain ways.  You know the existing rules, and you strongly >>>> dislike them.

    What I would expect in a language is for mathematical operators to
    have the
    same precendence with numeric types whether overloaded or not. This
    isn't the

    case with << and >>.


    In C++, << and >> have the same precedence with all types - just like
    all the other operators.  The precedences are built into the grammar
    of the language.

    Are you suggesting that C++ compilers should somehow have omniscient
    knowledge of user-defined types to know whether some class is a
    "numeric" type or some other kind of type which should have different
    precedences for different operators?  Do you think that would lead to
    a language that is clearer and easier to learn?

    I'm tired of your straw men. If you can't discuss what I'm talking about
    then maybe stay silent.


    Did you actually have any points other than "I want the code I write to
    work the way I want it to work, and sod the rest of the programming
    world" ? If that's not it, then what did you mean when you incorrectly
    claimed that the precedence of << and >> in C++ is inconsistent?

    (Note that I am quite happy to accept that you would have preferred a
    different operator here - that's personal preference, and I've no
    argument there.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to David Brown on Sat Jan 4 09:56:40 2025
    David Brown writes:

    On 03/01/2025 19:58, Sam wrote:
    David Brown writes:

    On 03/01/2025 16:50, Sam wrote:

    I'll go even as far as stating, that either:

    A) I'm missing something obvious, something fundamental to C++ that would've
    prevented this implementation.

    B) The original implementation of throw specifiers in C++ was written by >>>> (fill in your favorite perjorative here, mine is "morons").


    The answer is obviously A.

    Maybe to a super-genius like yourself, but mere mortals may have some
    trouble figuring it out.


    Right. The super-geniuses - like Stroustrup and his colleagues - understood what they were doing. They understood that any language design decision is
    a compromise, and picked the balance that they believed worked best for the kind of language they were creating. Then 40-odd years later some mere mortal comes along and says they were all morons.

    I don't need to be a super-genius to see that the answer is obviously A.

    In that case, we have a Scooby-Doo mystery on our hands. Despite this claim, not a single super-genius has ever been able to articulate any technical
    reason that prevents exception handling validation.

    Go ahead. Explain why a C++ compiler can handle noexcept-correctness, but
    will not be able to handle full exception signature/catching enforcement.

    You can't. No amount of bloviating will change that. You can prove me wrong simply by showing why it's not possible. You won't. All you'll do is claim
    that only super-geniuses understand why. Go ahead, there's the sandbox, with inflatable toys, for all the super-geniuses to play with. You can play there for the rest of the day.

    Be a little less obnoxious in your posts, and maybe someone will explain it >>> to you (if you are unable to understand the posts I've already made).

    Sir: this is Usenet, and not Facebook. Go down the hall, last door on your >> left.


    I can't stop you being obnoxious in your posts. But I /can/ tell you it greatly reduces your chances of getting helpful answers to your posts.

    How much does it cost, in electricity, that magical mind ray-beam machine of yours?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Sat Jan 4 15:49:04 2025
    On Sat, 4 Jan 2025 14:01:00 +0100
    David Brown <[email protected]> gabbled:
    On 04/01/2025 12:34, [email protected] wrote:
    On Sat, 4 Jan 2025 12:31:33 +0100
    David Brown <[email protected]> gabbled:
    On 04/01/2025 11:17, [email protected] wrote:
    On Fri, 03 Jan 2025 11:22:09 -0800
    Keith Thompson <[email protected]> gabbled:
    [email protected] writes:
    Don't be obtuse for the sake of arguing.

    You used the word "expect".  I think you meant that you *want* it to >>>>> behave in certain ways.  You know the existing rules, and you strongly >>>>> dislike them.

    What I would expect in a language is for mathematical operators to
    have the
    same precendence with numeric types whether overloaded or not. This
    isn't the

    case with << and >>.


    In C++, << and >> have the same precedence with all types - just like
    all the other operators.  The precedences are built into the grammar
    of the language.

    Are you suggesting that C++ compilers should somehow have omniscient
    knowledge of user-defined types to know whether some class is a
    "numeric" type or some other kind of type which should have different
    precedences for different operators?  Do you think that would lead to
    a language that is clearer and easier to learn?

    I'm tired of your straw men. If you can't discuss what I'm talking about
    then maybe stay silent.


    Did you actually have any points other than "I want the code I write to
    work the way I want it to work, and sod the rest of the programming
    world" ? If that's not it, then what did you mean when you incorrectly >claimed that the precedence of << and >> in C++ is inconsistent?

    Keep those straw men coming. I have better things to do that argue the toss
    any more.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Sam on Sat Jan 4 20:08:00 2025
    On 04.01.2025 04:06, Sam wrote:
    Paavo Helde writes:


    Anyway, avoiding uncaught exceptions is easy, one just has to place
    catch(...) in main() and in all thread functions. Problem solved.

    Sure, catch(...) deals with it. But it gives you nothing useful to work
    with. A valiant attempt to send a bat-signal to std::current_exception
    will eke out a few useful bits, if one's lucky, but the end result will
    just be more spaghetti code.

    If an exception has reached the top-level catch, then this means that
    all lower levels (which have more knowledge about the context) have not
    been able to catch and handle it. In the top-level catch there is little
    hope I could do anything smarter, typically I just need to report or log
    an error message.

    So there is no need to differentiate between different types of
    exceptions or to extract any useful bits from them, all I need is an
    error message. For that I have a little helper function which can be
    called from inside catch(...) and which handles various exception base
    classes and falls back to typeid(e).name() for unknown types. Actually I
    am not interested in exception types at all at this point, not to speak
    about enforcing them somehow. If there appear new exception base
    classes, I add support for them in the helper function, not trying to
    reduce their usage.

    [...]


    I dunno, maybe something like:

    typedef throws(ClassA, ClassB) AlgoThrownClasses;

    Then you go ahead and declare your algorithm:

    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    That's the first good idea from you in this discussion. I still do not
    see much point in exception specifications, but such a typedef would at
    least make life easier for me on this Alternate Earth.

    PS. Nowadays they prefer `using` instead of `typedef`.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to Paavo Helde on Sat Jan 4 14:46:20 2025
    Paavo Helde writes:

    On 04.01.2025 04:06, Sam wrote:
    Paavo Helde writes:


    Anyway, avoiding uncaught exceptions is easy, one just has to place
    catch(...) in main() and in all thread functions. Problem solved.

    Sure, catch(...) deals with it. But it gives you nothing useful to work
    with. A valiant attempt to send a bat-signal to std::current_exception will >> eke out a few useful bits, if one's lucky, but the end result will just be >> more spaghetti code.

    If an exception has reached the top-level catch, then this means that all lower levels (which have more knowledge about the context) have not been
    able to catch and handle it. In the top-level catch there is little hope I could do anything smarter, typically I just need to report or log an error message.

    So there is no need to differentiate between different types of exceptions
    or to extract any useful bits from them, all I need is an error message. For that I have a little helper function which can be called from inside catch(...) and which handles various exception base classes and falls back
    to typeid(e).name() for unknown types. Actually I am not interested in exception types at all at this point, not to speak about enforcing them somehow. If there appear new exception base classes, I add support for them in the helper function, not trying to reduce their usage.

    Certainly: many uses cases that involve exceptions are satisfied by having exception convey nothing more than a plain, textual, error message.

    Evolution of exception handling usually begins with this situation. Then, natural code evolution ropes in the need to actually discriminate and
    identify specific exception situations. The first instances of exception throwing discrete classes pop up. They multiply, and then, inevitably,
    arises a situation that involves a failure to implement a new exception
    class, because the current iteration of C++ fails to detect uncaught
    exceptions at compile time. And here we are.

    [...]


    I dunno, maybe something like:

    typedef throws(ClassA, ClassB) AlgoThrownClasses;

    Then you go ahead and declare your algorithm:

    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    That's the first good idea from you in this discussion. I still do not see much point in exception specifications, but such a typedef would at least make life easier for me on this Alternate Earth.

    PS. Nowadays they prefer `using` instead of `typedef`.

    So, after adding things up on the abacus, this becomes

    using AlgoThrownClasses = throws(ClassA, ClassB);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to David Brown on Sat Jan 4 21:40:13 2025
    On Mon, 30 Dec 2024 17:15:43 +0100
    David Brown <[email protected]> wrote:

    On 30/12/2024 12:25, Michael S wrote:
    On Sun, 29 Dec 2024 14:51:17 +0100
    David Brown <[email protected]> wrote:


    Comments after cursory view:

    C++20 introduces two promising language features - concepts and
    coroutines. Both were introduces without proper support in standard library. Absence of support in library in both cases was justified
    by probably correct claim that the best library constructs are
    still in research state, non-crystallized. The hope was that
    universal availability of this features at compiler level will help
    to best library constructs to mature.

    In case of coroutines developers were left with choice of 3 options:
    1. To write a lot of boiler-plate code each time they a going to use coroutines.
    2. To try to organize repetitive patterns in the library (likely
    template library) of their own and reuse it between parts of the
    programs and multiple projects. Hopefully, share with community.
    Hopefully, under liberal license.
    3. Don't use coroutines

    In case of concepts, the choice was even narrower:
    1. Use concepts when you occasionally are writing container-like or algorithm-like template of your own.
    2. Don't use concepts.

    Nobody was realistically expecting that grassroots developers will
    use concepts to develop comprehensive widely reusable library that duplicates functionality of STL, but brings advantage of sane error messages.


    So, where we are 3 years later?
    W.r.t. concepts, in the same unfortunate place.
    W.r.t. coroutines, library provides std::generator. I didn't look
    at it yet. Hopefully, it works. Hopefully it is easy to use. But it
    is just one of many possible uses of coroutines, and I would think
    that it is not the one that could be considered most common.


    Did I miss something?



    <snip>


    I have no experience with coroutines, so I can't really judge them.
    They do not appear to me to be a "thread alternative" - rather, they
    are trying to get the kind of lightweight asynchronous support that
    is increasingly popular in other languages (Python, Go, Javascript,
    etc.). Like C++ threading, locks and atomics, they don't really fit
    in the kind of system I work with.



    The version of coroutines that founded its way into C++ has its roots
    in C# (or may be in F#, but F# being primarily functional, is so
    different that it's hard to be sure). Actually, in C# they appeared
    first under not particularly illuminating name 'Iterators' (a.k.a. IEnumerable<T>) and later on as a part of Async/Await pattern. Python
    and Javascript (and Swift and Rust? I am not sure about it.) borrowed
    from C#. Go goroutines (that were very recently borrowed by Java under
    the name 'virtual threads') are quite different.

    Although it is true that main motivation of people that initiated
    inclusion of coroutines in C++ is implementation of of async/await and
    of "iterators" (in C++, following Python, I suppose, they are named 'generators') they certainly can be used for other things too.
    In particular, C++ coroutines can be utilized for implementing things
    that today tend to be written as state machines, in almost sequential
    coding style. In this role they look like a useful tool for "neither
    big nor tiny" sort of embedded software that, according to my
    understanding, happens to be the job that pays your bills.

    Originally, I wanted to give an example of bit-banging implementation
    of monitoring of pair of different I2C temperature sensors attached to independent buses, written as a couple of C++ coroutines called from
    one low-priority task of real-time executive. But then I reconsidered.
    It's to much work and unlikely to be read by many. Plus, I am rather
    bad writer.
    May be, later I'd give simpler examples of what I mean.
    Or, preferably, you and other readers figure it out by yourselves. The
    latter is better pedagogically. That is, except for myself.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Mon Jan 6 08:38:51 2025
    On Sat, 4 Jan 2025 20:08:00 +0200
    Paavo Helde <[email protected]> wibbled:
    On 04.01.2025 04:06, Sam wrote:
    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    That's the first good idea from you in this discussion. I still do not
    see much point in exception specifications, but such a typedef would at
    least make life easier for me on this Alternate Earth.

    PS. Nowadays they prefer `using` instead of `typedef`.

    I never understood the point of that. Why not increase the semantic scope
    of "typedef" instead of having 2 keywords that in a lot of circumstances
    do the same thing?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ahlstrom@21:1/5 to [email protected] on Tue Jan 7 08:40:47 2025
    [email protected] wrote this post while blinking in Morse code:

    On Sat, 4 Jan 2025 20:08:00 +0200
    Paavo Helde <[email protected]> wibbled:
    On 04.01.2025 04:06, Sam wrote:
    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    That's the first good idea from you in this discussion. I still do not
    see much point in exception specifications, but such a typedef would at >>least make life easier for me on this Alternate Earth.

    PS. Nowadays they prefer `using` instead of `typedef`.

    I never understood the point of that. Why not increase the semantic scope
    of "typedef" instead of having 2 keywords that in a lot of circumstances
    do the same thing?

    Because using is a nicer to read?

    --
    A new supply of round tuits has arrived and are available from Mary.
    Anyone who has been putting off work until they got a round tuit now
    has no excuse for further procrastination.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Tue Jan 7 14:04:34 2025
    On Tue, 7 Jan 2025 08:40:47 -0500
    Chris Ahlstrom <[email protected]> wibbled:
    [email protected] wrote this post while blinking in Morse code:

    On Sat, 4 Jan 2025 20:08:00 +0200
    Paavo Helde <[email protected]> wibbled:
    On 04.01.2025 04:06, Sam wrote:
    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    That's the first good idea from you in this discussion. I still do not >>>see much point in exception specifications, but such a typedef would at >>>least make life easier for me on this Alternate Earth.

    PS. Nowadays they prefer `using` instead of `typedef`.

    I never understood the point of that. Why not increase the semantic scope
    of "typedef" instead of having 2 keywords that in a lot of circumstances
    do the same thing?

    Because using is a nicer to read?

    Who knows. The C++ committee certainly has form on this - typename replaced class in template definitions when they realised 10 years after everyone else that reusing class in that particular case was somewhat confusing.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam@21:1/5 to Chris Ahlstrom on Tue Jan 7 21:32:34 2025
    Chris Ahlstrom writes:

    [email protected] wrote this post while blinking in Morse code:

    I never understood the point of that. Why not increase the semantic scope of "typedef" instead of having 2 keywords that in a lot of circumstances
    do the same thing?

    Because using is a nicer to read?

    I was wondering about that, too. I forget the exact keywords I used when searching for the answer, but I did read a convincing argument in favor of
    a using declaration.

    This was not the main argument, but there are some things that can be done
    with using that cannot be done with a typedef. For example, using a real-
    life example:

    template<typename basedon_t>
    using derivedvaluelist=ref<derivedvalueListObj<basedon_t>,
    derivedvalueListBase<basedon_t>>;

    There is no equivalent typedef declaration, for this.

    Given that, here's the main argument: if you originally start out with a
    using declaration, instead of a typedef:

    using derivedvaluelist=ref<derivedvalueListObj, derivedvalueListBase>;

    then, at some point later: going from that, to the template, looks more "logical" then replacing a typedef with something else, entirely.

    TLDR: the "left" and the "right" side component, of the alias declaration,
    is consistent, versus swapped.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Paavo Helde on Tue Jan 7 21:15:08 2025
    Paavo Helde <[email protected]> writes:

    On 02.01.2025 10:39, Tim Rentsch wrote:

    Paavo Helde <[email protected]> writes:

    [...]

    Half of the slowness of both in C printf() and C++ streams comes
    from the locale support, [...]

    I find this assertion very hard to believe (specifically, for
    printf(); I might guess that C++ streams have similar
    performance characteristics, but I don't have nearly as much
    experience with C++ streams as I do with printf()).

    Is there anything else you can say about it besides an
    unsupported assertion?

    Probably you were misled by my vague word usage. I said "half of the slowness", not "half of the total time". As "slowness" is nowhere
    exactly defined, this was just a figure of speech, no need to get
    overly upset about that.

    I'm not upset, just disappointed. I consider you one of the better contributors in the newsgroups, and so it's surprising to see a
    statement from you with zero information content.

    Anyway, I have profiled the writing of large CSV tables (multi-GB)
    which was deemed too slow. 90% of time was spent in sprintf() calls,
    from which 10% was spent in locale-related routines, presumably for
    checking that the global process locale has not changed during the
    last microsecond. Considering that our CSV file format had to always
    use the fixed C-locale format anyway, this locale checking was
    something which was absolutely unneeded.

    The 10% number is interesting, and disappointing. Surely the authors
    of the standard library implementation could have done better.
    Incidentally, I did a measurement of the cost of localeconv() on my
    test server (running Ubuntu), and that gave a result in line with
    your 10% number.

    We tried to parallelize the writing, expecting to increase the speed N
    times by using N threads, but alas, as the locale is a global
    thread-shared object, now the threads started to fight over it and the performance did not scale nowhere near to our expectations. (The thread-specific locales were not available an all needed platforms).

    Does the C standard (or the C++ standard) allow locale information to
    be thread-specific? I don't see anything in the C standard that looks
    like the <locale.h> functions can be anything but global. I haven't
    looked at what C++ allows.

    We resolved it finally by using std::to_chars() for integer data and
    Google's double-conversion library for floating-point data (our C++ implementations did not support std::to_chars() on floating-point data
    on all needed platforms at that time).

    It's disappointing that the C standard (and I assume also the C++
    standard) doesn't provide conversion functions that don't use global
    locale information. Oh, come to think of it, I think I saw some C++
    functions (in which C++ standard I don't know) that pass locale
    information in explicitly, which is probably what you were alluding
    to above.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Tim Rentsch on Wed Jan 8 08:44:05 2025
    On 08.01.2025 07:15, Tim Rentsch wrote:
    Paavo Helde <[email protected]> writes:

    On 02.01.2025 10:39, Tim Rentsch wrote:

    Paavo Helde <[email protected]> writes:

    [...]

    Half of the slowness of both in C printf() and C++ streams comes
    from the locale support, [...]

    I find this assertion very hard to believe (specifically, for
    printf(); I might guess that C++ streams have similar
    performance characteristics, but I don't have nearly as much
    experience with C++ streams as I do with printf()).

    Is there anything else you can say about it besides an
    unsupported assertion?

    Probably you were misled by my vague word usage. I said "half of the
    slowness", not "half of the total time". As "slowness" is nowhere
    exactly defined, this was just a figure of speech, no need to get
    overly upset about that.

    I'm not upset, just disappointed. I consider you one of the better contributors in the newsgroups, and so it's surprising to see a
    statement from you with zero information content.

    Anyway, I have profiled the writing of large CSV tables (multi-GB)
    which was deemed too slow. 90% of time was spent in sprintf() calls,
    from which 10% was spent in locale-related routines, presumably for
    checking that the global process locale has not changed during the
    last microsecond. Considering that our CSV file format had to always
    use the fixed C-locale format anyway, this locale checking was
    something which was absolutely unneeded.

    The 10% number is interesting, and disappointing. Surely the authors
    of the standard library implementation could have done better.
    Incidentally, I did a measurement of the cost of localeconv() on my
    test server (running Ubuntu), and that gave a result in line with
    your 10% number.

    We tried to parallelize the writing, expecting to increase the speed N
    times by using N threads, but alas, as the locale is a global
    thread-shared object, now the threads started to fight over it and the
    performance did not scale nowhere near to our expectations. (The
    thread-specific locales were not available an all needed platforms).

    Does the C standard (or the C++ standard) allow locale information to
    be thread-specific? I don't see anything in the C standard that looks
    like the <locale.h> functions can be anything but global. I haven't
    looked at what C++ allows.

    _configthreadlocale() is a MS extension.

    "https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/configthreadlocale"


    We resolved it finally by using std::to_chars() for integer data and
    Google's double-conversion library for floating-point data (our C++
    implementations did not support std::to_chars() on floating-point data
    on all needed platforms at that time).

    It's disappointing that the C standard (and I assume also the C++
    standard) doesn't provide conversion functions that don't use global
    locale information. Oh, come to think of it, I think I saw some C++ functions (in which C++ standard I don't know) that pass locale
    information in explicitly, which is probably what you were alluding
    to above.

    MSVC has _sprintf_l() which takes a locale explicitly, but this is again
    a non-standard extension.

    Regardless if the locale is passed in implicitly or explicitly, the
    function would still need to process it, which might take non-zero time.
    We were aiming to use functions which would not consider locales at all.

    C++ actually delivers that with std::to_chars() since C++17. I have not measured how fast it is nowadays, compared to Google's double-conversion.

    Fast *and* accurate printing of floating-point numbers is not a trivial
    task. AFAIK last significant advances in this area were done as late as
    in 2010. See e.g. "http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Paavo Helde on Wed Jan 8 11:44:50 2025
    On Wed, 8 Jan 2025 08:44:05 +0200
    Paavo Helde <[email protected]> wrote:


    Fast *and* accurate printing of floating-point numbers is not a
    trivial task. AFAIK last significant advances in this area were done
    as late as in 2010. See e.g. "http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/"


    I didn't read it, but I want to point that even the question of what is 'accurate' is not trivial when we consider conversion in
    non-default rounding modes. I am not sure that C++ standard contains
    sufficient information about it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Ahlstrom@21:1/5 to [email protected] on Wed Jan 8 14:52:31 2025
    [email protected] wrote this post while blinking in Morse code:

    On Tue, 7 Jan 2025 08:40:47 -0500
    Chris Ahlstrom <[email protected]> wibbled:
    [email protected] wrote this post while blinking in Morse code:

    On Sat, 4 Jan 2025 20:08:00 +0200
    Paavo Helde <[email protected]> wibbled:
    On 04.01.2025 04:06, Sam wrote:
    void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)

    That's the first good idea from you in this discussion. I still do not >>>>see much point in exception specifications, but such a typedef would at >>>>least make life easier for me on this Alternate Earth.

    PS. Nowadays they prefer `using` instead of `typedef`.

    I never understood the point of that. Why not increase the semantic scope >>> of "typedef" instead of having 2 keywords that in a lot of circumstances >>> do the same thing?

    Because using is a nicer to read?

    Who knows. The C++ committee certainly has form on this - typename replaced class in template definitions when they realised 10 years after everyone else that reusing class in that particular case was somewhat confusing.

    Stroustrup in section 23.2 of his 4th edition C++ book notes that
    these two are equivalent:

    template<typename X>
    template<class X>

    but that for typename X, X need not be a class.


    --
    Telling the truth to people who misunderstand you is generally promoting
    a falsehood, isn't it?
    -- A. Hope

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Michael S on Wed Jan 8 15:04:35 2025
    On 1/8/25 04:44, Michael S wrote:
    On Wed, 8 Jan 2025 08:44:05 +0200
    Paavo Helde <[email protected]> wrote:


    Fast *and* accurate printing of floating-point numbers is not a
    trivial task. AFAIK last significant advances in this area were done
    as late as in 2010. See e.g.
    "http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/"


    I didn't read it, but I want to point that even the question of what is 'accurate' is not trivial when we consider conversion in
    non-default rounding modes. I am not sure that C++ standard contains sufficient information about it.

    Printing of floating-point values in C++ traces to to_chars(), which is
    defined as converting the value to a string in accordance with the C
    rules for printf().

    The C standard says, for printf(), in the "Recommended practice"
    section, that
    "f the number of significant decimal digits is at most the maximum
    value M of the T_DECIMAL_DIG macros (defined in <float.h>), then the
    result should be correctly rounded.346) If the number of significant
    decimal digits is more than M but the source value is exactly
    representable with M digits, then the result should be an exact
    representation with trailing zeros. Otherwise, the source value is
    bounded by two adjacent decimal strings L < U, both having M significant digits; the value of the resultant decimal string D should satisfy L ≤ D
    ≤ U, with the extra stipulation that the error should have a correct
    sign for the current rounding direction." (7.23.6.1p13).

    Note, however, that this is only recommended practice, not a
    requirement. Here's what it says about the minimum requirements:

    "The accuracy of the floating-point operations (+, -, *, /) and of most
    of the library functions in <math.h> and <complex.h> that return
    floating-point results is implementation-defined, as is the accuracy of
    the conversion between floating-point internal representations and
    string representations performed by the library functions in <stdio.h>, <stdlib.h>, and <wchar.h>. The implementation may state that the
    accuracy is unknown." (5.2.4.2.2p14)

    "conversion between floating-point internal representations and string representations" is what you're talking about.

    Yes, that means that a fully conforming implementation of C++ may
    implement floating point subtraction with such poor precision that the expression LDBL_MAX-LDBL_MIN < LDBL_MIN - LDBL_MAX will evaluate to
    true, just so long as they document the fact that it is in fact that inaccurate.

    An implementation that pre#defines __STDC_IEC_60559_BFP__ is required to conform to ISO/IEC 60559 (equivalent to IEEE 754) requirements for the precision of such conversions, which are much stricter.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Thu Jan 9 08:39:56 2025
    On Wed, 8 Jan 2025 14:52:31 -0500
    Chris Ahlstrom <[email protected]> wibbled:
    [email protected] wrote this post while blinking in Morse code:
    Who knows. The C++ committee certainly has form on this - typename replaced >> class in template definitions when they realised 10 years after everyone else

    that reusing class in that particular case was somewhat confusing.

    Stroustrup in section 23.2 of his 4th edition C++ book notes that
    these two are equivalent:

    template<typename X>
    template<class X>

    but that for typename X, X need not be a class.

    Huh? X doesn't have to be a class in the 2nd example either.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Michael S on Tue Jan 14 08:49:09 2025
    Michael S <[email protected]> writes:

    On Wed, 8 Jan 2025 08:44:05 +0200
    Paavo Helde <[email protected]> wrote:

    Fast *and* accurate printing of floating-point numbers is not a
    trivial task. AFAIK last significant advances in this area were done
    as late as in 2010. See e.g.
    "http://www.serpentine.com/blog/2011/06/29/
    here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/"

    I didn't read it, but I want to point that even the question of what is 'accurate' is not trivial when we consider conversion in
    non-default rounding modes. I am not sure that C++ standard contains sufficient information about it.

    IIANM the default rounding mode (at least in C) is round to nearest,
    and even just that is not trivial.

    (For michael: I sent you an email about the start of 2025; no reply
    as yet.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Rentsch@21:1/5 to Paavo Helde on Tue Jan 14 09:12:31 2025
    Paavo Helde <[email protected]> writes:

    On 08.01.2025 07:15, Tim Rentsch wrote:

    Paavo Helde <[email protected]> writes:

    On 02.01.2025 10:39, Tim Rentsch wrote:

    Paavo Helde <[email protected]> writes:

    [...]

    Half of the slowness of both in C printf() and C++ streams comes
    from the locale support, [...]

    I find this assertion very hard to believe (specifically, for
    printf(); I might guess that C++ streams have similar
    performance characteristics, but I don't have nearly as much
    experience with C++ streams as I do with printf()).

    Is there anything else you can say about it besides an
    unsupported assertion?

    Probably you were misled by my vague word usage. I said "half of the
    slowness", not "half of the total time". As "slowness" is nowhere
    exactly defined, this was just a figure of speech, no need to get
    overly upset about that.

    I'm not upset, just disappointed. I consider you one of the better
    contributors in the newsgroups, and so it's surprising to see a
    statement from you with zero information content.

    Anyway, I have profiled the writing of large CSV tables (multi-GB)
    which was deemed too slow. 90% of time was spent in sprintf() calls,
    from which 10% was spent in locale-related routines, presumably for
    checking that the global process locale has not changed during the
    last microsecond. Considering that our CSV file format had to always
    use the fixed C-locale format anyway, this locale checking was
    something which was absolutely unneeded.

    The 10% number is interesting, and disappointing. Surely the authors
    of the standard library implementation could have done better.
    Incidentally, I did a measurement of the cost of localeconv() on my
    test server (running Ubuntu), and that gave a result in line with
    your 10% number.

    We tried to parallelize the writing, expecting to increase the speed N
    times by using N threads, but alas, as the locale is a global
    thread-shared object, now the threads started to fight over it and the
    performance did not scale nowhere near to our expectations. (The
    thread-specific locales were not available an all needed platforms).

    Does the C standard (or the C++ standard) allow locale information to
    be thread-specific? I don't see anything in the C standard that looks
    like the <locale.h> functions can be anything but global. I haven't
    looked at what C++ allows.

    _configthreadlocale() is a MS extension.

    "https://learn.microsoft.com/en-us/cpp/
    c-runtime-library/reference/configthreadlocale"

    We resolved it finally by using std::to_chars() for integer data and
    Google's double-conversion library for floating-point data (our C++
    implementations did not support std::to_chars() on floating-point data
    on all needed platforms at that time).

    It's disappointing that the C standard (and I assume also the C++
    standard) doesn't provide conversion functions that don't use global
    locale information. Oh, come to think of it, I think I saw some C++
    functions (in which C++ standard I don't know) that pass locale
    information in explicitly, which is probably what you were alluding
    to above.

    MSVC has _sprintf_l() which takes a locale explicitly, but this is
    again a non-standard extension.

    Regardless if the locale is passed in implicitly or explicitly, the
    function would still need to process it, which might take non-zero
    time.

    I'm pretty sure the amount of locale processing needed by *printf()
    functions is minimal, and most of the cost is the effort needed to
    put together the whole locale information structure, most of which
    is not used.

    We were aiming to use functions which would not consider locales
    at all.

    Understood. And there may be some other *printf() functionality
    that you don't need either. The *printf() functions are useful,
    but the full generality is quite a terror.

    C++ actually delivers that with std::to_chars() since C++17. I have
    not measured how fast it is nowadays, compared to Google's
    double-conversion.

    Fast *and* accurate printing of floating-point numbers is not a
    trivial task. AFAIK last significant advances in this area were done
    as late as in 2010. See
    e.g. "http://www.serpentine.com/blog/2011/06/29/
    here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/"

    Yes, I am well aware of the difficulties of formatting floating
    point output.

    Does your output need to be human readable, or is program readable
    good enough? If the consumers can deal with non-decimal formatting,
    you could use %a or %A, which is easier and faster to produce.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paavo Helde@21:1/5 to Tim Rentsch on Tue Jan 14 19:53:40 2025
    On 14.01.2025 19:12, Tim Rentsch wrote:


    Does your output need to be human readable, or is program readable
    good enough? If the consumers can deal with non-decimal formatting,
    you could use %a or %A, which is easier and faster to produce.

    As the files are sometimes gigabytes in size, for sure they are for programmatic access mostly. But this does not mean that a human might
    not want to take a first look at the data, or to study portions of it.

    About consumers, this would include various usage both in-house and at
    customer sites. To be honest I think the whole diaspora of consumers is
    not known to anybody. The most advanced common format which we were able
    to use is tab-separated ASCII text, misnamed as a .csv file (IIRC .tsv
    was not acceptable by some reason in some scenarios). The CSV/TSV format
    is over 40 years old.

    Anyway, I just tried to import 0x1.91eb86p+1 into Excel and it failed to recognize this as a number, so obviously the %a format would not fly.
    Maybe in another 40 years...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)