[Swift-devel] Call function.

Yadu Nand yadudoc1729 at gmail.com
Sun Aug 14 17:04:00 CDT 2011


> How is this more useful than simply doing:
>
> foreach i in [1:5} {
>  results[i] = square(i)
> }
>
> I think that the call() function is useful, in that it gives Swift the equivalent of function pointers.

I don't think it gives any greater advantage than a slightly easier syntax.

> But if your goal, Yadu, is to explore map-reduce in Swift, I would look more closely at (a) use cases of processing key-value data and (b) how to do distributed parallel reduction in Swift.  Feel free to discuss some of the notes I send you privately, on the swift-devel list.

I think I have veered off from the original plan of MapReduce, but
then again, one of my proposals
was about functional style iterators. I should probably read up more
and then post about this.

> I think two of the issues for parallel reduction are:
>
> - how to specify intermediate reduction functions that take some arbitrary subset of a map()'s output (ie, a foreach's result set) and process those values to return an intermediate result, and then to repeat that at one or more levels.
>
> I think we're looking for is a way to couch the abstractions in the semi-functional Swift language, in a way that enables data-movement-efficient and highly parallel processing to take place at runtime with no specification of the physical computing locations in the abstract program.
>
> Its possible that we want to do this via some kind of new reduce() operator, which in turn may require an analogous map operator.  If this leads you there, then you could re-visit (and challenge) my comment above about map() not being substantially different than foreach().
>
> WHat I say here is somewhat vague still, as I'm not able to devote enough thinking to this at the moment.  I would proceed by detailing carefully the reduction phase of classic Google map-reduce and proposing a way to both abstract and implement reduction with similar efficiency (in terms of parallelism and distributed operation) in Swift.
>
> - Mike
>
>
>
> - Mike
>
>
>



-- 
Thanks and Regards,
Yadu Nand B



More information about the Swift-devel mailing list