4 ms·
Language theory question: In the case of JS is there a safe, but still useful, subset of the language where dead code elimination could be improved? Ignore if
by Spivak 9y ago
Language theory question: In the case of JS is there a safe, but still useful, subset of the language where dead code elimination could be improved?
Ignore if it can be detected or not, we'll pretend that the author has to certify that they followed your subset and didn't do X, Y, or Z. If they disobeyed your rules then all bets are off and the result is undefined.
- majewsky 9y agoI'm afraid it won't help much to restrict the language. For optimal dead-code elimination (aka tree shaking), you need human-level intelligence. Here's an example I posted yesterday in the thread about iOS app bloat: https://news.ycombinator.com/item?id=14618324 https://news.ycombinator.com/item?id=14618324