0

Many techniques are used for this means, from as simple as Short Cut Fusion to elaborate Stream Fusion. I'm aware compilers such as GHC and MLTon rely considerably on this technique. Are there other compilers in existence that do so?

MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
  • Does MLTon do this optimization? It's not valid in general unless the compiler knows `f` and `g` are pure. – Tom Ellis Jan 04 '14 at 13:39
  • I read [here](http://mlton.org/pipermail/mlton-user/2007-April/001091.html) it does. – MaiaVictor Jan 04 '14 at 13:40
  • That email looks like a demo someone wrote on their laptop, not an official released version. Note that no one replied on that email thread. – misterbee Jan 04 '14 at 17:13

1 Answers1

1

I think Clojure does fusion (on functions of sequences, not streams, because Rich Hickey cares more about optimizing and parallelizing strict computations on definite data, not stream processing indefinite/lazy data)

https://groups.google.com/forum/m/#!topic/clojure/EJ9hOZ8yaos

http://clojure.org/reducers

misterbee
  • 5,142
  • 3
  • 25
  • 34
  • From reading that mail, it appears to be *parallelizing* some higher order functions, not fusing them in the sense used here. –  Jan 04 '14 at 17:30
  • I think they compose, but I don't know if there a meaningful analogy to the "rewrite rules" that translate the "unfused" code into fused compiled code. http://clojure.org/reducers – misterbee Jan 04 '14 at 17:38