Re: [Python-3000] Futures in Python 3000

2006-04-24 Thread Aurélien Campéas
On Fri, Apr 21, 2006 at 08:10:07PM +1200, Greg Ewing wrote: > Aurélien Campéas wrote: > > On Thu, Apr 20, 2006 at 07:59:43PM +1200, Greg Ewing wrote: > > > Andy Sy wrote: > > > > Does this mean that Py3K intends to reuse major portions of > > > > Python 2.x's implementation? > > > I expect that alm

Re: [Python-3000] Futures in Python 3000

2006-04-22 Thread Fredrik Lundh
Andy Sy wrote: > > It is a FUNDAMENTAL PRECONDITION of Py3K that it will BE the existing > > CPython codebase, with a few changes and some cruft removed. We are > > NOT going to re-write from the ground up. If you don't know why, go > > read "http://www.joelonsoftware.com/articles/fog69.ht

Re: [Python-3000] Futures in Python 3000

2006-04-22 Thread Andy Sy
Greg Ewing wrote: > BTW, if you *really* want to understand continuations, you > need to carry out the following exercise: Write a Scheme > interpreter in Scheme, doing it in a continuation-passing > style. [1] > > You'll find that it's possible to do this using a subset > of Scheme that doesn't

Re: [Python-3000] Futures in Python 3000

2006-04-22 Thread Andy Sy
Thanks for the discussions on the hows-and-whys of futures and asynchronous approaches in Python... they have been enlightening. [OT stuff below] Michael Chermside wrote: > It is a FUNDAMENTAL PRECONDITION of Py3K that it will BE the existing > CPython codebase, with a few changes and some cruf

Re: [Python-3000] Futures in Python 3000

2006-04-21 Thread Nick Coghlan
Jim Jewett wrote: > There, a Future is a proxy object, whose actual characteristics will > (or may) be filled in later. If you need it, you wait for it, but if > you don't need it yet, it can be created in the background. > > How to make this cleaner than the existing concrete implementations > (

Re: [Python-3000] Futures in Python 3000

2006-04-21 Thread Jim Jewett
On 4/21/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Andy Sy wrote: > > Huh? Futures are very different from continuations. I still have a > > hard time understanding continuations (and am no fan of them), but > > futures seem to be a rather simple abstraction to comprehend. > Isn't a future jus

Re: [Python-3000] Futures in Python 3000

2006-04-21 Thread Greg Ewing
Michael Chermside wrote: > > Andy writes: > > > I still have a hard time understanding continuations BTW, if you *really* want to understand continuations, you need to carry out the following exercise: Write a Scheme interpreter in Scheme, doing it in a continuation-passing style. [1] You'll fi

Re: [Python-3000] Futures in Python 3000

2006-04-21 Thread Greg Ewing
Tim Peters wrote: > Asynch programming wasn't at all a goal of generators, and Twisted is > well worth looking into for those who want slicker asynch programming > tools. There might possibly be room for an alternative way of presenting the generator machinery that makes it look like less of an a

Re: [Python-3000] Futures in Python 3000

2006-04-21 Thread Greg Ewing
Andy Sy wrote: > Huh? Futures are very different from continuations. I still have a > hard time understanding continuations (and am no fan of them), but > futures seem to be a rather simple abstraction to comprehend. Isn't a future just a coroutine, or something equivalent? Sometimes there's a

Re: [Python-3000] Futures in Python 3000

2006-04-21 Thread Greg Ewing
Aurélien Campéas wrote: > On Thu, Apr 20, 2006 at 07:59:43PM +1200, Greg Ewing wrote: > > Andy Sy wrote: > > > Does this mean that Py3K intends to reuse major portions of > > > Python 2.x's implementation? > > I expect that almost all of it will be reused. > > Couldn't PyPy be considered an interes

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Michael Chermside
Guido writes > Let me just add that Andy is wasting his time. Python 3000 won't have > continuations. Andy writes: > Huh? Futures are very different from continuations. I still have a > hard time understanding continuations (and am no fan of them), but > futures seem to be a rather simple abstra

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Tim Peters
[Guido, to Andy Sy] > ... > If you want to contribute a pure Python module that implements some > useful form of futures, you don't have to wait for Python 3.0. But > before you contribute this to Python 2.6 (it's too late for 2.5), you > should probably have released it successfully as a separate

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Guido van Rossum
On 4/20/06, Andy Sy <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > > Let me just add that Andy is wasting his time. Python 3000 won't have > > continuations. > > Huh? Futures are very different from continuations. I still have a > hard time understanding continuations (and am no fan of

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Michael Chermside
Andy Sy writes: > Does this mean that Py3K intends to reuse major portions of > Python 2.x's implementation? Aahz already answered this, but I'd like to restate more forcefully: It is a FUNDAMENTAL PRECONDITION of Py3K that it will BE the existing CPython codebase, with a few changes and some cru

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Andy Sy
Guido van Rossum wrote: > Let me just add that Andy is wasting his time. Python 3000 won't have > continuations. Huh? Futures are very different from continuations. I still have a hard time understanding continuations (and am no fan of them), but futures seem to be a rather simple abstraction t

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Guido van Rossum
Let me just add that Andy is wasting his time. Python 3000 won't have continuations. On 4/20/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Andy Sy <[EMAIL PROTECTED]> wrote: > > Err... thank you once again for being redundant, reiterating what is > > already pretty much dead clear to everyone

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Josiah Carlson
Andy Sy <[EMAIL PROTECTED]> wrote: > Err... thank you once again for being redundant, reiterating what is > already pretty much dead clear to everyone and saying nothing new > in general. And yet, here I notice that you've still not described a syntax or its execution semantics. Instead you've c

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Guido van Rossum
On 4/20/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > The difficulty with improving on the current generator > model is that the only way to do any better is to use > full coroutines. That means either using threads (which > you can do now if you want), or turning the whole > implementation inside-ou

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Aurélien Campéas
On Thu, Apr 20, 2006 at 07:59:43PM +1200, Greg Ewing wrote: > Andy Sy wrote: > > > Does this mean that Py3K intends to reuse major portions of > > Python 2.x's implementation? > > I expect that almost all of it will be reused. > Couldn't PyPy be considered an interesting contender ? > The diff

Re: [Python-3000] Futures in Python 3000

2006-04-20 Thread Greg Ewing
Andy Sy wrote: > Does this mean that Py3K intends to reuse major portions of > Python 2.x's implementation? I expect that almost all of it will be reused. The difficulty with improving on the current generator model is that the only way to do any better is to use full coroutines. That means eith

Re: [Python-3000] Futures in Python 3000

2006-04-19 Thread Andy Sy
Josiah Carlson wrote: > Andy Sy <[EMAIL PROTECTED]> wrote: >> Does this mean that Py3K intends to reuse major portions of >> Python 2.x's implementation? > > Aahz just answered this. > From the discussion I've been paying attention to over the last few > years, *some* parts of Py3k will be backwa

Re: [Python-3000] Futures in Python 3000

2006-04-19 Thread Josiah Carlson
Andy Sy <[EMAIL PROTECTED]> wrote: > Greg Ewing wrote: > > There's a lot more to this than syntax. The oddities > > surrounding Python generators are mostly due to their > > "one-level-deep" nature, i.e. they're not full coroutines. > > And there are deep implementation reasons for that. > > Does

Re: [Python-3000] Futures in Python 3000

2006-04-19 Thread Aahz
On Thu, Apr 20, 2006, Andy Sy wrote: > Greg Ewing wrote: >> >> There's a lot more to this than syntax. The oddities >> surrounding Python generators are mostly due to their >> "one-level-deep" nature, i.e. they're not full coroutines. >> And there are deep implementation reasons for that. > > Doe

Re: [Python-3000] Futures in Python 3000 (was Re: mechanism for handling asynchronous concurrency)

2006-04-19 Thread Jim Jewett
On 4/19/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > If syntax is all you're concerned about, you could translate > that into Python as something like >f = url(future(fetch)) Are you sure it wouldn't be f = Future(fetch, url) a bit like result = ActiveObject(function, args) > Now,

Re: [Python-3000] Futures in Python 3000

2006-04-19 Thread Andy Sy
Greg Ewing wrote: > There's a lot more to this than syntax. The oddities > surrounding Python generators are mostly due to their > "one-level-deep" nature, i.e. they're not full coroutines. > And there are deep implementation reasons for that. Does this mean that Py3K intends to reuse major porti

Re: [Python-3000] Futures in Python 3000 (was Re: mechanism for handling asynchronous concurrency)

2006-04-19 Thread Guido van Rossum
On 4/19/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Andy Sy wrote: > > > I don't know about you, but with the addition of send() to deal with > > the problem outlined in PEP 342, generators are starting to look more > > and more like a Rube Goldberg contraption. Could anything be more > > Pythonic

Re: [Python-3000] Futures in Python 3000 (was Re: mechanism for handling asynchronous concurrency)

2006-04-18 Thread Greg Ewing
Andy Sy wrote: > I don't know about you, but with the addition of send() to deal with > the problem outlined in PEP 342, generators are starting to look more > and more like a Rube Goldberg contraption. Could anything be more > Pythonic than Io's: > > f := url @fetch // f is a future that will