[swift-evolution] Support Transducers
Árpád Goretity
arpad.goretity at gmail.com
Fri Dec 25 13:05:47 CST 2015
This is a nice idea that I would definitely support having in the stdlib.
By the way, are there any benchmarks supporting that transducers do indeed
result in a performance gain? Having to allocate/traverse fewer arrays sure
seems like a win, but other constant factors may be introduced by the
extensive use of closures.
On Fri, Dec 25, 2015 at 6:53 PM, Dmitri Gribenko via swift-evolution <
swift-evolution at swift.org> wrote:
> On Fri, Dec 25, 2015 at 9:07 AM, Jason Jobe via swift-evolution
> <swift-evolution at swift.org> wrote:
> >
> > Okay,
> >
> > I would like to propose that Transducers be considered for addition to
> the Swift core.
> >
> > "Transducers are a powerful and composable way to build algorithmic
> transformations that you can reuse in many contexts…"
> >
> > There are ways to build them w/out any language modification but they
> are not as efficient as alternative expressions.
>
> Hi Jason,
>
> I was playing with a similar idea here:
>
>
> https://github.com/apple/swift/blob/master/test/Prototypes/CollectionTransformers.swift
>
> You wouldn't find the word 'transducer' there, but it is based on
> similar principles, except it also allows you to optimize the AST of
> the transformation, and it is structured in such a way that would
> allow us to automatically parallelize the whole pipeline.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
--
Author of the Sparkling language
http://h2co3.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151225/a9476293/attachment.html>
More information about the swift-evolution
mailing list