Hi Oleg, Thanks for the work, it does look very nice and I will have a look. My remarks below concern the benchmarks. I regret not being pointed to this work earlier, because I think that measuring the performance of Enum as a representative OCaml stream library performance is not the best choice : Enum is designed to be flexible in a bit too many ways to be efficient on pure-streaming scenarios (it supports a generic "clone", and effectful generators, that makes the codebase too complex for its own good; I think that Batteries community is aware that Enum is not as good as it should be right now). There are other, more efficient streaming libraries out there, including BatSeq in Batteries that should already be sensibly faster; Core and Containers also have more efficient streaming libraries. I think that it would be good to try to use at least BatSeq for your benchmarks. I won't have time this week or the next one, but then maybe I could look at it. I'm not surprised that neither POPL reviewing nor POPL artifact evaluation caught this issue, but next time you benchmark using Batteries, feel free to send an email to the batteries-users mailing-list to point it out. On Tue, Nov 8, 2016 at 7:05 AM, Gregory Malecha wrote: > Thanks. This is interesting, I'll have to take a closer look at it. > > On Tue, Nov 8, 2016, 7:01 AM Oleg wrote: > >> >> > On 21 April 2016 at 09:13, Gregory Malecha wrote: >> > I'm wondering if there is any work (and interest) on supporting >> > user-defined optimizations similar to GHC's rewrite rules in the Ocaml >> > compiler. For example, a standard example would be specifying map >> fusion: >> >> to which Gabriel Scherer commented on Thu, 21 Apr 2016 12:02:14 -0400 >> >> > Another approach that might be worth trying (sorry for not thinking >> > about it earlier) is MetaOCaml. I tend of think of it as a tool to >> > explicitly specify and control partial evaluation strategies. >> >> Indeed. We'd like to point out an application of MetaOCaml, not just >> to map fusion -- but also concat_map fusion and zip fusion, etc. We >> present a streams library that supports the wide set of combinators -- >> from map and filter to concat_map (flat_map) and zip -- and produces >> the hand-written quality code. It is faster than Batteries by up to more >> than two orders of magnitude. >> >> http://okmij.org/ftp/meta-programming/strymonas.pdf >> http://strymonas.github.io/ >> >> Unlike GHC Rules, we guarantee the performance. >> > -- > > - gregory malecha > gmalecha.github.io >