4 ms·
You are just talking about when they are applied, not what can be done. Nothing was removed from C++: you can still write templates with structural constraints,
by ncmncm 5y ago
You are just talking about when they are applied, not what can be done. Nothing was removed from C++: you can still write templates with structural constraints, or trait constraints, or any mix.
In Rust, a generic is only right or wrong, in isolation. In C++, how it behaves, including whether it compiles, depends on how you choose to use it. That makes C++ templates strictly more powerful than Rust facilities. Rust could relax some restrictions, selectively, to gain that power, and might someday.
Preventing the "compiler vomit" is a main selling point of Concepts, and it works. It is still possible to subvert it, if you work at that (then you are no worse off than before). So, don't.
- pjmlp 5y agoI am talking about what we got is concepts light, and not the full deal. When one works with teams our options don't work in isolation. As for concepts working in preventing compiler vomit, there is still plenty of work to do in 2021.
- ncmncm 5y agoThe "full deal" turned out to be undesirable, and undesired. There is always more work to do. That is not a failing, it's just life.
- pjmlp 5y agoThe full deal failed due to the usual ISO politics, in the end it was concepts light or nothing. That is what defines modern C++, a standard full of political compromises, slowly becoming a niche language.
- ncmncm 5y agoIt failed because it turned out not to be usable, in practice. Getting something equally ambitious and also usable was a research project. Blaming ISO politics is a way to avoid need to understand unpleasant technical details. You wish C++ were becoming a niche language, but in fact its usage is still growing by leaps and bounds, as it has been continually since C++11 came out. Every week more people pick up C++ than the whole population now employed coding that other language. That will be true next year, too.
- pjmlp 5y agoYou wish C++ were as widely used across the whole OS stack as back in its glory 1990's days. The fact is that it has become a niche language for GPGPU programing, OS drivers and embedded standards like AUTOSAR, everywhere else another language takes the crown jewels, iOS, Android, macOS, ChromeOS, Windows Apps, Web, cloud computing infrastructure,... where is your growing C++? So much that Apple and Google are now rather focusing on their own languages, with C++17 being good enough for their own purposes, hence why clang is trailing its ISO C++20 compliance. When everyone brings their own agenda to the table regarding implementation details it is politics, not only concepts, contracts, ABI breaks (god forbid!), reflection, networking, graphics,...., definitly politics. But hey, it is growing on GPGPU, HPC, Machine Learning libraries for Python, LLVM/GCC implementation language, so there is that.