Re:Go generics are not bad
by grumpyprole on Saturday July 09, 2022 @03:24PM
(#32038423)
> God what's the compilation time of millions of line of Haskell?
It wasn't compiled with GHC, but a proprietary compiler. It could typecheck the entire lot in a few minutes (in parallel) which was usually enough to detect breaking changes.
> There are plenty of industrial languages with algebraic data types and immutability.
A few do, yes, certainly not plenty. But defaults matter and immutability means more than just "const", e.g. persistent collections.
> Not as many as I would like with purity but I doubt it will take 30 years.
Given that big tech is delivering languages that are basically the same as Algol 60, I honestly think it will take at least 30 years.
Re:Go generics are not bad
by germandiago on Saturday July 09, 2022 @01:29PM
(#32037362)
Purity is nice and clear to reason about. But when you want the last drop of performance, having a place to overwrite memory as you invoke a SIMD algorithm or cast and do bitwise stuff is invaluable from a performance point of view, whether we like it or not.
Re:Go generics are not bad
by grumpyprole on Saturday July 09, 2022 @03:29PM
(#32038451)
Such a function can still be pure on the outside. This is real (state) encapsulation, not the encapsulation sold to you by OOP vendors.
Re:Go generics are not bad
by germandiago on Sunday July 10, 2022 @01:24AM
(#32042093)
Ok but there was discussion about Haskell so I was sticking to that... of course if you can have functional as an extra without preventing imperative in the low level then you can apply the best of both worlds.
Re:Go generics are not bad
by grumpyprole on Sunday July 10, 2022 @03:00AM
(#32042482)
Haskell let's one write fast imperative code when needed or call C functions.
> In 30 years time, I'm sure the industry will be extolling the virtues of algebraic data types, purity, immutability and referential transparency.
There are plenty of industrial languages with algebraic data types and immutability. Not as many as I would like with purity but I doubt it will take 30 years.