[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


🎉 Happy Birthday 4chan! 🎉


[Advertise on 4chan]


File: cpp.png (110 KB, 1822x2051)
110 KB
110 KB PNG
This thread is for discussing language evolution of C++, including ISO C++ topics.

>WG21 2025-10 pre-Kona mailing
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/#mailing2025-10
>>
C++13 is the best version
>>
Why is this paper included for 2025-10?
>P3874R0
>Safety Strategy Requirements for C++

The date in the document is
>Date: 2024-10-06

Slop, lack of safety regarding document quality, or something else?
>>
What are your predictions about contracts in C++26? Aye or nay? What will the national bodies do?

I don't personally know enough about them to have an opinion.
>>
>>106815624
C++ can't evolve, it must be sacrificed for the sake of humanity.
>>
>>106815864
Profiles might unironically make a large difference. Even just the most barebones banning profile would do a lot of good. Removing footguns, having to worry less about and remember fewer gotchas, for basically free.
>>
>>106815728
currently, they look like asserts with extra steps. they don't resemble ada spark contracts, or require you to use coq-like syntax to enforce them.

but they're a move in a good directions as it may help static-analysis framework perform better and more in-depth analysis of your code
>>
>>106815864
Rust developers are complaining that C++ has variadic generics and that Rust doesn't have them.

What other languages have variadic generics other than C++? D, Swift, Typescript?
>>
File: 1759831119541644.png (381 KB, 476x795)
381 KB
381 KB PNG
>>106815624
C# + AOT is the best C++
/thread
>>
>>106816339
C# is up to an order of magnitude slower than C++ doing fucking vector math. C# is a meme lang.
>>
>>106816339
>>106816397
C# is a fine language in some ways. .NET is partially implemented in C++.
>>
>>106816397
>lack of knowledge
https://devblogs.microsoft.com/dotnet/dotnet-8-hardware-intrinsics/
>>
>>106816339
I don't trust in Microsoft compilers, they are very far behind clang and gcc.
>>
File: clang-gcc-broken.png (266 KB, 1336x2968)
266 KB
266 KB PNG
>>106816985
>I don't trust in Microsoft compilers, they are very far behind clang and gcc.
if by very far behind, you mean they don't randomly delete your code and break it, then sure
>>
>>106817418
Integer overflow is UB, moron.
>>
>>106815624
explain why would you care about c++ changes
just code
>>
>>106817494
muh print
>>
>>106817418
Don't have UB in your code. Simple as.
>>
>>106817494
you llm will use these new features eventually, so you have to know them
>>
File: 1692145634477723.jpg (26 KB, 640x426)
26 KB
26 KB JPG
>>106817418
>C# babbies get filtered by undefined behavior
to the surprise of no one, I might add
>>
>>106817494
Please explain why one wouldn't be curious, the topic can be really interesting.
>>
>>106815624
c++ needs less, not more
>>
>>106817775
Is it really that hard to deprecate old, obsolete, and duplicated features and remove them a few years later maybe by opt-in at first?
>>
>>106816117
I have been programming for a long time now. I have been using C++ for about 10 years. I do not like this language, I hate it. But you know what? At no point in time have I hated the footguns. They're not even remotely close to what's wrong with this shitheap of a language. If you can't manage with footguns, what hope do you have for managing systemic complexity which is 1000x worse?
>>
>>106817775
>>106817787
Sounds like you might like a profile that bans usage of bad or old features.
>>
>>106817805
A lot of people dislike the footguns in C++. They only use a subset to better manage the language.

Please elucidate more on what you then dislike, perhaps also with a few suggestions on what you think could be done.
>>
>>106817831
I might. Do you know of any?
>>
File: file.jpg (1.84 MB, 933x3983)
1.84 MB
1.84 MB JPG
>>
>>106817883
No, but adding one should be simple. Should I make a proposal? Or would you like to? I think it could be done easily, even without a profile framework. Just make it work without any changes to any runtime behavior, no effect on translation units. And then have one for each C++ version.
>>
>>106817869
Throwing the language in the garbage because it's not worth saving. It hasn't been since CFront 3. The moment Bjarne tacked a second type system onto the fucking thing it was over.

>A lot of people dislike the footguns in C++
I see a lot of people do shit like use UUIDs for a small collection, and store them in std::strings. I see a lot of people using floats for version numbers. I see a lot of people using std::map<int, some_type_t> even though it only stores values from [0,N) with no gaps. I have seen a lot of people write completely trash code as a lifestyle. I don't care what "a lot of people" think or do. I have seen people who can manage footguns but not systemic complexity, and never the other way around. "A lot of people" have no business being programmers.
>>
>>106818130
Troll answer, you didn't actually answer. Did you use an LLM?
>>
>>106818200
You simply didn't like the answer. Your lesson for today is to be more honest with yourself.
>>
>>106818216
Another troll answer, since I am perfectly honest and also right about you and your posts. And you should stop trolling and coming with inanity.
>>
>>106818323
There is nothing that can be done to save the language that doesn't involve throwing the entire language in the garbage. Your answer is in the first sentence of my post, here it is again as the first sentence of this post. But you don't like that answer, which is why you're pretending that I'm engaging you in bad faith. You're not honest with yourself because you can't acknowledge that. You're descending further into self-delusion with your denial that you are indeed honest with yourself, despite the unambiguous evidence to the contrary.

Namaste.
>>
>>106815624
The only way forward is to start dropping backward support, they need to do that for a couple of versions at least. C++ is way too big and having thirty ways to do the same thing does not help when objectively only one of those ways is the most performant one
>>
>>106818376
Wrong yet again, you didn't elucidate on what you disliked about it. And then you spam all kinds of inanities that I can't be bothered to read, but it sounds like an admission. Seek professional help from a therapist, and cease lysing, troll.

Are you a rustacean, like the pedophile rustacean Jeremy Bicha?
>>
>>106818803
Wouldn't a profile to ban deprecated features help with that?
>>
>>106815624
C++ is nice ive been giving it a try to take a break from Rust but I find theres too much boilerplate and the code just looks ugly.
Also do I really need pointers when I can just do std::optional and std::expected and just pass references ? Obviously for embedded yeah but otherwise ?
>>
>>106819489
>Also do I really need pointers when I can just do std::optional and std::expected and just pass references ?
So this is how Rustfags see programming in C++. No wonder you need the compiler to hold your hand.
>>
>>106819489
>>106819535
Monologue?

Rustacean trolls really need to see therapists.
>>
>>106819535
>>106819563
r*st falseflagging is out of control
>>
>>106819840
>>106819894
>Meds and bbc now
Indeed, you should take your medication, and cease your trolling.
>>
>>106815624
C++ is an okay language, I suppose, but let's be real, it pales in comparison to Lisp. The constant churn of new features and deprecations in C++ is a mess, and the language is too heavy and verbose. It's a relic of the early days of computing when efficiency was paramount over elegance and expressiveness.

But hey, if you want to keep tinkering with C++'s quirks and gotchas, go ahead. Meanwhile, I'll be over here enjoying the simplicity, power, and beauty of Lisp. Macros, anyone? Or perhaps you'd like to discuss the intricacies of Lisp's garbage collection vs C++'s manual memory management?

Remember, once you experience the joy of Lisp, there's no going back to those primitive compiled languages. So why bother with C++ or any other inferior language when you could be mastering the pinnacle of programming? Learn Lisp, and your coding life will never be the same!
>>
>>106818803
The committee has made it abundantly clear that backwards compatibility is their top priority, the language is going to fossilize. Nobody with a mature codebase will willingly upgrade to use C++26. A lot of people aren't even moving past C++17 because C++20 was such a clusterfuck. If you're writing desktop or server software, there's not much good reason to use C++. For embedded, if you're using C++ it's almost certainly before C++20, and without exceptions. Like Fortran, C++'s only relevant niche will be HPC.
>>
>>106819995
>C++ is an okay language, I suppose, but let's be real, it pales in comparison to Lisp.
Didn't read beyond this line, C++ and Lisp typically have radically different use cases.
>>
>>106820010
It's stupid that the committee is letting the language die when the solution would be relatively simple.
>>
>>106820037
The committee is stuffed with people who have a vested interest in maintaining backwards compatibility. It would cost them a lot of money to reproduce the functionality of the libraries to which they've lost the source code - not to mention matching bug-for-bug compat with those libraries because of the ubiquitous UB in C++.
>>
>>106820010
A lot of lies in your post, a few halftruths or truths. A lot of system software and software that needs reliable and high performance still use C++ a lot, for instance desktop applications and game engines. Firefox, and probably most other browsers, are still mostly written in C++, their official statistics regarding Rust usage are generally very misleading due to third-party vendoring. Git clone the Firefox codebase, run cloc, save the results, and then remove third_party for Rust and run cloc again. The difference is stark. Ladybird is continuing in C++, and there are claims that Ladybird, a much younger project than Servo, has way better compliance with web standards IIRC (not that I know much about that).
>>
>>106820010
>>106820037
C++ is still evolving, it is getting reflection in C++26. A possibly similar feature was ceased being worked upon due to internal Rust drama.
https://thephd.dev/i-am-no-longer-speaking-at-rustconf-2023
https://soasis.org/posts/a-mirror-for-rust-a-plan-for-generic-compile-time-introspection-in-rust/

And I still suspect profiles in C++ could work, just something simple to ban deprecated features.
>>
>>106815624
>C++
>evolution
>>
>>106820238
>>106820095
>>
>>106820095

Reflection sounds interesting to me, but I need to see it in action before I can pass judgement. If nothing else, to get what magic enums provides out of the box is almost enticing enough for me to consider it. Profiles have been proposed for over a decade now with nothing to show for it. In my eye they are nothing more than attempt to assuage regulators that C++ can be safe. Never mind that the regulators are ignorant, they only need power and motive.
>>
retarded fucking language
use Rust
>>
>>106820869
This but unironically
>>
>>106815624
What are the best books, or other sources, for learning C++ right now? I've hear learncpp is alright and was wondering about any others.
>>
>>106821034
There are Discord servers and subreddits where you can ask that, though beware rustling moderators.
There are also mailing lists that I think you could ask.
https://en.cppreference.com/w/ is great, but it might be shutting down. Rumor has it that rustlings have been harassing the owner, as rustlings have done all over the place, but I don't know the veracity of that rumor.
Bjarne Stroustrup wrote some books, I don't think they are up to date though, and which books depends are suitable depends on your background, like if you are new to programming or not, know C or not, etc.
>>
>>106820858
Would anything be able to stop dead-simple profiles from being adopted? Like, only allow one single profile, that never changes code generation or behavior, and has a single purpose, namely to only bans deprecated or obsolote features?
>>
File: rust.png (114 KB, 627x722)
114 KB
114 KB PNG
>>106820869
>>106820987
https://materialize.com/blog/rust-concurrency-bug-unbounded-channels/
https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF
https://bpb-us-e1.wpmucdn.com/sites.gatech.edu/dist/a/2878/files/2022/10/OSSI-Final-Report-3.pdf
https://archive.ph/uLiWX
https://archive.ph/rESxe
https://lkml.org/lkml/2025/2/6/1292
https://github.com/microsoft/typescript-go/discussions/411#discussioncomment-12464988
https://lwn.net/Articles/1030517/
https://github.com/lcnr/solver-woes/issues
>>
>>106821597
tldr?
>>
File: rust2.png (296 KB, 1080x1080)
296 KB
296 KB PNG
>>
>>106820869
you know what we call rust users round here?
failures
>>
File: rust3.jpg (220 KB, 989x630)
220 KB
220 KB JPG
>>
File: rust4.jpg (400 KB, 993x1094)
400 KB
400 KB JPG
>>106821621
I differentiate between Rust users and rustlings. Rust users are average, just trying to deal with Rust, and also enjoying pattern matching. Rustlings, conversely, not fine at all.
>>
>>106821613
The bottom one looks like more fun.
>>
>>106821704
some of the most efficient ways to implement double linked lists use no links at all.
you can represent the data inside an array, then use another array to represent 'diffs' (added and removed elements), then when the diff grows large, you squash it with the underlying array.

if you follow this pattern, you get amortized O(1) random insertions/deletions.
at the benefit of O(1) random access, compared to the traditional O(n) for (doubly)-linked lists. with the added benefit of more data-locality.
>>
>>106821532
Is the C++ Crash Course book worthwhile? Or should somebody just use read Bjarnes book?
>>
>>106815624
It should become more like Rust
>>
>>106821645
>Rust users are average, just trying to deal with Rust, and also enjoying pattern matching.
nobody like that exists



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.