News for hackers. Stuff that matters.
Re:Why functional programming? by runT1ME on Tuesday December 24, 2013 @05:39PM (#6961396)
> If you have 10mb of numbers that you need to add 1 to immutable state means you now have 20mb of numbers guaranteed

You'd only have 20mb of 'numbers' if you needed to keep a reference to the original data structure. Otherwise its' garbage.

>So in general, forced immutable state means that any class of problems which require both high performance and a lot of mutation are going to be very poor candidates for functional programming

FP does not necessitate 'immutable state', even in pure languages like Haskell. What it enforces is purity, or more concrete, referential transparency. Often the easiest way to obtain referential transparency is immutable data (non destructive data structures, etc), but you can have mutable data and maintain referential transparency for high performance (see ST Monad).

There are no comments on this comment yet.