by octoploid · 9y ago · 0 comments
Instead C++17 will have library hacks like std::variant, that almost certainly will be deprecated for C++20.
I've written too much C++ to be dumbfounded by that stuff but that doesn't mean I'm not still bitter about it.
Modules solve an immediate and obvious pain: unacceptably long compile times. Sum types are more profound. Anyone having tasted an ML derivative (as I have) would dearly miss them. Seriously, once you've tasted sum types, you'll want to use them everywhere: option types, error returns, abstract syntax trees (JSON, XML, compilers…), you name it, sum types probably solve it.
Sum types are no panacea, but if you squint your eyes just right they're pretty damn close.
It is somewhat anathema to the OO idea and brings lots of (runtime) implementation concerns so I can understand the delay.