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.
[ Parent
| on HN ]
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.