News for hackers. Stuff that matters.
Re:Web frameworks are transforming from runtime libraries in... by cromwellian on Monday September 11, 2017 @04:43AM (#15217000)
It's not quite the same. It has some aspects of Google's module system in terms of de-duping (our internal version automatically splits up all code referenced in more than one place into a tree of synthetic modules) But Closure's optimizations go far beyond the "tree shaking" described here, which is really about pruning unused module dependencies.

Closure does pruning of methods, properties, etc at a fine grained level, moves code at a per-method level between modules, it computes whether functions have side effects and elides unused side-effect-free code, it does type-based optimizations (https://github.com/google/closure-compiler/wiki/Type-Based-P...), the list goes on and on. It's really like having GCC or LLVM for Javascript code. That's one reason why it's slow, because it does far more than the transpilers and minimizers out there.

(As many in another, GWT does many of the same things, being a fully optimizing true compiler)

Re:Web frameworks are transforming from runtime libraries in... by lennelpennel on Monday September 11, 2017 @04:48AM (#15217022)
I want to add that you can easily write your own compile pass for the closure compiler as well. All the optimisations described above are just compile passes.