ES Modules: suggestions for improvement
David Herman
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.
Well, "not JavaScripty" is a circular argument.
JavaScript serves many communities. One community we talk to is game developers that get a lot of mileage out of static types in other languages, and would love to have a typed dialect of JS. Then there's people who use the Closure compiler, which adds a type discipline to JS.
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.
Dave
More information about the es-discuss
mailing list