Minor questions on new module BNF
jason.orendorff at gmail.com
Tue Jun 4 08:11:40 PDT 2013
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss