Modules: Name capture
dherman at mozilla.com
Wed Jun 2 12:14:13 PDT 2010
> I don't have the time or inclination to provide a full bibliography.
> I consider your argument withdrawn, then.
Excuse me? My argument is not "withdrawn" (are we in court?). If you are unaware of decades of prior art on modules, that's not my failing but yours.
My argument was and remains that others have gone down that road, and it's still very much an open research topic how to create module systems that provide the generality of explicit linking with the convenience of implicit linking. See e.g. Derek Dreyer's work, starting with his thesis and continuing to this day.
> Possibly, depending on whether you want to present modules to themselves as well.
> As I believe we discussed in our most recent f2f, it is possible to provide modular code with access to its own reified module instance via some distinguished symbol (e.g., "this" at the top level). And of course, modular code always has direct individual access to its own exports.
> As recast, therefore, the example introduces Odd to "even.js" and Even to "odd.js". It's pretty minimal.
And yet it's still too expensive. No one will take the step from non-module code to module code. They just won't. Besides, a not-quite-so-bad example of the Odd and Even modules is pretty weak tea.
The point is, you can special-case "this" if you want, but if you have a module graph of N modules, and each needs to be explicitly linked with N - 1 other modules, then you impose a quadratic code-size requirement on programmers. Unless, as I said, you beef up your linking-specification language.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss