Re: v8 first impressions

Colin Putney <[email protected]> Wed, 3 Sep 2008 22:53:32 -0700
Newsgroups gmane.comp.lang.smalltalk.strongtalk
Message-ID <[email protected]>

On 3-Sep-08, at 11:43 AM, talksmall wrote:

>
> On Sep 3, 11:57 am, Colin Putney <[email protected]> wrote:
>
>> One thing to note here is that the semantics of Javascript don't
>> include concurrency at all. Javascript code only runs in response to
>> sequential events generated from outside the Javascript context, so  
>> it
>> makes perfect sense for V8 to be implemented this way.
>
> True ... except that you can spawn off timeouts and intervals that act
> in some ways similarly to threads, except (at least in current
> implementations) with no parallel execution - the VM schedules them
> sequentially - and with no suspension or synchronization mechanism, so
> one task (event handling function) needs to complete before another
> can be scheduled.

True, you can schedule events from Javascript. But I think the  
differences you point out are more important than the similarity -  
which is only that you can schedule code to be executed without having  
to do an immediate synchronous function call.

Not to belabour it too much, but I actually think this nitpicky  
distinction is quite important. All the action in computer science  
these days in figuring out how to deal with multiprocessing. Shared- 
state concurrency, as traditionally used by OO languages like  
Smalltalk, Java, Objective-C, C++ or Ruby can be problematic, so I'm  
interested in alternatives.

What's cool about V8 is that it's designed for multi-theading on the  
outside, and single threading on the inside. That is, the VM supports  
being used in a multithreaded application, but it doesn't attempt to  
execute Javascript concurrently. At the same time, it supports  
multiple Javascript execution contexts within the same VM. Maybe that  
could be used to implement the same sort of concurrency model that's  
used in E and Croquet.

Colin


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