Module isolation

Mark S. Miller erights at
Mon Jan 18 12:54:55 PST 2010

On Mon, Jan 18, 2010 at 12:43 PM, Brendan Eich <brendan at> wrote:

> On Jan 18, 2010, at 12:27 PM, Mark S. Miller wrote:
>  Since I do not yet understand what you are trying to say, I may be the
>>> wrong person to guess why I'm finding it hard to understand ;). Altogether,
>>> my best guess right now is that what you are calling a module is what I
>>> would call a sandbox.
>> Could be. Is there a hard difference? It's not obvious.
>> Users definitely want isolated frame-like "modules". Some browsers even
>> support such things, with postMessage for safe inter-"module" communication.
>> It's a bit heavyweight, but to get back to the topic of this sub-thread: is
>> the only alternative frozen primordials? I think not.
>> I never said they were. Whether Valija specifically is the right model for
>> separating primordial mutation, we can of course argue about. But first, I'm
>> still trying to understand your meaning. Would you agree that the Valija
>> sandbox is an example of the concept you are calling "module" above? If so,
>> then fine. Obviously, given the investment we've made in Valija, I am not
>> opposed to that model. If not, then I still do not understand your meaning.
> I don't believe I've been unclear. I also don't believe I have to read up
> on Valija to communicate with you. Let's meet in the middle.
> JS has mutable primordials. Adding modules won't banish this feature, even
> if you think mutating primordials should be avoided (ES5 makes it possible
> to mutate without breaking things like for-in).
> If you insist on frozen primordials for modules to be used,

I am not yet insisting on anything. I am still trying to understand what you
are talking about. If you have not been unclear, then my failure is my
fault, fine. That doesn't help me understand.

> then we'll have to define and agree on sandboxes. But whatever you call
> them, if you miss the mark with frozen-primordial modules, users will not
> use them and we'll have wasted our time.
> Another possibility, with precedent in other languages, is two levels: the
> outer module system, acyclic and generally bigger by unit; and the inner
> one, with first-class modules. There is not good agreement on the name for
> the outer thing. If you want we can say sandbox.
> One could imagine cooperating modules sharing mutable primordials within a
> sandbox, and of course not sharing primordials across the sandbox boundary.
> Again the point is that frozen primordials should not be dictated.
> I have not proposed to dictate this.

> Sorry if this is annoyingly recapitulating Valija. The list is read by many
> people, not all conversant, and in order to avoid assuming too much, I
> believe we should try to work from broader precedent and first principles.
> I'll look at Valija later today.
> Thank you. Once you and I understand each other, I'm sure we can proceed to
explain and argue without assuming a detailed understanding of Valija by the
broader audience.

> /be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list