On Thu, Jan 27, 2011 at 7:27 AM, David Herman <dher...@mozilla.com> wrote:
> We thought for a while about
> demand-driven evaluation of modules. There are a couple reasons why I
> believe it would be too problematic. First, we'd really like to make the act
> of throwing your code into a module as transparent as possible; changing the
> control flow would make modules more heavyweight. But more importantly,
> since as you mentioned, module evaluation can contain arbitrary side
> effects, evaluating them lazily means laziness with side effects. This makes
> for really hard-to-understand and hard-to-debug initialization errors, where
> you end up having to write mysterious top-level imports to force evaluation
> of modules in particular orders. Laziness + side-effects: bad scene, man.

On the opposite side of the argument, I presume that this means that
modules are evaluated when their transitive dependencies are loaded.
This would imply that the order in which the modules are delivered,
possibly over a network using multiple connections, would determine
the execution order, which would in turn be non-deterministic.
Non-determinisim + side-effects is also a bad scene.

Is there an alternate method proposed in Simple Modules for
deterministically linearizing the evaluation order? Non-determinism is
definitely a greater evil than providing developers a means to
explicate the order in which they would like their side-effects to be
wrought.

Kris Kowal
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to