Hacker News new | ask | show | jobs
by Night_Thastus 1065 days ago
TBH, it sounds like you want a functional language (type inference, pattern matching, collection manip), of which there are many. GO is not such a language. But then you want ADTs, which aren't really functional. I'm not sure you can have both in a clean way. The closest you might get is a multi-paradigm language that tries to allow both, like C++.

Default immutability is great in a language like Rust where it's designed from the ground up to warn you as much as possible at compilation when something is wrong. You can rely on the compiler a lot. But adding default immutability to a language that isn't designed around the same concepts seems odd. You don't gain the same kind of benefits, but you do have to deal with the tedium. Worst of both worlds, in my view.

2 comments

Not exactly. I don't think Go should have ALL those, but some would be extremely helpful. That's just a wishlist.

There are some examples of languages that have a nice blend of functional features built in that are not fully functional languages, and the developer experience is fantastic (e.g. C#, Typescript, Kotlin, Swift, Java 11+)

They could've improved the developer experience, but they made some kind of C+- with easier concurrency.

And I find it all sad because Go ticks many of my boxes for a "perfect" general-purpose programming language.

> But then you want ADTs, which aren't really functional.

Pretty sure by ADTs, GP means "algebraic data types". These are very much functional, at least in the sense that they're a standard feature of statically typed FP (at least I know of no such language that doesn't have them).

ADT also sometimes stands for "abstract data type", which is something different. Although I wouldn't call them incompatible with FP either, Haskell typeclasses can express abstract data types, for example.

Ahah, whoops. I thought they meant "abstract data types", ie, classes - which AFAIK Go does not have.

Yeah, then if they want algebraics then a functional language is definitely the answer here.