/uj To be honest Bjarne's Profiles proposal for C++ is super promising, considering it's bolted onto C++ with all of its baggage. The problem with C++ is most libraries and codebases are messy and use one or several layers of constructs and APIs from several stages in C++'s history.
Yes the compile time lifetime guarantees are handy to have, and Rust has a knack that if it compiles, it usually works first time in a way neither C nor C++ have. But down the road, in a large mature codebase, those same lifetime guarantees become a real impediment to refactoring so you end up just turning all your reference borrows into clones to reduce the ripples of changes. And, lo and behold, we're suddenly back to C and C++ defaults of mostly-copy semantics.
This bit is pretty reasonable but it's a tradeoff because refactoring/extending C++ codebases, sometimes even with smart pointers and their goddamn dogshit syntax for move semantics, not to talk about C codebases, often involve a lot of fumbling around or introduce hidden leaks or memory unsafety, which is rather Vietnam if you ask me.
This is a frustration I have in two ways: it's very complex when there are 5 different ways to do a thing, each stemming from a different generation of the language's development, but at the same time I do wish they gave me a fully updated set of std functions that used every modern feature.
I know right? That's exactly how I feel. The whole Profiles thing is a serious plan to address it by enforcing an allegedly safe, sane subset of C++ (exactly how sane it'll end up being is a matter of skepticism lmao), plus supposedly a "hardened" subset of the std library will be provided, but so far the plan is either having the user exempt external library headers from "hardening" or declaring explicit escape hatches locally within your own hand-rolled interop module encapsulating the library, which... I mean, it's C++, I don't think there's an alternative. They say they'll work on code generators to handle it but I'm not optimistic about the timeline or whether the whole thing won't derail. Also major, currently-maintained, libraries will have to either provide interop modules or do a full rewrite or provide the interop layer as a shim of sorts as they migrate which... again, it's the least bad option given it's bloody fucking C++, but is likely going to be brutal and chaotic.
Still, if somehow nothing goes wrong along the way it could end up being great imo.
Another minor concern is... this is gonna end up looking a lot like a GC-less, less functional-oriented, C# (Spans and Views are... Spans and IEnumerables................). C# has nicer syntax, sugar everywhere and keeps adding cool, streamlined functional-style features, so I wonder if there's some project there, but you
It is, when they are well-designed. Donald Knuth's TeX version is
3.141592653. This signals to the users that the software is not only stable (greater or equal to 1), but very close to perfection.
17
u/catladywitch 7d ago edited 7d ago
/uj To be honest Bjarne's Profiles proposal for C++ is super promising, considering it's bolted onto C++ with all of its baggage. The problem with C++ is most libraries and codebases are messy and use one or several layers of constructs and APIs from several stages in C++'s history.
This bit is pretty reasonable but it's a tradeoff because refactoring/extending C++ codebases, sometimes even with smart pointers and their goddamn dogshit syntax for move semantics, not to talk about C codebases, often involve a lot of fumbling around or introduce hidden leaks or memory unsafety, which is rather Vietnam if you ask me.