ES Modules: suggestions for improvement
dherman at mozilla.com
Wed Jun 27 09:45:54 PDT 2012
On Jun 27, 2012, at 8:46 AM, Isaac Schlueter wrote:
> I am not at all convinced that typo-checking is anywhere near worth
> the price tag, or is even a problem. Most of the alleged needs for
> type-checking are a bit dubious to me; that's not really what JS is
> all about.
But we're not even talking about type checking here, just *variable name* checking (although if we don't have static import/export we never will be able to even experiment with interoperable typed dialects of JS -- that door will be permanently shut). IME, a dynamic language with statically checked variables is a nice sweet spot. It catches the really simple errors, because while you may want to do all sorts of dynamic computations in a program, you always want the scoping structure to be fixed and static. But it leaves you free to do all the dynamic stuff you can do today.
> We should look at current
> common problems, and ask, "What is the minimum change to the
> language's semantics and syntax that will make *this problem* go away,
> without causing new problems, or preventing other solutions?"
Hill climbing is famous for reaching local maxima and getting stuck. We have to keep an eye on the longer term at the same time as we solve near-term problems. This is why I have worked for years (not in haste, as your blog post suggests) on a module system that addresses both today's problems and lays foundations for tomorrow.
More information about the es-discuss