Minor questions on new module BNF

Yehuda Katz wycats at gmail.com
Tue Jun 4 08:18:43 PDT 2013


On Tue, Jun 4, 2013 at 8:11 AM, Jason Orendorff
<jason.orendorff at gmail.com>wrote:

> On Mon, Jun 3, 2013 at 11:33 AM, Yehuda Katz <wycats at gmail.com> wrote:
>
>> I've advocated for this in the past. I believe it should be allowed.
>>
>> Separately, I would like this form to be specified as deferring execution
>> until bindings are explicitly imported (from another module), or a
>> synchronous `System.get` call is made.
>>
>
> It makes the static import language a bit more expressive, but why is it
> necessary?
>
> For performance? The alternative, if a module has expensive
> initialization, would be to have it initialize itself more lazily.
>
>  This would make it possible to guarantee that a synchronous `System.get`
>> will succeed, without being forced to execute the module first.
>>
>
>  It would definitely make that possible, but what `System.get()` use case
> are you looking to support? To my mind `System.get()` is like examining
> `$LOADED_FEATURES` in Ruby or `sys.modules` in Python; those use cases
> exist, but the kind of code you're writing when you touch those is
> typically either an egregious hack or it's generic across all modules,
> right? They don't need or merit syntactic support.
>
> I want to understand the motivation, because Domenic asked for syntax that
> just loads and runs a module, without bindings. It seems like we could
> support that feature with a tweak of the grammar, but you're proposing
> taking that exact syntax and using it for something else. I expect people
> trying to load and run a module will greatly outnumber people trying to
> load and *not* run a module.  Wouldn't we be astonishing more people by
> doing it your way?
>

I'm happy to give in here, but I'm nervous about how strongly Domenic wants
to connect the timing of imports with execution in people's minds.

If people actually write code like that, it's going to be a bad time.


>
>
> -j
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130604/8cf2fb65/attachment.html>


More information about the es-discuss mailing list