Re:Safe dead code removal in a pure functional language
by mhh__ on Thursday January 28, 2021 @07:48PM
(#25951991)
Turing proved the answer is no.
Computer programs can have remarkably simple semantics.
All compilers do is analyse dependencies (or a lack of) and do things to exploit them or their absence. The algorithms that do that are inherently not able to solve the halting problem, but that clearly doesn't hurt or we wouldn't have processors at all.
You can all kinds of useful stuff without Turing completeness - eBPF code for example is guaranteed to terminate.
But the true question is: can an algorithm figure that out?