kdex (2016-01-07T16:58:06.000Z)
forbes at lindesay.co.uk (2016-01-08T16:02:22.596Z)
Reply inline. On Donnerstag, 7. Januar 2016 17:30:08 CET, Lorenzo Ferrara wrote: > Dear Ecma International, (and Dear readers, as I don't exactely know who > will read this mail) Actually, you're posting to a mailing list whose members may include whoever subscribes to it. But skimming over your text, this seems like the right place to discuss your issues. > 1) "import" requires the name of the library to be > known at "compile-time", which takes away a bit of > dynamism from ES. This was a deliberate design choice, since this goes hand in hand with static code analysis. Although slightly outdated, you might want to read [this](http://www.2ality.com/2014/09/es6-modules-final.html). If you DO need to dynamically import modules, have a look at the [Module Loader API](https://whatwg.github.io/loader/#loader-import) (which introduces a global variable named `System`, allowing for these kinds of things). You can read about it [here](http://exploringjs.com/es6/ch_modules.html), starting with section 16.5. > 2) imports shouldn't be synchronous The Module Loader API is actually promise-based, which makes this point moot, I suppose. > 3) imports shouldn't have their own syntax First of all, I strongly disagree: New syntax can't always be transpiled, since sometimes, there's no way to express it in an earlier version of the language (compare `Proxy` for instance). This isn't a bad thing; it's actually really important to a lot of us to extend the descriptive power of the language, especially since JS has become a "transpile-to language" for many other languages. Now, how to load modules isn't actually part of ES6 but has been deferred to the Loader API. You might want to check out SystemJS if you need something close to what browsers will implement soon. Right now, what you need to do when transpiling your code is also transforming it into your module system of choice (AMD, CommonJS, SystemJS, UMD, your custom system, …) before handing it over to environments such as browsers. Babel is very capable of doing this, and it has been for over a year, IIRC. > 4) I don't think a library should be a singleton. Rather, libraries should > be kind of instantiatable classes. What do you mean? Something like: ```js import jQuery from "jquery"; let jQueryInstantiation = new jQuery(); ``` seems overly verbose to me, at least for the sole purpose of getting an instantiation of jQuery. It seems like this is rather something a person with a Java-esque background would do. There are often times where librarys are really instantiable [classes](https://github.com/tvcutsem/harmony-reflect), so what's your point exactly?