4 ms·
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 c
by germandiago 4y ago
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.
- grumpyprole 4y agoSuch a function can still be pure on the outside. This is real (state) encapsulation, not the encapsulation sold to you by OOP vendors.
- germandiago 4y agoOk 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.
- grumpyprole 4y agoHaskell let's one write fast imperative code when needed or call C functions.