5 ms·
With every mailing list, trip report, CppCon presentation, etc, C++ gives the impression of being simultaneously far too simple and far too complex. IMO, the la
by SubjectToChange 3y ago
With every mailing list, trip report, CppCon presentation, etc, C++ gives the impression of being simultaneously far too simple and far too complex. IMO, the language does suffer from the lack of any coherent vision. That said, I’m interested in how far the language can go before implementations start giving up. Furthermore, it would be interesting to see how much tooling could help to simplify the language.
- fooker 3y agoThere is a reason you get this impression. C++, the unparalleled language for writing fast libraries, is a complex beast. C++, the sort of decent language with footguns for using said libraries, is getting more and more simpler over the years.
- titzer 3y agoC++ should be put out to pasture along with asbestos and lead paint. It's unsafe at any speed and should be discouraged in favor of memory-safe alternatives. Evolving the language is a desperate attempt to stay relevant when it should not, in fact, stay relevant.
- mike_hock 3y agoAs should C. C++ is staying relevant (among other reasons) because it embeds C as a(n almost) subset in a natural way. To understand why C++ is remaining relevant, one must understand why C is remaining relevant. It has little to do with the language itself. As long as the creators of other languages, including so-called C "successor" languages, keep giving zero shits about language interoperability and prefer to play in their little sandboxes that they've created for themselves instead of collaborating on creating a language-agnostic ABI, the C ABI will remain the ABI Franca, so C will stay relevant. As long as C (and C++) are the only languages that you can compile and link the way you see fit as opposed to caving in to some my-way-or-the-highway language-specific "fully integrated" dependency manager and build system, C will stay relevant. As long as this lack of vision, this pathological shortsightedness, and this complete disinterest in taking any steps whatsoever to unseat C from its privileged niche and create an ecosystem in which "successor" languages can compete with C on a level playing field continues to dominate the entire industry and every single "language" community in existence, C will stay relevant.
- titzer 3y agoHeh, give snark, get snark. Virgil doesn't interoperate with C because ABI is a sticky, ugly, thorny thing. However, I've come to realize that several projects that want to use Wizard, a thing I wrote in Virgil, could do so if Virgil would link with C code. Problem is, all of that stuff at the C ABI layer is a quagmire. I think pretty much all languages are hoping that that native ABI cesspool just disappears. I don't have a solution to that problem, but I know the solution isn't to keep on truckin' with uninitialized data, out-of-bounds-memory accesses, stack overflows, and undefined behavior. Surely we can do better.
- mike_hock 3y agoThe solution isn't to keep on trucking with the interoperability situation either, but you gotta fix that first. Or don't and keep on trucking with UB. Your choice. Y'all's choice.
- titzer 3y agoObviously I don't control the PL landscape's decision-making for what level of abstraction they want their compilers to target; that's why I helped create Wasm to put all of that mess into a sandbox so we can move on with a brighter future :)
- pjmlp 3y agoWhile C++ is undoubtedly complex, keeping up with Python, Java or .NET world, in terms of language features, runtime changes, standard library, alternative implementations and key libraries on the ecosystem is not much easier. Nowadays I get the feeling to need some kind of memory dump reload everytime I switch projects.
- SubjectToChange 3y agoWell, yes and no. I don’t mean to single out C++, I actually do appreciate the language, but it is far more difficult to evolve than most languages. For instance, languages like Java/.NET/Python/etc have a far more “defined” place in the world of software, and they can optimize their languages around their niche. With C++ you have businesses that don’t really care about performance, but they have 50+ million lines of code they rely on, embedded folks, HPC/GPGPU, graphics/AV, CAD/CAM/CAE, application programmers, and people responsible for providing support for customers for all of those domains. It’s extraordinary difficult to propose anything that doesn’t step on someone’s toes.
- pjmlp 3y agoSure, yet the complexity depth is quite similar, regarding the amount of ecosytem and programming stack knowledge that doesn't fit on the brain, after 30 years of programming language history.
- thechao 3y agoHonestly? Well written C++, IMO, should look like C, but with alien builtins from the future. Once C++ gets really good ad hoc memory & resource tracking, you still have the harder problem that resource acquisition is a performance suck — which is true with any language from machine code to MetaOCaml.
- pjmlp 3y agoWhat a waste, than just stick with C.