"Herb Sutter: Why C++ Is Growing and What C++26 Means for Production Systems"
https://www.youtube.com/watch?v=Qvr9MTAU_y4
"At the London C++ meetup last month, I participated on a panel where
each panelist gave a short introductory presentation. My 7-minute intro
(aka rCLlightning talkrCY) just got posted rCo you can view it here. The one-sentence blurb: rCLC++ is accelerating, and C++26 is built for what developers need now.rCY"
A 7 minute talk.
Hat tip to:
http://herbsutter.com/2026/04/29/london-meetup/
Lynn McGuire wrote this screed in ALL-CAPS:
Hat tip to:
http://herbsutter.com/2026/04/29/london-meetup/
Heh, I only recently started using C++17 features.
Herb talks about C++20 issues with:
- Modules. (They don't work.)
- Coroutines. (They're not actually coroutines.)
- Concepts. (Cool, but most of you won't ever write one.)
Apparently GCC will be getting contracts and reflection "soon".
Lynn McGuire wrote this screed in ALL-CAPS: || |
Hat tip to: ||
http://herbsutter.com/2026/04/29/london-meetup/ |
Heh, I only recently started using C++17 features. |
|
Herb talks about C++20 issues with: |
|
- Modules. (They don't work.) |
- Coroutines. (They're not actually coroutines.) |
- Concepts. (Cool, but most of you won't ever write one.) || |
Apparently GCC will be getting contracts and reflection "soon". || |
GCC 12.2.0 accepts this code with -gnat2022. || | |True! Cool... In my opinion, contracts are among the coolest (and maybe| |more exclusive) features of Ada" | |-------------------------------------------------------------------------|
http://herbsutter.com/2026/04/29/london-meetup/
- Modules. (They don't work.)
- Coroutines. (They're not actually coroutines.)
They should have taken a look at how Python does it - the function
returns an iterator and you call "yield <result>" inside it. Done.
- Concepts. (Cool, but most of you won't ever write one.)
Apparently GCC will be getting contracts and reflection "soon".I can't wait for contracts and reflection in C++!
- Concepts. (Cool, but most of you won't ever write one.)
I haven't used them in C++, but in Haskell they're called "type classes"
and people write them all the time. They are important. Does Ada have something similar? In C++ it might be that writing them is done mostly
by library implementers. But then they help the users by decreasing the hellishness of templated classes.
boltar@caprica.universe writes:
They should have taken a look at how Python does it - the function
returns an iterator and you call "yield <result>" inside it. Done.
That's generators. Python coroutines are a mess because they were added
Contracts seem like a good thing. They're important in Ada after all.
bald-headed guys, almost like a Lisp conference. For better or worse,
Rust seems to have all the energy now.
boltar@caprica.universe writes:
http://herbsutter.com/2026/04/29/london-meetup/
Reflection, that I don't know about.
Paul Rubin <no.email@nospam.invalid> writes:
boltar@caprica.universe writes:
http://herbsutter.com/2026/04/29/london-meetup/
Reflection, that I don't know about.
It's compile time, so not as useful as the similar
Java feature (which offers run-time reflection).
With reflection, an application can obtain a list
of class member names, for example, along with
type information; or get the printable name
for an enumeration value (in debug or log messages,
for example).
Boltar@caprica.Universe wrote: |---------------------------------------------|Its a PITA because you have to have it correct before it compiles, as
|"You ever had to program in Ada? Its a PITA."| |---------------------------------------------|
I disagree.
(S. HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)
Its a PITA because you have to have it correct before it compiles, as opposed to C++ where you don't.
On 5/10/26 16:24, Niocl|is P||l Caile|in de Ghloucester wrote:
Boltar@caprica.Universe wrote:Its a PITA because you have to have it correct before it compiles, as >opposed to C++ where you don't.
|---------------------------------------------|
|"You ever had to program in Ada? Its a PITA."|
|---------------------------------------------|
I disagree.
(S. HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)
Its a PITA because its long winded like Java, has the god awful pascal
style syntax, and far too many basic operations throw exceptions instead
of simply returning success/failure values.
Its a PITA because its long winded like Java, has the god awful pascal
style syntax, and far too many basic operations throw exceptions instead
of simply returning success/failure values.
On 11/05/2026 09:22, boltar@caprica.universe wrote:
Its a PITA because its long winded like Java, has the god awful pascal
style syntax, and far too many basic operations throw exceptions instead
of simply returning success/failure values.
so, you're admitting that you've never seen Ada, Pascal has a horrible
syntax mainly because of it's semicolon as a separator mess. Semicolon's
end statements in Ada, also looks nothing like Pascal apart from begin >blocks, which aren't in block statements unlike Pascal.
Its a PITA because its long winded like Java,So Ada isn't optimal for code golf and obfuscation contests. Feel free
has the god awful pascal style syntax,You mean a syntax that doesn't let you write "if(x = 0)" bugs? A syntax
and far too many basic operations throw exceptions instead of simply returning success/failure values.Here's an example from last year of how returning success/failure
Its a PITA because its long winded like Java, has the god awful
pascal style syntax ...
Le 11/05/2026 |a 10:22, boltar@caprica.universe a |-crit :
Its a PITA because its long winded like Java, has the god awful
pascal style syntax, and far too many basic operations throw
exceptions instead of simply returning success/failure values.
Exceptions are much better for safety, since an exception cannot be
ignored, while it is too easy to forget to check a success/failure
return value.
"There is only one thing worse than a program that crashes: a
program that produces wrong, but apparently correct results"
Its a PITA because its long winded like Java,
So Ada isn't optimal for code golf and obfuscation contests. Feel free
to choose another language for those purposes.
Each line or fragment of source code is written once and read many
times. Thus clarity is more important than saving keystrokes. Typing
has the god awful pascal style syntax,
You mean a syntax that doesn't let you write "if(x =3D 0)" bugs? A syntax
that makes sense when read left-to-right, unlike C where the best way
to make sense of a declaration is to read it from the middle towards
both ends?
A syntax where instead of this:
}
}
}
}
you'll see this:
end if;
end loop;
end if;
end Foo;
If a closing brace is missing, a C/C++ compiler will spout lots of
misleading error messages, and then report the missing brace at the end
of the file =E2=80=93 or even at the end of another file. An Ada compiler c= >an
say "hey, an "end loop" is missing before this "end if" right here".
Yeah, how awful!
and far too many basic operations throw exceptions instead of simply retu= >rning success/failure values.
Here's an example from last year of how returning success/failure
values leads to bugs:
https://www.qualys.com/2025/02/18/openssh-mitm-dos.txt
Security researchers found several errors in the handling of error codes
in OpenSSH. One of them could be used to impersonate an SSH server. A
quote from their security advisory:
On Mon, 11 May 2026 08:22:55 -0000 (UTC), boltar wrote:
Its a PITA because its long winded like Java, has the god awful
pascal style syntax ...
Even C++ is now discovering why it can be preferable to have the
function return type specified after the arguments, rather than
before.
On Mon, 11 May 2026 16:16:04 +0200, J-P. Rosen wrote:
"There is only one thing worse than a program that crashes: a
program that produces wrong, but apparently correct results"
Worth also pointing out that Ada doesnrCOt require you to declare all
the exceptions a routine can return up front, unlike Java, where this
just adds to the clutter.
Also, Ada has typedefs, Java doesnrCOt. Ada has unsigned integers, Java >doesnrCOt. Ada had generics from the start, Java had to tack them on >afterwards, with some interesting consequences for backward
compatibiliy.
No, I never saw it while I was working on it, did everything blindfold.
syntax mainly because of it's semicolon as a separator mess.
Semicolon's end statements in Ada, also looks nothing like Pascal
apart from begin blocks, which aren't in block statements unlike Pascal.
The syntax is derived from pascal, stop pretending otherwise.
On 11/05/2026 16:08, boltar@caprica.universe wrote:
No, I never saw it while I was working on it, did everything blindfold.
So, you just came here to be an idiot troll, go back to your ancient and >insecure c then.
The syntax is derived from pascal, stop pretending otherwise.
Yes, it was ORIGINALLY, it was changed, so it barely resembles it now.
On Tue, 12 May 2026 15:21:07 +0100
"Luke A. Guest" <laguest@archeia.com> gabbled:
On 11/05/2026 16:08, boltar@caprica.universe wrote:
No, I never saw it while I was working on it, did everything blindfold.
So, you just came here to be an idiot troll, go back to your ancient
and insecure c then.
Do you understand sarcasm or are you just too far along the spectrum? And
I'm posting to a c++ group. Presumably some idiot x-posted.
The syntax is derived from pascal, stop pretending otherwise.
Yes, it was ORIGINALLY, it was changed, so it barely resembles it now.
Looks exactly like it to me.
Java generics are half arsed anyway making them utterly pointless.
Template types can only be types derived from Object - ie not basic
types such as int or char - meaning their bring nothing to the table
given all classes are derived from Object anyway. Java generics are
just syntactic sugar added to keep some loudmouths happy.
On Mon, 11 May 2026 22:33:09 -0000 (UTC), Lawrence DrCOOliveiro wrote:
On Mon, 11 May 2026 08:22:55 -0000 (UTC), boltar wrote:
Its a PITA because its long winded like Java, has the god awful
pascal style syntax ...
Even C++ is now discovering why it can be preferable to have the
function return type specified after the arguments, rather than
before.
Really? The ONLY reason for the -> operator being overloaded for
return values is because thats how it was decided to implement
lambda syntax back in 2011 for reasons best known to themselves.
On 12/05/2026 16:06, boltar@caprica.universe wrote:
On Tue, 12 May 2026 15:21:07 +0100
"Luke A. Guest" <laguest@archeia.com> gabbled:
On 11/05/2026 16:08, boltar@caprica.universe wrote:
No, I never saw it while I was working on it, did everything blindfold. >>>So, you just came here to be an idiot troll, go back to your ancient
and insecure c then.
Do you understand sarcasm or are you just too far along the spectrum? And
I'm posting to a c++ group. Presumably some idiot x-posted.
Have you not noticed you're also posting to the ada group?
On Tue, 12 May 2026 08:42:46 -0000 (UTC), boltar wrote:
Java generics are half arsed anyway making them utterly pointless.
Template types can only be types derived from Object - ie not basic
types such as int or char - meaning their bring nothing to the table
given all classes are derived from Object anyway. Java generics are
just syntactic sugar added to keep some loudmouths happy.
Java preserves the C++ distinction between rCLPODsrCY (I think it calls
them rCLprimitive typesrCY) and classes/structs. I think the limitations
you point to apply to C++ as well. And possibly even Ada.
There are languages where rCLevery value is an objectrCY. Python is
probably the most popular one right now -- and justifiably so.
On Tue, 12 May 2026 08:38:32 -0000 (UTC), boltar wrote:
On Mon, 11 May 2026 22:33:09 -0000 (UTC), Lawrence DrCOOliveiro wrote:
On Mon, 11 May 2026 08:22:55 -0000 (UTC), boltar wrote:
Its a PITA because its long winded like Java, has the god awful
pascal style syntax ...
Even C++ is now discovering why it can be preferable to have the
function return type specified after the arguments, rather than
before.
Really? The ONLY reason for the -> operator being overloaded for
return values is because thats how it was decided to implement
lambda syntax back in 2011 for reasons best known to themselves.
There is another reason: a result type that depends on the argument
types.
On Tue, 12 May 2026 20:38:59 -0000 (UTC)
Lawrence =?iso-8859-13?q?D=FFOliveiro?= <ldo@nz.invalid> gabbled:
On Tue, 12 May 2026 08:38:32 -0000 (UTC), boltar wrote:
On Mon, 11 May 2026 22:33:09 -0000 (UTC), Lawrence DrCOOliveiro wrote:
On Mon, 11 May 2026 08:22:55 -0000 (UTC), boltar wrote:
Its a PITA because its long winded like Java, has the god awful
pascal style syntax ...
Even C++ is now discovering why it can be preferable to have the
function return type specified after the arguments, rather than
before.
Really? The ONLY reason for the -> operator being overloaded for
return values is because thats how it was decided to implement
lambda syntax back in 2011 for reasons best known to themselves.
There is another reason: a result type that depends on the argument
types.
Huh? You can't change the result type once you've defined it. If you want
an auto return type you don't add "-> <type>" on the end.
On Tue, 12 May 2026 20:38:59 -0000 (UTC), Lawrence DrCOOliveiro wrote:
On Tue, 12 May 2026 08:38:32 -0000 (UTC), boltar wrote:
On Mon, 11 May 2026 22:33:09 -0000 (UTC), Lawrence DrCOOliveiro wrote:
On Mon, 11 May 2026 08:22:55 -0000 (UTC), boltar wrote:
Its a PITA because its long winded like Java, has the god awful
pascal style syntax ...
Even C++ is now discovering why it can be preferable to have the
function return type specified after the arguments, rather than
before.
Really? The ONLY reason for the -> operator being overloaded for
return values is because thats how it was decided to implement
lambda syntax back in 2011 for reasons best known to themselves.
There is another reason: a result type that depends on the argument
types.
Huh? You can't change the result type once you've defined it. If you
want an auto return type you don't add "-> <type>" on the end.
On 13/05/2026 09:55, boltar@caprica.universe wrote:
template<typename T1, typename T2>
X add(T1 a, T2 b)
{
return a + b;
}
What type should X be? It depends on the types of "a" and "b" (which
might be class types here). So you can write:
template<typename T1, typename T2>
auto add(T1 a, T2 b) -> decltype(a + b)
{
return a + b;
}
You might also use it for complicated types, such as returning a
function pointer, where it is clearer:
int (*get_function_pointer(int x))(int);
auto get_func_pointer(int x) -> int(*)(int);
On Wed, 13 May 2026 10:17:32 +0200
David Brown <david.brown@hesbynett.no> gabbled:
On 13/05/2026 09:55, boltar@caprica.universe wrote:
template<typename T1, typename T2>
X add(T1 a, T2 b)
{
-a-a-a-areturn a + b;
}
What type should X be?-a It depends on the types of "a" and "b" (which
might be class types here).-a So you can write:
template<typename T1, typename T2>
auto add(T1 a, T2 b) -> decltype(a + b)
{
-a-a-a-areturn a + b;
}
A sane syntax would have been
template<typename T1, typename T2>
(T1 + T2) add(T1 a, T2 b)
{
:
}
But this is C++ so not a chance, lets make it as verbose as possible.
You might also use it for complicated types, such as returning a
function pointer, where it is clearer:
int (*get_function_pointer(int x))(int);
auto get_func_pointer(int x) -> int(*)(int);
I'll give you that, but the C function pointer syntax was unnecessarily
messy and there's no reason C++ couldn't have tidied it up even before std::function came along. Something like:
int (*(int))get_func_pointer(x)
{
:
}
I don't think anyone sees the C or C++ type syntaxes as being the nicest >conceivable for a programming language. But the languages are what they >are, stretching back to a time when the syntax choices were made as good >design decisions. Modern C++ cannot start from scratch - new features
have to fit with the existing language, existing tools, existing >programmers, and existing code. Sometimes things can be "tidied up" a
bit - that's exactly the case for trailing return types. (It might have >been nicer if a new keyword - say, "func" - had been introduced to mean >exactly the same as "auto" but only available for function declarations.
But new keywords are not free in an established language.)
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 08:06:33 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
1 files (1,366K bytes) |
| Messages: | 264,936 |