Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What's bad about Python?

Name: Anonymous 2005-12-21 8:09

Because I'm learning it, almost done through the tutorial, and it looks great.

Name: Anonymous 2011-07-22 3:12

>>99
Maybe I'm stupid
Oh, no, you're not. That's a legitimate question, instead, I dind't mention that.

Yes, they can, but for some pairs it's a bit tricky:
control0 can easily implement all of them, and that's what the paper I linked basically does, using a control operator with control0-like semantics.
shift0 and control can easily implement shift.
For many years, many believed that shift couldn't implement control, but it was disproved in Shift to control, also proving that any control operator can implement each other (this is my logical conclusion, it is known that they can, but I'm not sure that this is the why)

>>98
If so, what is that useful for?
Nothing, you can do anything delimited continuations do with call/cc and set!, but if you remove set!, call/cc becomes helpless. And delimited continuations can express mutable state, or any computational effect.

So, nothing, really, if you've got mutable state, you can just drop delimited continuations, the only advantages are efficiency, readability, ease of use, theoretical beauty, and the lack of need of harmful mutable state.
Also, most of the time you don't need to capture the whole continuation.
When you see some strange nested call/cc application with set!, that code is just emulating delimited continuations.

Name: Anonymous 2011-07-22 8:59

>>110
I never said you should use them instead of set!, but instead of call/cc+set!.
The mutable state considered harmful part was more a joke than serious, what's bad about call/cc+set! are the excessive calls to call/cc, which is a costly operation in most non-CPS implementations.
Are two (or more) full stack copies less expensive than a single, partial stack copy?
You can get some comparisons and timings here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.11.3425

I would also like to argue whether delimited continuations, when used to hack around mutable state, make the code more readable.
Well, I still have to see something more complicated than a non-local return or amb written using call/cc that doesn't look like absolute spaghetti code. Most applications of delimited continuations I've seen were pretty straightforward.
I don't have any example of how awesome delimited continuations can be at the moment, mostly because I lack imagination. Maybe lexers/parsers?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List