C++ 23 Language Standard Declared Feature-Complete (infoworld.com) 61
An anonymous reader shares this report from InfoWorld:
C++ 23, a planned upgrade to the popular programming language, is now feature-complete, with capabilities such as standard library module support. On the horizon is a subsequent release, dubbed C++ 26.
The ISO C++ Committee in early February completed technical work on the C++ 23 specification and is producing a final document for a draft approval ballot, said Herb Sutter, chair of the committee, in a blog post on February 13. The standard library module is expected to improve compilation.
Other features slated for C++ 23 include simplifying implicit move, fixing temporaries in range-for loops, multidimensional and static operator[], and Unicode improvements. Also featured is static constexpr in constexpr functions. The full list of features can be found at cppreference.com.
Many features of C++ 23 already have been implemented in major compilers and libraries, Sutter said. A planned C++ 26 release of the language, meanwhile, is slated to emphasize concurrency and parallelism.
The ISO C++ Committee in early February completed technical work on the C++ 23 specification and is producing a final document for a draft approval ballot, said Herb Sutter, chair of the committee, in a blog post on February 13. The standard library module is expected to improve compilation.
Other features slated for C++ 23 include simplifying implicit move, fixing temporaries in range-for loops, multidimensional and static operator[], and Unicode improvements. Also featured is static constexpr in constexpr functions. The full list of features can be found at cppreference.com.
Many features of C++ 23 already have been implemented in major compilers and libraries, Sutter said. A planned C++ 26 release of the language, meanwhile, is slated to emphasize concurrency and parallelism.
Cool. (Score:1)
Though I gave up on C++ quite a bit before "C++11". It got too windowsy and bloated for my taste, full of feeping creatures. C89 with inline and I'm pretty happy. Though I'll probably brush up and write C++ if anyone really wants to pay me for all that. Bit of a drag, though. It's a large language.
Upside: At least there is a formal standards process and numerous implementations. Unlike some other languages that really want to be popular so very bad. Downside: A few standard revisions too many.
Re: Cool. (Score:1)
it's like features are meant to satisfy the low level system implamentations like driver hook in for example, then reword to satisfy the userland side. That's iso compliance for you, then again every time the question of compliance to a standard comes up you can always just create another language.....
Re: (Score:3)
So you gave up on C++ before they started fixing its huge annoyances and adding in awesome features?
Don't get me wrong - I use Python for most simple projects. But when I need performance, I use C++, and it's much better than it used to be (even if still far from Python-level simplicity / full-featuredness).
Unicode was IMHO one of the big remaining weaknesses. Parallelism is the other - std::thread and lambda notation makes it really easy to launch threads, but the STL structures aren't threadsafe, and t
Meanwhile... (Score:2)
Re: Meanwhile... (Score:2)
Presumably you're talking about rust, a language I've been using for about two years. I personally have yet to encounter anything "woke" about it. Anybody who reads my posts at all should pretty well know what I think about woke.
Re: (Score:1)
there are other open source languages and OS going with fad agendas, trying to cancel words and phrases that have been in English for centuries for reasons of ignorant made up meanings that have nothing to do with origin).
Reminds me of the furor over a D.C. aide forced to resign (and then was rehired) because they used the word "renege" , which apparently the early 1999 woketards thought mean re-nibba in their addled woketard pile of loosely connected dozen skull neurons. I'm actually kind of interested w
Cross-field joke (Score:3, Funny)
"There's nothing faster than the speed of light"
"Oh yeah??.... C++!"
Re: (Score:2)
I thought the ++ meant 'lusterfuck'.
Re: (Score:2)
Horses for courses.
C is great for smaller embedded projects.
C# for line of business and gui apps.
C++ for complex apps that need speed and OOP, like data analysis, mapping etc.
Java no thanks, I don’t drink coffee.
Re: Standard C is just fine (Score:1)
That was C++ 1.0.
Re: Standard C is just fine (Score:2)
C# is OOP as well, though TBH I think OOP adds useless complexity. Particularly inheritance, and its evil cousin, abstract classes. Like goto and mutable global variables: just because its there, that doesn't mean it's a good idea to use it.
Re: (Score:2)
ok, grandpa. There are plenty of reasons to not like modern c++, but inheritance and virtual interfaces are a great, simple, lightweight abstraction paradigms
Re: Standard C is just fine (Score:2)
Actually I didn't even start programming until about 3 years ago. OOP was basically the first paradigm I started with. At first, I went along with it. But over time you realize just how badly it breaks interoperability.
Also I didn't say anything is wrong with interfaces. Not all interfaces happen through inheritance. If you endorse OOP, then you should already know this.
Though if anybody is the grandpa here, that's you. You probably have been relying on inheritance for so long that it's already permanently
Re: (Score:2)
pffffff. C folks use inheritance too, they just do it the kludgy way of having a base struct with a "type" member, so that you can cast the pointer to some extended form of the struct. You aren't scoring the nerd points you think you are by making your life harder.
Re: (Score:2)
ok, grandpa. There are plenty of reasons to not like modern c++, but inheritance and virtual interfaces are a great, simple, lightweight abstraction paradigms
I once got lost inside all of those inheritances, virtual inferaces and abstractions that it took the office support staff 2 weeks to find me inside the code. /s
Re: (Score:2)
> C++ for complex apps that need speed and OOP
You DO realize that OOP was implemented in assembly language for the game Roboton: 2048, right? [archive.org]
And that the first C++ compiler, cfront, translated C++ to C.
Data-Oriented Design replaced [slashdot.org] OOP for speed.
Re: (Score:2)
> C++ for complex apps that need speed and OOP
You DO realize that OOP was implemented in assembly language for the game Roboton: 2048, right? [archive.org]
And that the first C++ compiler, cfront, translated C++ to C.
Data-Oriented Design replaced [slashdot.org] OOP for speed.
I've done plenty of OOP in x86 assembly and in plain C. It's certainly doable.
But I can do it a lot faster and with less errors if I use C++. And a modern C++ compiler will generate faster code than you can get out of a C compiler. The extra information the C++ compiler has available to it enables a lot of optimizations that a C compiler can't even think about.
Re: Standard C is just fine (Score:2)
But I can do it a lot faster and with less errors if I use C++.
That sounds like an argument for rust.
And a modern C++ compiler will generate faster code than you can get out of a C compiler.
And that sounds dubious.
Re: (Score:2)
But I can do it a lot faster and with less errors if I use C++.
That sounds like an argument for rust.
Could be! But I'm primarily a game developer, and Rust isn't supported on most game platforms, so it's irrelevant to me.
And a modern C++ compiler will generate faster code than you can get out of a C compiler.
And that sounds dubious.
Look up the performance difference from things like C's search and sort function vs the STL versions. The extra type info available from templates plus inlining leads to huge gains.
Re: (Score:2)
No. I work on compilers and languages a bit. I am not aware of an "extra information" that enables a C++ to be optimized better. What should this be? Essentially templates and stuff get expanded in the C++ front end and then the optimizer is shared with the C front end.
Instead, I would say C++ has a bit of a problem with instruction bloat due to template expansion.
An advantage is that C++ have access to good data structures out of the box, in C you have to find good libraries to use and programmers
Re: (Score:2)
No. I work on compilers and languages a bit. I am not aware of an "extra information" that enables a C++ to be optimized better. What should this be? Essentially templates and stuff get expanded in the C++ front end and then the optimizer is shared with the C front end.
Templates generally get massively inlined and get optimized with full type information available. C libraries end up with more generic code and more function calls, lowering performance.
C's qsort() is drastically slower than C++'s std::sort() because the template code can be better optimized. Yes, you can write a custom sort function for each use case in C and it'll be just as fast as the C++ code, but it'll be a lot more work for a project of any scale.
You can do your own containers and what not too, but o
Re: (Score:2)
You do not need to write a custom function for each case in C. Compilers can inline the call through the function pointer or specialize arguments for certain arguments. This my not work for the sort function in the standard library, but it certainly works in others.
Template on the other hand force the creation of many different functions, which has a cost if you exceed the capacity of the instruction cache. You do not see this in microbenchmarks.
Re: (Score:2)
And a modern C++ compiler will generate faster code than you can get out of a C compiler.
I thought that would be true. I tried and failed to get clang to generate efficient vectorised code. It would certainly use AVX if I told it to target a cpu with those instructions, but even when I was trying my best to indicate that this loop here is simply operating on 2 same sized arrays of floats it mostly chose not to vectorise it. I even tried using vector types and yes, it would put them into AVX registers, but the code it was generating was bonkers. I used the intel instrinsics library and pretty mu
Re:Standard C is just fine (Score:5, Insightful)
Ah, was wondering when we'd hear from grumpy C programmers complaining about that new-fangled C++. Welcome!
Among C++ programmers, we generally bitch about how most of our problems com from C compatibility and it's terrible defaults.
Re: (Score:3)
Re: (Score:2)
Re: (Score:2)
If you're going to mention it, you may as well also provide a link for it too [github.com].
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Among C++ programmers, we generally bitch about how most of our problems com from C compatibility and it's terrible defaults.
Your problem. Us grumpy C programmers didn't ask anyone to make C++ backwards compatible.
Re: (Score:2)
Without C compatibility, C++ would be largely irrelevant.
Re: (Score:2)
True. It's a huge strength and a huge weakness, all at the same time. It gives us access to the massive amount of C libraries and C-based infrastructure out there... pretty much every major OS's native APIs, without necessarily having to use a non-native interface layer. It was also a huge advantage in bootstarting the language itself and it's subsequent popularity.
These days, it's popular enough to stand on its own, but the shared legacy does create problems of it's own as well. The design committee ta
Re: (Score:3)
While this is partially true, I do not think this is completely true. I also believe that C++ can stand on its own, and I agree it would better for the language if it would cut its ties with C. I don't think C++ is better than C (I switched to C a while ago to escape the complexity), but both languages have a different philosophy which is not really compatible.
But still, the C ecosystem is massive and C++ benefits from being close to it. If C++ were to move further away from C, I think it would also lose so
Re: (Score:2)
I don't know about you, but I love the automation of programming but I hate automating programming. Doing everything manually, by hand is much preferable to programming the compiler to do it for me.
Re: (Score:2)
Wow, writing all the programs in native binary for your application I see!
Re: (Score:2)
I mean that's basically what it's like programming in C. I was being sarcastic BTW.
Re: Standard C is just fine (Score:4, Insightful)
Can I still write (Score:1)
int x;...
printf("The answer is " + x);
?
C++ is not so much lipstick on a pig as an entire circus on a pig.
Re: Can I still write (Score:2)
Re: (Score:1)
The problem is not actually printf or string literals, but pointer arithmetic. Last I looked, there is no way to disable or warn about that archaic syntax.
char * foo = "42";
printf("Answer " + foo);
is OK.
Re: Can I still write (Score:2)
Re: (Score:2)
Re: (Score:1)
I would have no problem if 42 was not converted to a string.
But I do have a problem that simple code like this produces garbage, possibly a seg fault.
Re: (Score:2)
SPAM? (Score:5, Interesting)
The same story has been marked as SPAM in Slashdot submissions 18 days ago, two times.
February 16, SPAM ISO C++ Standards Committee completes work on C++23 [slashdot.org]
February 19, SPAM ISO C++ Standards Committee completed technical work on C++23 [slashdot.org]
Everyone involved, please return your nerd card. Many thanks to Editor David.
Re: (Score:2)
Cancel attempt (Score:2)
The same story has been marked as SPAM in Slashdot submissions 18 days ago, two times.
February 16, SPAM ISO C++ Standards Committee completes work on C++23 [slashdot.org]
February 19, SPAM ISO C++ Standards Committee completed technical work on C++23 [slashdot.org]
Everyone involved, please return your nerd card. Many thanks to Editor David.
This is most likely a cancellation attempt.
If a user submits several articles that are marked as SPAM, the slashdot system will automatically ban that user. Bad actors can use this to cause well-meaning users to be banned by simply marking all their submissions as SPAM.
Re: Cancel attempt (Score:2)
That's actually why I pretty much never create submissions.
"Upgrade"? (Score:2)
Looks pretty good (Score:5, Informative)
GCC has good support already:
https://gcc.gnu.org/projects/c... [gnu.org]
A huge number of the new "features" are consistency fixes which make the language more regular and obvious, those that standardise what compilers have been doing for ages, and those that bring it more in line with modern standards (unicode).
Re: (Score:2)
Re: (Score:2)
Yeah, some is lack of clarity. Anything labelled DR is a fuckup in the old standard. Others are where there are obvious, long standing extensions (#warning) which are finally codified. Others are removing language irregularities, often around constexpr. That was introduced in a very staged fashion in order to gain implementation experience, but the rules about what is an isn't runnable at compile time weren't obvious.
C++ has standards? (Score:1, Flamebait)
n/t
Re: (Score:2)
You are 25 years late with that joke..
import? (Score:3)
I like the notion of importing libraries directly. I really do. But the #include functionality is going to make new code a rat's nest of import(s) and #include(s), because you'll import libraries provided by the vendor, but #include the code written by your coworkers.
The subtle semantic differences between #including a header file which will also require compiling and linking its corresponding .cpp file is going to make C++ that much more difficult for novices is to learn. Someone coming from Python is going to wonder why C++ can't just import someone else's module the way Python can.
You and I, of course, understand why this difference exists, but to an outsider, this looks like C++ is either really stupid, or trying to play catch up to Python.
Re: (Score:2)
Someone coming from Python is going to wonder why
Or maybe we should just let Python be Python instead of trying to wedge Pythonisms into C++? That's how you get a Perl, already bad enough as the bastard child of awk and C, but it had to add redundant syntax that neither had, things like putting the if condition after the code it controlled, because Larry Wall loved to play with language variations.
Re: (Score:2)
instead of trying to wedge Pythonisms into C++?
I gave up that fight when lambdas were introduced. B-B-But Java has them! And while they're "neat" from a computer science perspective, they're absolutely awful from the perspective of the maintenance coder trying to fix a bug. Nameless functions are cool when you need to add a sort() to your class. They're absolutely awful when used to implement business logic, and you have no way of determining if the correct business rule is being applied because yo