3 ms·
> Is there more terminology that means "to tree-shake"? Yes, everyone else calls this dead code elimination. [1] (the custom term isn't completely unreasonabl
by the_duke 6y ago
> Is there more terminology that means "to tree-shake"?
Yes, everyone else calls this dead code elimination. [1]
(the custom term isn't completely unreasonable, since tree shaking is somewhat different from how compilers do DCE)
https://en.wikipedia.org/wiki/Dead_code_elimination https://en.wikipedia.org/wiki/Dead_code_elimination
- Chris2048 6y agoThat page describes "dynamic" elimination, but let's say I call sqrt(x) in my module, but for a fixed value of x - in that case I can just replace the whole fn with a fixed value, but it would require me to detect that the fn is deterministic. Would that still count?
- geokon 6y agoAh okay. To me "tree shaking" was implicitly talking about the dependency tree and removing unused library dependencies. While "dead code elimination" would be a "deep" clean done by a linker when making a static binary (mostly C/C++ land..). There you're looking at a finer granularity than libraries/compilation-units. That's necessarily a bit trickier and I wasn't even thinking that far. But it seems the GraalVM compiler work on this level.