3 ms·
Aren't you effectively asking the compiler to solve the halting problem? I think the best you could do would be heuristics - having inferred or user-supplied b
by Zelizz 7y ago
Aren't you effectively asking the compiler to solve the halting problem?
I think the best you could do would be heuristics - having inferred or user-supplied bounds on the complexity of functions, having rough ideas on how disk or network latency will affect the performance of functions, and bubbling that information up the call tree. It wouldn't be perfect, but it could be useful.
- staticassertion 7y agoCompilers can "avoid" the halting problem if the underlying language is not turing complete/ can express function totality. You can even express algorithmic complexity in a language. But it's a bit more complex than that, really. You will have a harder time saying "this loop will block the event system for longer than I'd like".