- lacking sum types (enums), which is why you have to explicitly check every return value with if err != nil. Sum types enable useful patterns like Maybe, Either, etc.
- general wackiness, from a computer science perspective Golang bakes a lot of special cases into its semantics that could be handled by including fundamental types. If you want to do multi-value return, the sane thing is to use a tuple, which is a core data structure we all learn about in CS undergrad, and use that as a return type and have functions return a single value. This is how Python and Rust work. (Tuples are also useful in many other contexts). The Go way is to have a rule that a function can return multiple values from a function and receive them at a call site. It's not pattern matching, and its not tuples, it's just a special case that defies the mathematical model of a function (a mapping of a domain to a single codomain).
Go makes different tradeoffs. Get over it.
Nobody has written anything as important as Kubernetes in Rust yet. I hope that someday somebody does write something worthwhile but please less of the fundamentalist attitude that had poisoned religion and politics.
Those go softs are usually stable and easy to install. We have yet to use a rust developed program.
Usability matters, and the much much higher learning curve as played against rust.
Trade offs are one thing, defecencies are another.
And if you can think of a reason why hard coding multivalue return signatures would be better than a tuple type, then I’d like to hear it.
- in spite of theoretical weaknesses, Go empowers developers to get shit done, causing dreadful cognitive dissonance for academic programming linguists
I feel you, though. I was you some time ago. You need to let go of the feeling that programming languages are the most important thing in the world. Until you do, that feeling will just pull you down to a place where nothing's good enough.
And your argument against multiple return values makes no sense. How is using a tuple type better (or even different, in practice)? And your pointing to the mathematical definition of a function is pointless. A function has a very different meaning in programming languages than it does in mathematics. Mapping a domain to a single co-domain is not what functions do in the vast majority of programs.
You could say the same about function argument lists--that functions should only take a tuple.
IME the reason some particular language only permits returning a single value is typically either (a) convention or (b) a reflection of implementation details.
So your comment is kind of unsubstantiated. And as I said, things have changed, and things will change. We can either do as you imply and keep using C and languages without "sum types" and "real generics", and keep creating security vulnerabilities and broken software, moving at a snails pace because we have poor methods of reuse, or we can aspire to build better tools to build better software. I am squarely in the latter camp, I think we should aspire to keep evolving.