Proposal of Multithread JavaScript

Bradley Meck bradley.meck at gmail.com
Wed Nov 2 16:16:07 UTC 2016


> Where is your ownership?

The main thread has all ownership.

On Wed, Nov 2, 2016 at 11:14 AM, Leo Dutra <leodutra.br at gmail.com> wrote:

> > there are additional checks for scoping to prevent escape from
> isolation that would be needed as well.. not to mention being able to call
> other functions, similarly isolated - Michael
>
> Yes. Expected. And where is the problem? You already have async await
> inside async await. What would change?
> You already share variables and all the outer scope stuff.
>
> There's not a problem with frozen object in workers. But the proposal is
> for multithreading, very different from worker. A worker could be run in a
> process for workers, as it happens in some implementations. A thread is a
> thread. Is directly connected with the process idea originated from POSIX.
> And another facade, worker requires an separate script or dynamic eval.
> This is not maintanance friendly.
>
> Bradley... ownership in JavaScript? Ownership in Rust is applicable...
> every let in Rust, without mutation explicitation, requires ownership.
> JavaScript is the total opposite.
>
> Why would you want ownership today with multithreading if you don't have
> it with single thread?
>
>> ​Ex:
>
> (function outer() {
>   let a = 1;
>
>   let b = async function() {
>      a = 2
>   }
>
>   await b()
>   console.log(a === 2) -> true
>
> })()​
>
> Where is your ownership?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20161102/ea3d8427/attachment.html>


More information about the es-discuss mailing list