Re:Why I Prefer Functional Programming
by dragonwriter on Saturday October 31, 2020 @09:31PM
(#24956605)
> But all of computation can’t be reduced to just pure functions, which is why even Haskell has to call out to its runtime eventually.
All of computation provably can, but not everything computers do, despite the name, is computation.
Re:Why I Prefer Functional Programming
by amw-zero on Saturday October 31, 2020 @10:09PM
(#24956745)
Computation cannot be reduced to simply functions, that’s why we need something like the lambda calculus to express computation. There are functions within the calculus, but to say that “computation is a function” is not correct.
Actually, computation, in the classic sense used by Turing, Church, and other pioneers, refers to evaluating the value of (mathematical) functions. The word computation first appears in the earliest papers of the field which would later become computer science referring to "computable functions", which refers to functions which can be evaluated by a mechanical process. Hence saying "not everything computers do is computation".
Of course I prefer writing in a functional style, because pure functions are just simpler. But all of computation can’t be reduced to just pure functions, which is why even Haskell has to call out to its runtime eventually.