Folks, Recently Tim Peters explained on python-dev a thing or two about how continuations work in Scheme-like languages: a function called call/cc ...
86
Sam Rushing
rushing@...
Aug 9, 2000 6:33 pm
... Yup... the lisp community hashed all this stuff out back in the 70's. They eventually whittled all the various equivalent constructs down to call/cc. The...
87
Just van Rossum
just@...
Aug 9, 2000 7:01 pm
... It sure feels great to reinvent some wheels here and there ;-) [ excellent Lisp/Scheme vs. Python analysis snipped ] ... This way of working has sprouted...
88
Christian Tismer
tismer@...
Aug 9, 2000 7:47 pm
... Yes, but there are a lot of drawbacks. ... We had call/cc in the first place, as Sam suggested. Later, it turned out that call/cc (or apply/cc) has not so...
89
Gordon McMillan
gmcm@...
Aug 9, 2000 9:52 pm
... This does simplify code, but it is slower. ... I have a plethora of opinions, ranging from strongly felt to completely wishy-washy, sometimes on the same...
90
Just van Rossum
just@...
Aug 10, 2000 11:13 am
... I agree it can't be used in the same style in Python, but I don't see that as a big drawback. What I like about apply_cc() is that the piece of code for...
91
Just van Rossum
just@...
Aug 10, 2000 12:28 pm
... Very well put. I would also agree that it's more important to focus on this than to bicker about continuations... ... Eh? What do you mean by "up to date"?...
92
Christian Tismer
tismer@...
Aug 10, 2000 2:03 pm
Hi Just, [caller() vs. apply/cc] ... I can't see the problem. We always said that continuations are not for the average user. They are exposed for the...
93
Just van Rossum
just@...
Aug 10, 2000 3:15 pm
... I understand that. And the current stuff works fantastic, which is a miracle all by itself. However, if co's *don't* vanish, and if we would like to see...
94
Gordon McMillan
gmcm@...
Aug 10, 2000 3:24 pm
Christian wrote: [Just calls caller() unPythonic ;-)] ... For experts only. ... Hey! You're not counting all of my opinions! ... I think for the experts-only...
95
Gordon McMillan
gmcm@...
Aug 10, 2000 3:34 pm
... I sort-of agree: there are some rough edges that should be filed down. But the main thing (I think) is to sell coroutines, and hide continuations behind...
96
Just van Rossum
just@...
Aug 10, 2000 4:00 pm
... And half an hour later I found that there is a simpler way (and that much of what I said about returning was *still* bunk ;-), with the same advantages --...
97
Just van Rossum
just@...
Aug 10, 2000 5:16 pm
... uthreads are separate category altogether, eventhough they are also built around continuations. The automatic/centralized context switching makes them very...
98
Sam Rushing
rushing@...
Aug 10, 2000 5:43 pm
... [I wish I had more time to devote to this work and discussion] A couple of months ago I wrestled with a coroutine problem - how to build a 'stateful' http...
99
Gordon McMillan
gmcm@...
Aug 10, 2000 6:00 pm
... So do we - you started it, after all ;-)!. ... I've got one (and I do HTTP/1.1). But HTTP isn't a particularly good target - the protocol is stateless...
100
Sam Rushing
rushing@...
Aug 10, 2000 6:27 pm
... Bad Sam! ... Yup. The ugly thing about stateless protocols is that people will do anything to build state on top of them. eGroups' web site is a good ...
101
Just van Rossum
just@...
Aug 10, 2000 6:30 pm
... Not me... But then again, that's more likely due to my ignorance than anything else. Speaking of which, there's a dumb braino in the code I posted before:...
102
Christian Tismer
tismer@...
Aug 10, 2000 8:24 pm
[continuations for experts] ... The point is: I want to experiment more with this, and I haven't understood continuations fully yet (at least after reading...
103
Just van Rossum
just@...
Aug 10, 2000 9:52 pm
... My theory is that you understand continuations just fine, but have problems making sense out of your own forest of options, flags & magic methods ;-) I...
104
Tim Peters
tim_one@...
Aug 11, 2000 5:52 am
[Christian] ... [Gordon] ... 1. Very few people on Python-Dev appear to read c.l.py anymore. 2. I'm 100% in favor of *somebody* writing a Stackless PEP. 3. You...
105
Just van Rossum
just@...
Aug 11, 2000 6:26 am
... Tim, I have an honest question for you (or actually, for anyone): In what way is a generator simpler than a coroutine, so you wouldn't need to spell them...
106
Thomas Wouters
thomas@...
Aug 11, 2000 7:14 am
... Actually, I think it's more of 'a handful' than 'very few'. At least Peter (Schneider-Kamp), Moshe, Mark and me still read c.l.py regularly, and sometimes...
107
Tim Peters
tim_one@...
Aug 11, 2000 7:20 am
[Just van Rossum] ... Careful -- that implies your questions are usually devious ploys <wink>. ... Sorry, I can't make time for this now. It's been covered...
108
Tim Peters
tim_one@...
Aug 11, 2000 7:39 am
[Thomas Wouters] ... Not that I know of. PEP 212 is about 4 specific new builtin functions, nothing about allowing users to write their own generators. BTW,...
109
Christian Tismer
tismer@...
Aug 11, 2000 9:39 am
... [Generators vs. coroutines] ... And that exactly is a problem for me. Since I know how to implement stack-based generators, and I know that Guido knows, I...
110
Just van Rossum
just@...
Aug 11, 2000 10:51 am
... [ And continues to write exactly the lecture I needed at this point, and that at 3 am. You're insane, but thanks! ] ... Got it. ... All fine and dandy, but...
111
Gordon McMillan
gmcm@...
Aug 11, 2000 12:13 pm
Thomas Wouters wrote: [Tim] ... I peeked at that one yest, and found HZ arguing that all the bitwise operators should just share one precedence level. Shudder....
112
Gordon McMillan
gmcm@...
Aug 11, 2000 12:13 pm
... That's nice for continuations, but not for coroutines. ... I said that to Christian about a month ago. He replied that he used call_cv regularly. So I did...
113
Just van Rossum
just@...
Aug 11, 2000 1:19 pm
... Erm, because of the speed penalty you mention below, or for other reasons as well? I there's another reason besides speed, I'm sure it can be solved by...
114
Christian Tismer
tismer@...
Aug 11, 2000 3:07 pm
... Think of lianes hanging down from trees, and you are Tarzan. When I jump to a different continuation, I grab a different liane and leave the current one....