Hi, as many of you have heard, there is an ongoing effort to add JIT to CPython as PEP 744 (PEP 744 – JIT Compilation | peps.python.org).
I think that the recent efforts to make Python faster have very good results, but the effort behind JIT can be better directed toward AOT because then runtime facilities can be embedded, eliminating the need for an external VM, which is the modern approach to streamline deployments, and it will open the door for better optimizations and performance enhancements, even if not in the near future.
Now, I have read some reactions to such ideas here and there, and I would like to reply in advance:
1- “Python is used by many for scripting and automation, not just for applications and systems”: CPython can still serve REPL and execute scripts; AOT is about the compiling process to produce optimized machine code (e.g using LLVM) in the form of platform-dependent executables.
2- “Python is a dynamic language, and it should stay true to its spirit…etc”: Python is first and foremost a general-purpose programming language with “dynamic typing,” which means type resolution is at runtime. Most modern programming languages have dynamic typing capabilities—Go, Swift, Rust…etc.—just to name a few. So, I don’t think that dynamic typing is why people use and, in my case, love to use Python. I think Python’s elegant syntax and the processes and the humble culture around it are what made Python attractive, not dynamic typing per se, which many of its users really don’t understand well.
3- “There are already many compilers for Python”: The center of Python’s community is the Steering Council and PEP process. People will hesitate to adopt any solution and integrate it into a production environment if it is not widely known and supported by the community unless it is an urgent necessity and with willingness and expertise to deal with any unexpected issues that may arise.
3- “There are many programming languages out there, use some language x instead”: I am not stuck with Python, and Python is not the only language I know and use, but Python is the one I love to use, and I would like to use it exclusively without the need for workarounds and patchwork things here and there using other programming languages.
So, I think that JIT is too old to be the future, and AOT would be a better investment, with better outcomes in the long run.