Am 01.07.2011 um 13:10 schrieb Philippe Marschall: > On 06/30/2011 05:37 PM, Norbert Hartl wrote: >> >> Am 30.06.2011 um 17:23 schrieb Stéphane Ducasse: >> >>>>> Hi guys >>>>> >>>>> apparently people get excited by nodeJS and I would like to know the >>>>> equivalence of >>>>> >>>> What does it mean? >>> >>> in Pharo.. how do you have the same: >> >> It depends what is in your head when you wrote this. The code snippet >> doesn't tell that much. Registering a Block for execution on request is >> probably not what makes you excited about. What is exciting about it is that >> javascript is written in a strictly asynchronous manner (event driven) and >> that matches perfectly the implementation with asynchronous I/O. Suddenly >> you can write programs they way you ever wanted it. And lucky for us >> smalltalk itself is event driven so it can go there easily, too. ... > > > In theory yes, in pratice no. You need to to async all the way down and > then all the libraries (DNS, SQL, HTTP, …) need to be rewritten to be async. > > then > your > code > will > read > like > this > > and exception handling is impossible. You can make it read like sync > code again with continuations but you still have to solve the exception > problem. At that point you have gained what exactly besides being > trendy? Don't get me wrong, async has it's place but not in user code. > Node has to be async because it has only a single process and a single > green thread but we don't.
You don't need to write everything asynchron. In javascript you would to because there is no blocking at all (only in node on system level). In Smalltalk you can just block a call while you are waiting for a callback to fire and you break the chain. So asnych stuff here is not that viral. But you don't have the opportunities like you have in javascript. In javascript you don't have most concurrency problems because it is just a single thread that can only execute one single whole function at a time. That is different in smalltalk thus making the whole async stuff less admirable. Norbert
