3 ms·
How does a programming language "win" against a code minifier? Typescript and Closure compiler solve entirely different problems, they are not in any way altern
by nikitaga 3y ago
How does a programming language "win" against a code minifier? Typescript and Closure compiler solve entirely different problems, they are not in any way alternatives to each other.
It's not like Typescipt somehow solved code minification in a way that made Closure compiler redundant. It's still used where it makes sense (e.g. to compile Scala.js output, although other solutions like terser.js work too).
- epolanski 3y agoClosure does static analysis too, the fact that the types are shoved in comments thus allowing the files to be used as-is in JS is more of a technical nuance not different from the flow programming language by Facebook, or JSDoc-driven TypeScript.
- nikitaga 3y agoAh! Right, I forgot that using JSDoc-style comments for static type checking was a thing back then. Nowadays we just feed Scala.js output to Closure compiler for it to optimize and minify, it would be too painful to write such comment-centric code manually. But we didn't have that many good options back then.