Module system strawpersons

Kam Kasravi kamkasravi at
Tue Jan 19 06:27:54 PST 2010

Understood, yes I'm familiar with Neil Mix's NarrativeJS. Sorry for the misinterpretation of your comments
as well as the import strawman. Lazily fetching imports in this way could force preemption in many places. 
Were there any es4 strawman's that suggested a similar deviation from the run-to-completion model?


From: Brendan Eich <brendan at>
To: Kam Kasravi <kamkasravi at>
Cc: "ihab.awad at" <ihab.awad at>; Oliver Hunt <oliver at>; kkasravi <kkasravi at>; es-discuss <es-discuss at>
Sent: Mon, January 18, 2010 8:40:15 PM
Subject: Re: Module system strawpersons

On Jan 18, 2010, at 6:14 PM, Kam Kasravi wrote:

> I guess Brendan is saying that if a continuation was natively built ar the '.' then the risk is that not acquiring the resource would result in a zombie. But if the runtime could build a continuation at the '.' then it could come back to it when the resource was acquired. Brendan is that layman's description or did I get it wrong?

That's not wrong, but it does not consider the preemption point. Scripts in browsers today (event handler or timeout functions, same deal) run to completion. They do not race or nest event loops (bugs notwithstanding). So you can be sure a global variable you've just set to 42 will still be 42 after a call to a function.

We could break this model at the . whose left-hand side was (import M) but should we?

Neil Mix's NarrativeJS used -> instead, to signify the difference. I do not propose we break the run-to-completion model implicitly, or add explicit syntax for doing so. At least not without a lot more discussion.


> Kam
> On Jan 18, 2010, at 5:52 PM, ihab.awad at wrote:
> On Mon, Jan 18, 2010 at 5:43 PM, Oliver Hunt <oliver at> wrote:
> It's also horrific in the context of a browser as it's effectively an arbitrary
> length call blocked on IO.
> That's a good description of what I was proposing. Yes it would block
> the event loop. Perhaps it could be useful if (say) the module were
> available in a local disk cache but not loaded into memory: the cost
> of I/O to a disk cache may be reasonable, but not the cost of a
> completely new fetch from the network.
> Ihab
> --Ihab A.B. Awad, Palo Alto, CA
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list