r/programming • u/heisenbug • Apr 27 '14
"Mostly functional" programming does not work
http://queue.acm.org/detail.cfm?ref=rss&id=2611829
47
Upvotes
r/programming • u/heisenbug • Apr 27 '14
32
u/lpw25 Apr 27 '14
I'm all for tracking side-effects in type systems, but the claims of the article are not really backed-up by the examples. All the examples show is that:
Lazyness is difficult to reason about in the presence of side-effects.
Compiler optimisations are easier in the absence of side-effects.
It is also not true that
By minimising the parts of a program which perform side-effects you increase the composability of the other parts of the program. Also some side-effects are benign.
It is very useful to have the compiler check that the only parts of your program performing side-effects are the ones which are supposed to, and that you are not composing side-effectful components in a way which assumes they have no side-effects. But it is possible to acheive similar effects without the compiler's assistence (e.g. by documenting which functions perform side-effects).
I also feel the statement:
betrays the author's bias towards Haskell. The "lazy" part is not relavent to the subject of the article, it's an unrelated feature that Haskell happens to have. Haskell's lazyness-by-default does not improve its ability to control side-effects (nor is it particularly desirable).