Hacker News new | ask | show | jobs
by julienpalard 1365 days ago
In someone lands here seeking a maintained compiler for Python, there's a lot, on top of my head:

- Pythran (https://pythran.readthedocs.io) (ahead of time compiler) - mypyc (https://mypyc.readthedocs.io/en/latest/) (ahead of time compiler) - cython (ahead of time compiler) - Numba (JIT) - Pypy (An interpreter doing JIT compiling) - Nuitka (Ahead of time, IIRC)

At this point we should build a "Awesome Python Compilers" repo ... oh wait, it obviously already exists: https://github.com/pfalcon/awesome-python-compilers

5 comments

Do any of these JITs/compilers help with machine learning model building? (Mentioned explicitly in the s6 repo)

e.g. PyPy doesn't work with PyTorch https://github.com/pytorch/pytorch/issues/17835

that's a good point, but it doesn't have full language support like the ones listed above
Yes, try Numba.
We are working on a Python runtime as well: https://github.com/oracle/graalpython
Would recommend checking out https://github.com/facebookincubator/cinder
mypyc is alpha at best, I wouldn't put it in list of recommondations.
Mypyc is stable for what it supports. Mypy itself is built with it. Black is built with it. I use it in production for some things, but use Nuitka for others. That decision is mostly down to a project's dependencies, not the project's own code. The more magic a Python module has, the harder it is to build AOT.
numba can now also support ahead-of-time compilation, in some cases