Discussion:
Holy mixed metaphors, Batman! (was: Event loops in navigated-away-from windows)
Brendan Eich
2014-10-15 20:34:53 UTC
Permalink
realms and vats and ES jobs.
I like mixed metaphors as much as the next person, but srsly, can we talk?

Realm : Quest :: ??? : Job
Vat : Realm :: WindowProxy : Window

I'm not sure of these, help wanted fixing them and filling in the ???
slot -- but we have too many tropes. Please eliminate one or two.

/be
Mark S. Miller
2014-10-15 20:38:35 UTC
Permalink
I don't understand "Vat : Realm :: WindowProxy : Window". In what way are
these analogous?
Post by Brendan Eich
realms and vats and ES jobs.
I like mixed metaphors as much as the next person, but srsly, can we talk?
Realm : Quest :: ??? : Job
Vat : Realm :: WindowProxy : Window
I'm not sure of these, help wanted fixing them and filling in the ??? slot
-- but we have too many tropes. Please eliminate one or two.
/be
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141015/412d58f6/attachment.html>
Boris Zbarsky
2014-10-15 22:41:52 UTC
Permalink
Post by Mark S. Miller
I don't understand "Vat : Realm :: WindowProxy : Window". In what way
are these analogous?
Well, the WindowProxy to Window relationship is one-to-many. And Window
pretty clearly corresponds to Realm (in the sense that there is a unique
Realm associated with each Window).

Whether WindowProxy corresponds to Vat or not is an interesting
question, but I would guess in practice it does not.

-Boris
Brendan Eich
2014-10-16 21:58:47 UTC
Permalink
Post by Boris Zbarsky
Whether WindowProxy corresponds to Vat or not is an interesting
question, but I would guess in practice it does not.
Can you say more? We may end up with multiple distinct well-defined
concepts, but let's shave closer with Occam's razor, if possible.

/be
Mark S. Miller
2014-10-16 22:08:23 UTC
Permalink
Wait, I don't even understand what analogy y'all have in mind. A Window is
per Realm. A WindowProxy is per what? certainly not per Vat, as there are
many WindowProxies co-residing in the same Vat. I don't see even any
metaphorical similarity between a WindowProxy and a Vat. A Vat is not
proxy-ish for any other similar concept.
Post by Brendan Eich
Whether WindowProxy corresponds to Vat or not is an interesting question,
but I would guess in practice it does not.
Can you say more? We may end up with multiple distinct well-defined
concepts, but let's shave closer with Occam's razor, if possible.
/be
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141016/58855024/attachment.html>
Brendan Eich
2014-10-16 22:16:08 UTC
Permalink
Post by Mark S. Miller
Wait, I don't even understand what analogy y'all have in mind. A
Window is per Realm. A WindowProxy is per what? certainly not per Vat,
as there are many WindowProxies co-residing in the same Vat. I don't
see even any metaphorical similarity between a WindowProxy and a Vat.
A Vat is not proxy-ish for any other similar concept.
I was just throwing out analogies to get this thread started :-P.

Is the problem just clash of metaphors (Vat vs. FooProxy vs. Realm)? I'm
still not sure, but even if only that, seems worth addressing. "Isle"
doesn't quite do it instead of "Vat", though ;-).

/be
Mark S. Miller
2014-10-16 22:32:32 UTC
Permalink
I sympathize on mixing of metaphors. If we can come up with some metaphors
with more reach, so that more terms can be explained by reference to fewer
metaphors, that would be great.

As with the Window and WindowProxy you mention, the reach of candidate
metaphors should be judged also by how many existing names it can explain.
Post by Brendan Eich
Post by Mark S. Miller
Wait, I don't even understand what analogy y'all have in mind. A Window
is per Realm. A WindowProxy is per what? certainly not per Vat, as there
are many WindowProxies co-residing in the same Vat. I don't see even any
metaphorical similarity between a WindowProxy and a Vat. A Vat is not
proxy-ish for any other similar concept.
I was just throwing out analogies to get this thread started :-P.
Is the problem just clash of metaphors (Vat vs. FooProxy vs. Realm)? I'm
still not sure, but even if only that, seems worth addressing. "Isle"
doesn't quite do it instead of "Vat", though ;-).
/be
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141016/2825cf8a/attachment.html>
Boris Zbarsky
2014-10-17 00:31:27 UTC
Permalink
Post by Brendan Eich
Can you say more?
Vats as currently specified have independent event loops and allow
parallel JS execution, in the sense that they are totally disconnected
from each other and have separate run-to-completion guarantees.

A window and its same-origin subframe have two separate WindowProxys but
can't really be separate Vats given the above, yes?

-Boris
Brendan Eich
2014-10-17 04:23:33 UTC
Permalink
Post by Boris Zbarsky
Post by Brendan Eich
Can you say more?
Vats as currently specified have independent event loops and allow
parallel JS execution, in the sense that they are totally disconnected
from each other and have separate run-to-completion guarantees.
A window and its same-origin subframe have two separate WindowProxys
but can't really be separate Vats given the above, yes?
Yup, but doesn't help inspire fewer/pithier metaphors, alas. "Vat" from
Mark's E work is meaningful to those who know that work, and that's
valuable. But can we do better?

Again this sub-thread, is mostly about finding the right terms of art.
If we can unify across specs (if not within), that's gravy.

/be
Domenic Denicola
2014-10-17 06:12:40 UTC
Permalink
From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Brendan Eich
Post by Brendan Eich
Again this sub-thread, is mostly about finding the right terms of art.
From that perspective, I'd do s/vat/continent/, to match Allen's explanation that while only "political barriers" prevent transition of objects between realms, there's an actual barrier between vats/continents that requires some sort of artificial conveyance (i.e. structured clone, now known as "the boat algorithm" ;).
Tab Atkins Jr.
2014-10-17 20:12:37 UTC
Permalink
On Thu, Oct 16, 2014 at 11:12 PM, Domenic Denicola
Post by Domenic Denicola
From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Brendan Eich
Post by Brendan Eich
Again this sub-thread, is mostly about finding the right terms of art.
From that perspective, I'd do s/vat/continent/, to match Allen's explanation that while only "political barriers" prevent transition of objects between realms, there's an actual barrier between vats/continents that requires some sort of artificial conveyance (i.e. structured clone, now known as "the boat algorithm" ;).
I like the physical separation analogies, fwiw. Hits my intuition a
little better.

~TJ

Anne van Kesteren
2014-10-17 08:26:35 UTC
Permalink
Again this sub-thread, is mostly about finding the right terms of art. If we
can unify across specs (if not within), that's gravy.
Vat helps explaining workers, but not the rest.
--
https://annevankesteren.nl/
Luke Wagner
2014-10-17 15:26:37 UTC
Permalink
FWIW, "constellation" is a term that some of us have been using for a while (at least in Mozilla) for a concept that seems to match "Vat". For example, in the context of:
- when we could have separate task queues on separate threads (as an unobservable impl detail to improve responsiveness): http://markmail.org/message/rgtaeeg4dssvwcdw
- which windows' script execution should be blocked by slow-script dialog: https://bugzilla.mozilla.org/show_bug.cgi?id=637264

Roughly speaking, a constellation is a set of transitively-reachable windows (and, as a special case, workers are their own constellations). Since reachability implies synchronous observable effects, this means all the code in all realms in the constellation must use the same event loop.

Cheers,
Luke

P.S. A fun corner case to consider is whether cross-origin edges count as "reachable" in the definition of constellation. I think this boils down to whether origin A can (directly or indirectly) trigger (predictable, cross-browser, perhaps even standardized) synchronous execution in origin B via cross-origin-accessible Window or Location properties. I was just asking bz about this on irc and we need more experimentation to answer this. Also relevant is the 'rel="noreferrer" 'target="_blank"' requirement to get a new process (http://blog.chromium.org/2009/12/links-that-open-in-new-processes.html), where process is necessarily an over-approximation of constellation (assuming no cross-process RPC :).

----- Original Message -----
Post by Anne van Kesteren
Again this sub-thread, is mostly about finding the right terms of art. If we
can unify across specs (if not within), that's gravy.
Vat helps explaining workers, but not the rest.
--
https://annevankesteren.nl/
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Allen Wirfs-Brock
2014-10-17 16:37:55 UTC
Permalink
Post by Brendan Eich
Can you say more?
Vats as currently specified have independent event loops and allow parallel JS execution, in the sense that they are totally disconnected from each other and have separate run-to-completion guarantees.
A window and its same-origin subframe have two separate WindowProxys but can't really be separate Vats given the above, yes?
We've also talked about this in the other recent related thread.

As Vats are current specified (the ES6 spec essentially describes a single Vat), the host is responsible for making Job scheduling decisions for each Vat. This means that a host that is managing multiple Vats could impose a synchronous scheduling policy that spans multiple Vats. This seems like it may be sufficient to describe browsers behavior.

Allen
Mark S. Miller
2014-10-17 17:25:00 UTC
Permalink
Till now I was neutral on the term "Vat". But part of the notion of Vat is
that Vats are (mostly[1]) only asynchronously coupled. Two fully membraned
subgraphs, interacting synchronously only through Proxies, would by my
normal definitions be together in one Vat.

For this separation, where non-subvertable membrane boundaries impose
security boundaries between disjoint subgraphs of the object graph, I use
the term "Compartment". This corresponds well enough to the established
meaning of "Compartment" in computer security.

[1] In E the issue of asynchronous-only coupling is broken into two
concepts, the Vat and the Runner. Each Vat is within one Runner, and there
can be multiple Vats within a Runner. Each Job (nee Turn) is associated
with a one Vat. Each Runner is associated with a single threat of control.
Each Job of any Vat within a Runner, once started, runs to completion
before that Runner can start any of the other Jobs of any of its Vats.
Thus, a single non-terminating Job of any Vat within a Runner prevents any
further progress by any other Vat within that Runner. This is the *only*
sense in which Vats within a Runner are synchronously coupled.

Objects within one Vat cannot synchronously invoke/access any objects/state
within any other Vat, whether in the same Runner or not. So, I would say
that Runners are units of concurrency, Vats are units of asynchrony, and
Compartments are units of unmediated direct access.



On Fri, Oct 17, 2014 at 9:37 AM, Allen Wirfs-Brock <allen at wirfs-brock.com>
Post by Boris Zbarsky
Post by Brendan Eich
Can you say more?
Vats as currently specified have independent event loops and allow
parallel JS execution, in the sense that they are totally disconnected from
each other and have separate run-to-completion guarantees.
Post by Boris Zbarsky
A window and its same-origin subframe have two separate WindowProxys but
can't really be separate Vats given the above, yes?
We've also talked about this in the other recent related thread.
As Vats are current specified (the ES6 spec essentially describes a single
Vat), the host is responsible for making Job scheduling decisions for each
Vat. This means that a host that is managing multiple Vats could impose a
synchronous scheduling policy that spans multiple Vats. This seems like it
may be sufficient to describe browsers behavior.
Allen
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141017/d964f06a/attachment.html>
Allen Wirfs-Brock
2014-10-15 21:18:41 UTC
Permalink
Post by Brendan Eich
realms and vats and ES jobs.
I like mixed metaphors as much as the next person, but srsly, can we talk?
Realm : Quest :: ??? : Job
Vat : Realm :: WindowProxy : Window
I'm not sure of these, help wanted fixing them and filling in the ??? slot -- but we have too many tropes. Please eliminate one or two.
Using the "Realm" metaphor domain, a "Vat" might more appropriately be call a "continent" (or perhaps an "isle". Baring political intervention, a human should be able to freely move from realm to realm on a continent. But to go from continent to continent requires some sort of extra continental connivance.

The ES6 spec. currently talks about realms and jobs, but doesn't mention "vats".

allen
Allen Wirfs-Brock
2014-10-15 22:26:16 UTC
Permalink
s/connivance/ conveyance/
Post by Brendan Eich
realms and vats and ES jobs.
I like mixed metaphors as much as the next person, but srsly, can we talk?
Realm : Quest :: ??? : Job
Vat : Realm :: WindowProxy : Window
I'm not sure of these, help wanted fixing them and filling in the ??? slot -- but we have too many tropes. Please eliminate one or two.
Using the "Realm" metaphor domain, a "Vat" might more appropriately be call a "continent" (or perhaps an "isle") Baring political intervention, a human should be able to freely move from realm to realm on a continent. But to go from continent to continent requires some sort of extra continental connivance.
The ES6 spec. currently talks about realms and jobs, but doesn't mention "vats".
allen
_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
Isiah Meadows
2014-10-17 20:09:09 UTC
Permalink
Where is the spec for this? I know I'm a little late to the game.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141017/d9d3d2fe/attachment.html>
Loading...