3 ms·
Hum... You are getting lost on theoretical undecidability. On the real world, when faced with a generally undecidable problem, we don't run away and lose all h
by marcosdumay 5y ago
Hum... You are getting lost on theoretical undecidability.
On the real world, when faced with a generally undecidable problem, we don't run away and lose all hope. We decide the cases that can be decided, and do something safe when they can't be decided.
On your example, Python can just re-optimize everything after an eval. That doesn't stop it from running optimized code if the eval does not happen. It can do even more and only re-optimize things that the eval touched, what has some extra benefits and costs, so may or may not be better.
Besides, when there isn't an eval on the code, the interpreter can just ignore anything about it.
- dataflow 5y ago> You are getting lost on theoretical undecidability. [...] We decide the cases that can be decided, and do something safe when they can't be decided. I'm not lost on that at all; I'm well aware of that. that's precisely why I wrote >> [...] require a ton of static analysis on the source or bytecode that I imagine will at best be slow, and at worst impossible due to the halting problem and not >> static analysis is impossible in the general case so we run away and lose all hope. I'm not sure how you read that sentiment from my comment.
- marcosdumay 5y agoHum... Ok. Then the answer is that most cases do not demand as much analysis time as you expect, and the ones that demand more still can gain something from dynamic behavior analysis in a JIT. Also, you can combine the two to get something better than any single analysis alone.