In her talk The Future Of Clojure Bodil makes the following claim:
Guy Steele gave a talk at ICFP called Organizing Functional Code for Parallel Execution (or, foldl and foldr Considered Slightly Harmful) (Also in ACM).
In it Guy Steele asserts on slide 70:
As soon as you say “first,
SUM = 0
” you are hosed. Accumulators are BAD for parallelism. Note thatfoldl
andfoldr
, though functional, are fundamentally accumulative.
Which is kind of interesting. So Bodil is saying Guy Steele is calling out a problem. Then she claimed that Rich addressed it with Reducers (and Transducers which are a continuation of this line of thinking). In the Transducers talk at 16:11 we see Rich calling out some particular papers about foldr
.
- Bird - Lectures on Constructive Functional Programming (1988)
- Hutton - A tutorial on the universality and expressiveness of fold (1999)
Rich effectively says that fold
s are composable - and you can use them to build other higher order functions such as map
and filter
.
My question is - was Bodil right? has Rich solved the problem set up by Guy Steele? Do reducers (in Clojure) address the scaling foldr accumulation issue outlined by Guy Steele?
clojure
tag if you feel the question has a broader audience. – leppie