Using the pypy compiler

Is there any difference in python programming when using only python and when using the pypy compiler? I wanted to try using pypy so that the runtime of my program would get faster. Does all the syntax that works in python also work in pypy? If there is no difference, can you tell me how I can install pypy on debian lunux and some examples of use on pypy? Google does not contain much information about pypy, except for the description.

+6
source share
2 answers

On the pypy functions page:

PyPy 1.9 implements Python 2.7.2 and runs on Intel x86 (IA-32) and x86_64, with ARM and PPC. It supports all core languages ​​by passing the Python test suite.

This means that almost any code written in Python 2.7 will work. The only exceptions worth mentioning are some python extensions written in C, such as numpy .

Installation should be quite simple, you can download a Linux file here . Then just remove the interpreter. From now on, you can run your python programs, similar to how you run them using a regular python interpreter.

On the command line instead:

 python my_program.py 

Using:

 path/to/where/you/installed/pypy my_program.py 

Examples of how / why you can use pypy, see this video from PyCon 2012.

+11
source

pypy is a compatible alternative implementation of the python language. This means that there are several (intentional) differences. One of the few differences is that pypy does not use reference counting. This means, for example, that you must manually close your files, they will not be automatically closed when your file variable goes out of scope, as in CPython.

+2
source

Source: https://habr.com/ru/post/925442/


All Articles