5 ms·
I mean why does `module` pull down resources? Shouldn't that be import's job?
by substack 15y ago
I mean why does `module` pull down resources? Shouldn't that be import's job?
- samth 15y agoThere are two reasons: 1. `module` is about defining the modules that you're using in your program, some of which might be remote resources. `import` is about bringing names into scope. 2. Using `module` this way lets you, the client, decide on names for modules, which means we don't have to rely on module authors to come up with and use naming conventions (net.substack.airport, anyone?). This feeds back into 1, where we use bindings to reference modules, even remote ones. Also, if a module is never referenced or imported, then the resources shouldn't need to be pulled down at all. So partly it depends on the way you look at things.