An off-topic thought:
In my computer architecture 2 class we are talking about performance in using caches, data prediction, branch prediction, and so on. Two main types of prediction are used, static, and dynamic. These kinds of prediction are very important as bad predictions could ruin the performance on any CPU very very significantly (as much as 80-90% less performance).
The static kind of prediction is done by the compiler and basically the compiler tries to identify how to resolve hazards, how to fill up the caches the best way possible and how to predict branches.
The dynamic kind is done by the hardware. The hardware uses the current information it has about the state of the CPU and the past information about running the program to more accurately predict branches and fill up the cache with the right things.
If done right the dynamic prediction is much more accurate than the static one because the hardware at run-time has access to registers, caches, etc that the compiler does not have access to.
My thought is: Python programs are both compiled and then interpreted. Couldn't Python use some static prediction during compile, and software-based dynamic prediction when it actually run the program?
More importantly the interpreter could store in the python-object-code the prediction information that arise from running the program the past times. This way the future times the program is run, the program will use the past info to run faster and to fill up the cache better.
I can see a time when interpreted languages as Python will run faster on simpler CPUs than compiled languages on the same CPU (or more complicated). The limitation of the compiler is inherent to its nature, and the difficulty of dynamically predicting things in hardware is also inherently difficult.
Python could use the research done in compiler prediction optimization, while also using the research done in dynamic prediction optimization.
It would take compiled languages a shift in paradigm to achieve the same benefits.