Proposal of Multithread JavaScript

Leo Dutra leodutra.br at gmail.com
Wed Nov 2 16:14:50 UTC 2016


> 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/462ff3a5/attachment-0001.html>


More information about the es-discuss mailing list