Swift has the syntax to define arbitrary algebraic datatypes, even if it doesn't yet work in the beta versions of the compiler.
Furthermore, Swift doesn't support enough laziness/deferral/coalgebraic formulation to have, say, an infinite stream type without breaking GCD. These will probably be fixed in time, but Swift's ADT support is still pretty experimental to say the least.
I don't think we can all agree on what counts as progress. Some saw Exceptions as the advance in error handling we need while Go reverts back to error codes. People still think Go is superior for different reasons. I think both suck and prefer conditions and restarts as in Common Lisp.
It is rather difficult to build a programming language from a set of axioms we can all agree on.
Just a note that Go generally uses strings for error handling, not error codes. This avoids the need to look up the meaning of each error codes in a table somewhere.
The vast bulk of the industry is much more practical than theoretical. They don't care about your theory about how languages ought to be built. They care about solving the problems that are actually hindering programmers who are trying to write programs.
"But", I hear you say, "null pointer exceptions are one of those problems!" True. "And algebraic types can fix that!" Also true. But here's the thing: (Almost) Nobody cares. Nobody thinks that algebraic types are a price worth paying to fix null pointers.
Do not automatically assume that you are right, and that everybody else is too stupid to see it. Instead, try to expand your mind far enough to see that they may have a better grasp of the trade-offs that confront them than you do. They think your solution doesn't work in their world. Bemoaning their stupidity is the lazy way out. Instead, try to find out why they think that.
I think the problem is not with the industry. The problem is with your expectations of the industry.
So, the industry makes this analysis: yes, I could spend a few days learning about sum types, but it won't save me nearly as much time in avoided null pointer exceptions over the next month. So, no, it costs too much.
I guess we just have to live with this systemic irrationality. I guess long term thinking is just too much to expect. I guess decades old scientific results are too bleeding edge to risk employing them.
I can only think: not fast enough!
You think the industry is too short-sighted to know what's good for it. I'm saying that you're too narrow-minded to know what's good for the industry.
You think you know better than the industry what the industry ought to be like. I think you're wrong. I think the people in the trenches know better than you how to solve the problems they face. A choice can be different than yours without being stupid or short-sighted.
enum Optional<T> {
case None
case Some(T)
}8 decades, to be precise. They predate electronic computing - Church published his original paper in 1932.
It still amazes me that it's only in the past few years that widely-used languages have begun adopting them.
Before then even LISP didn't have closures. It was based on Church's ideas, and it did need to deal with figuring out how to bind a lambda's variables in order to evaluate it. But it was a dynamically scoped language, so capturing free variables from an anonymous function's lexical scope (which is what a closure does) didn't really make sense for it. Instead it just used the execution context to bind variables.
One may think that because closures are finally entering the mainstream (after what, 5 decades?), we have hope for those things to come as well.
But then I saw Swift. Built-in support for an Option type, so one can avoid null pointer exceptions. At the same time, this languages manages to recognize the extreme usefulness of algebraic data types, without using them in their full generality. Like, why bother with a generic feature when we can settle for an ad-hoc one?
I'd give much to know what went so deeply wrong in our industry that we keep making such basic mistakes.