I heard that PyPy has its own JIT compiler. I'm thinking of implementing a language using PyPy's translator script to convert the RPython to C. So I was wondering, where does PyPy run? Can it run everywhere Python does? Or can it only run on specific CPUs?

有帮助吗?

解决方案

Reading the RPython source code, it seems that currently x86 and ARM (both 32/64 Bit) are supported for the jit.

Without a jit, it should be every platform that sports an ANSI C compiler, or better, a GCC compatible one. Pypy is translated to plain (but not easily to read for humans) C.

其他提示

Yes, you can run PyPy everywhere where you can run Python:

PyPy is implemented in RPython.

The R stands for Restricted. RPython is a subset of Python. So any Python interpreter implementation should be able to interpret and run RPython code. So everywhere where you have an interpreter that can run Python code, you can run PyPy.

But that would be dog slow. You would use a Python interpreter (CPython, Jython, IronPython) to run another Python interpreter (PyPy) to run your Python code.

That is why when you build PyPy from source you translate to C code and compile that.

Watch Dave Beazley's Keynote of PyCon US 2012 to have an entertaining introduction of what really happens.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top