Remarks about module import

David-Sarah Hopwood david.hopwood at
Tue Aug 19 13:23:27 PDT 2008

David-Sarah Hopwood wrote:
> Brendan Eich wrote:
>> Asking whether new syntax pays for itself is ok, but the question 
>> becomes vacuous when the only demonstration against new syntax begs 
>> questions about usability and integrity.
> Integrity is addressed above: adding a few *more* names for which
> rebinding needs to be prevented makes no difference.
> What usability questions? I see no essential difference in usability
> between "provide({...});" and "provide ...;"

Actually, let me correct that. The former is more expressive, and
hence potentially more usable in some situations, because the
description of what is being provided can be a first-class value.
On the other hand, this increased expressiveness has the effect
that the set of provided names is in general not statically known.
It's not immediately clear whether or not this is something that
is useful to know statically (note that if modules are loaded
dynamically, then a hypothetical static analyser would not have
enough information to check that 'provides' clauses and import
clauses match up in any case).

So, there are some interesting semantic differences that might prompt
us to choose one approach over the other. If the distinction had been
only in syntax, then I would argue that the presumption should be not
to add new syntax unless it has much more compelling advantages than
simply avoiding two pairs of brackets.

David-Sarah Hopwood

More information about the Es-discuss mailing list