User loginNavigation |
Continuations, yield, ES4My language of choice for everyday coding is EcmaScript, thus I am very interested in everything new in this area. I'm mostly happy with the language, the only thing I miss in it seems to continuation support. I need them to simplify my work with asynchronous processing, that seems to happen very often in my development. I want them in order to convert this async processing to look like synchronous. So for example when I need to perform a bunch of animations one after one I have to write just for(var i=0;i<animations.length;i++) performAmination(animations[i]) What I need to write now instead is some hard to understand code. Another asynchronous thing is communication with server (AJAX). var someResult = serverProxy.callSomeFunc(arg); var otherResult = serverProxy.callOtherFunc(someResult+1); Now I am writing this in CPS stile, but it is a bit tedious. serverProxy.callSomeFunc(arg,function(someResult){ serverProxy.callOtherFunc(someResult+1, function(otherResult){ //process something here }); })
With continuations I could hide all the async-sync conversion in proxy and all the code will just use it in synchronous way. I know that JavaScript 1.7 in Firefox 2.0 supports yield keyword and generators. Rhino already has full continuations support, and such things is possible to do in Rhino, but there is no Rhino in web-browser and in Flash player. And second question is - does somebody know whether ES4 will support continuations or just yield. Somewher I read that Brendan Eich promised continuations, but I didn't find this in ES4 draft. By Vassily Gavrilyak at 2006-10-27 21:04 | LtU Forum | previous forum topic | next forum topic | other blogs | 9325 reads
|
Browse archives
Active forum topics |
Recent comments
27 weeks 2 days ago
27 weeks 2 days ago
27 weeks 2 days ago
49 weeks 3 days ago
1 year 1 week ago
1 year 3 weeks ago
1 year 3 weeks ago
1 year 5 weeks ago
1 year 10 weeks ago
1 year 10 weeks ago