[Python-ideas] yield from multiple iterables (was Re: The async API of the future: yield-from)

Andrew Francis andrewfr_ice at yahoo.com
Tue Oct 23 19:18:56 CEST 2012


Hi Greg:

Message: 2
Date: Tue, 23 Oct 2012 12:48:39 +1300
From: Greg Ewing <greg.ewing at canterbury.ac.nz>
To: "python-ideas at python.org" <python-ideas at python.org>
Subject: Re: [Python-ideas] yield from multiple iterables (was Re: The
    async API of the future: yield-from)
Message-ID: <5085DB57.4010504 at canterbury.ac.nz>
Content-Type: text/plain; charset=UTF-8; format=flowed


>It does, in the sense that a continuation appears to the
>Scheme programmer as a callable object.

>The connection goes deeper as well. There's a style of
>programming called "continuation-passing style", in which
>nothing ever returns -- every function is passed another
>function to be called with its result. In a language such
>as Scheme that supports tail calls, you can use this style
>extensively without fear of overflowing the call stack.

>You're using this style whenever you chain callbacks
>together using Futures or Deferreds. The callbacks don't
>return values; instead, each callback arranges for another
>callback to be called, passing it the result.

There is a really nice Microsoft Research called "Cooperative Task Management without Manual Stackless Management."[1]
In this paper, the authors introduce the term "stack ripping" to describe how asynchronous events with callbacks handle memory.

I think this is a nice way to describe the fundamental differences between continuations and Twisted callbacks/deferred.

Cheers,
Andrew


[1] http://research.microsoft.com/apps/pubs/default.aspx?id=74219
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121023/5b492d95/attachment.html>


More information about the Python-ideas mailing list