On 6/27/07, Giulio Cesare Solaroli <[EMAIL PROTECTED]> wrote:
> a colleague has just pointed me to this post on Javascript threading:
> http://www.neilmix.com/2007/02/07/threading-in-javascript-17/

Interesting, kinda like Stackless Python but for javascript :)

> I have to admit that I did not read the whole articole very careful,
> but I had the impression that the suggested solution, even if using
> different terms, was aiming at solving the same problem that Mochikit
> own Deferred objects solve.

No, not really. Deferreds encapsulate the "promise of a future
result", along with goodness such as being cancelable, deferred
chaining etc. They're basically just a way to make callbacks easier to
handle.

Now, callbacks can be used in many cases in place of generators - but
the powerful yield statement can do much more.

I think it would be very hard to implement this trampolining way of
cooperative scheduling with callbacks - and deferreds wouldn't help
much. If I'm mistaken I'm sure someone will correct me.

> If anybody can confirm this impression, I will be very pleased to skip
> the careful reading of the post, as I have already got quite confident
> using Deferred (after an inital pain) and I would be very happy to
> keep using them.

Understanding trampolining generators and this "stackless" mode of
doing function calls is a pain to.. but I recommend reading and
thinking about it :)

Arnar

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to