Ask HN: Why can't Python be compiled? The old answer was that types were not known in advance. However with Python 3.6, it's possible to give type hints. Given this, is there anything stopping Python being compiled natively? |
Ask HN: Why can't Python be compiled? The old answer was that types were not known in advance. However with Python 3.6, it's possible to give type hints. Given this, is there anything stopping Python being compiled natively? |
That being said the speedup from compiling your untyped python code is minimal, generally in the 0-40% range. However by adding types to your code you can often get significant speedups.
And Python actually is compiled. Where do you think these pyc and pyo files come from?