Minor questions on new module BNF
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
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss