3 ms·
In pure functional programming, which is most of what I do, there are zillions of "small modules" and everything seems to work just fine...
by AWildDHHAppears 10y ago
In pure functional programming, which is most of what I do, there are zillions of "small modules" and everything seems to work just fine...
- brandonbloom 10y agoThe problem isn't (necessarily) small modules, it's the _dynamics_ of the Common.js (and similar) module systems. By conflating fully general, extensible, dynamically typed objects with both namespaces and modules, the semantics can't be constrained enough to perform certain kinds of both intra- and inter-module optimizations at compile time. By contrast, the Google Closure compiler's module system (also for JavaScript) does not suffer from this problem, but in tradeoff, disallows many types of runtime metaprogramming, such as merging modules with Object.assign or similar.