r/programming • • Apr 27 '14

"Mostly functional" programming does not work

http://queue.acm.org/detail.cfm?ref=rss&id=2611829
44 Upvotes

188 comments sorted by

View all comments

Show parent comments

4

u/[deleted] Apr 28 '14

[removed] — view removed comment

-1

u/jfischoff Apr 28 '14

If when faced with a technical problem you believe doing it manually is the way to go, then you really don't understand this computer thing.

-1

u/[deleted] Apr 28 '14

[removed] — view removed comment

4

u/DrBartosz Apr 28 '14

You can add AsParallel to your code, and it will work, as long as you know exactly how the parallelized code is implemented -- in particular whether it has access to any shared mutable memory. Scalability can only be attained if you can forget about the implementation of subcomponents. Both OO and FP let you forget certain aspects of implementation while bringing others to the surface -- OO lets you forget exactly the wrong kind of things when you're trying to parallelize your code. In Haskell there's no way (other than the infamous unsafePerformIO) to "forget" side effects. They are reflected in the type system through monads. This lets you run large chunks of code in parallel without knowing the details of their implementation; their type signature telling you (and the compiler) whether it's safe or not.