News for hackers. Stuff that matters.
Re:The cost of small modules by AWildDHHAppears on Monday August 15, 2016 @03:05PM (#12292646)
In pure functional programming, which is most of what I do, there are zillions of "small modules" and everything seems to work just fine...
Re:The cost of small modules by brandonbloom on Monday August 15, 2016 @03:25PM (#12292770)
The 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.