Where the delay comes into play is that most projects require a minimum support of a compiler that's several years out of date. And if you're required to support 4-year-old compilers, then C++17 features aren't going to be available, despite them being available in the newest versions of all compilers. Back in 2018, I was working on a project where I gave up and used C++17 features (constexpr if) because I knew I could get away with only supporting a Clang that's a few weeks old.
The ISO standard was published in December of last year. So, technically, C++20 is only four months old.
For essentially any other language this would be an absurd thing to say. For those languages you wouldn't consider a feature added until it was supported by the reference compiler
But putting that aside
> For those languages you wouldn't consider a feature added until it was supported by the reference compiler
Well, there is no reference compiler for C++. I don't think any language with either an ISO or ECMA standard has a reference compiler or interpreter.
There are gaps in support here in and there. But I would still say those mainstream compilers "support" C++17 for the same reason I would say that Chrome "supports" CSS3, despite it not implementing the full specification.
To be fair though, it would be less of a problem for C++ than it was for Python, since you wouldn't have to depend on the compiler from the end-user system.
But yes, there's a reason why high-visibility C++ projects like Chrome basically white-list 30% of the language and keep it that way, to some small sub-set they feel is "good enough".
The problem is the fragmentation this causes. I pick these 5 features of the language, you pick another 7, I can't use your lib, etc, etc.
C++ is becoming extremely bloated. Bjarne said as much in one of his recent criticisms at the highly-specialized use-case proposals that people wanted to make "standard".
I enjoyed his C++11 book but now that's probably all outdated "oh we don't do it that way anymore" stuff and I can't afford to just buy 2-3 1000-page books every year to keep up. Got better things to do.
(Not to mention that forcing developers to write header-only libraries to use templates pretty much makes them way less attractive anyway)
Edit: maybe I'm wrong? It looks like modules are in C++ 20. No idea if any compilers are supporting them yet.
https://github.com/microsoft/STL/wiki/Changelog#expected-in-...
there were plenty of experimental implementations over the years, some people have been using some flavour of "modules" with MSVC and Clang for something like 5 years... hell, technically it has always been possible to compile code as objective-C++ to leverage the objc module system if you could afford to use clang everywhere
I personally don't like c++, but I wouldn't enjoy someone going on a rust thread and shilling c++. So I won't shill rust on a c++ thread. Seems similar for Zig.
OP asked for:
> only fixed bugs or deprecated old features
When you get right down to that, you do end up with something like Rust. E.g. C++'s move semantics are weird because for historical reasons copying is the default. Get rid of those historical reasons, and there's no reason not to do it the Rust way.
40 years of "no big breaking changes" really is a lot of cruft.
memcpy everywhere is definitely not the best answer to every problem
Copy : Clone :: Move : Relocate
I.e. there would not be the presumption that everything is automatically movable or coppiable, there would be magic traits to indicate memmove / memcpy and friends, and then plain old stdlib super traits for user-defined cloning and relocating.
This is the the right design for move constructors, full stop.
Empirically, that's been happening?
I want more C++ shilling in Rust threads, and I don't think I'm alone.
Please, give me detailed examples of how you can use SFINAE or whatever to express useful misuse-resistant abstractions that can't be expressed with Rust's feature set. Please tell me about classes of bugs you can prevent in C++ that can't be similarly prevented in Rust.
Or maybe C++ isn't safer, but it's more performant? Easier to use? Easier to learn? Easier to troubleshoot and debug?
I agree that the Zig comment that started this sub-thread didn't contribute to the conversation. If we disagree, although I'm not sure we do, it's in that I'd rather call for higher-effort comments about the benefits of other languages instead of fewer comments about them.
- Game engines like Unreal and Unity
- GUI frameworks like wxWidgets, Qt, MFC, WinUI
- Being the language of choice to contribute anything to GCC or LLVM
- Being the language of choice for the native libraries ecosystem and runtime extensions to plug into Java, .NET, nodejs.
- Being the language to write drivers in macOS (IO Kit/Driver Kit), and Android alongside Java (Project Treble)
- Being avaialble out of the box on macOS, iOS, Windows, Android, Playstation, XBox, Switch SDKs and respective IDE tooling
So you can decide to deal with some of C++ flaws, and enjoy 40 years of history, or spend part of your application development budget into building a Rust ecosytem.
The C++ SDK is definitely not available out of the box on Windows. You have to install it (and update it manually!).
Not only it is automatically selected in the respective workloads that depend on it being avaiable, it gets updated.
In overall Rust’s current type system isn’t good enough to match what C++ has for numeric computations, although there have been some recent improvements such as the min-const-generics feature. I’ll probably try the language again once const generics are finished.
But yes, it's true that Zig aims to be a minimal, stable language - when they go to 1.0, which hasn't happened yet. It's still changing frequently.