Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 397 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coroutines or continuations for Web programming in Python and Ruby. Why not?

#1
**The question is: why aren't continuations (in Ruby) and coroutines (in Python) more widely used for Web programming?**

Server-side web programming is made difficult by the problem of preserving state between requests. Two elegant, and related, solutions to this are continuations (as found in Scheme, Ruby and Smalltalk) and coroutines (as found in Python and Go).

Bruce Tate in his *Beyond Java* (O'Reilly, 2005) talked about Ruby on Rails and **[Seaside][1]** as exciting new developments in Web programming. To me, **Seaside** was the real breakthrough: using Smalltalk continuations, Seaside made it very easy to program complex request/response sequences.

[1]:

[To see links please register here]


I know about Python coroutines being used in Tornado and Twisted to reduce callbacks, but that is somewhat low-level, compared to writing a view/controller in a single coroutine to handle a sequence of HTTP requests to complete an online purchase, for example.

**I wonder why these ideas that look so good on paper are not more widely deployed in Python and Ruby. Is it just a cultural matter? Limitations in the facilities as implemented in these languages? Or is there a fundamental flaw in these approaches in the context of Web development?**
Reply

#2
I've used Seaside and continuations are a beautiful model for developing client server webapps. They simplify traditional client/server applications that I couldn't believe
why no other langugage was doing it.

But unfortunately webapps aren't what they used to be.
Instead of the requesting only one page, now with ajax there are multiple requests at different times. That is why continuations aren't as useful as they used to be.

Even Avi Bryant (original author of Seaside) has said that under ajax making callbacks easier (event driven programming) is more important than continuations.

Take a look at this quora discussion for more:

[To see links please register here]

Reply

#3
Mainly because of non-technical reasons. The number of people knowing Seaside or even Smalltalk is small, so there is no large pool of cheap programmers that can be hired. Because of this the number of service providers knowing how to install and maintain a Seaside system is also low.

Reply

#4
You application should be written on continuation/coroutines framework, as well as support libraries too. It's not trivial model to understand by beginners.
Also there are much easier frameworks like gevent, which provides the same possibilities in making green threads, and easier to use because of monkey patching.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through