Once you have python installed in your system you need a set of standard libraries to help build applications. On python these are present in the Lib/ folder of your python installation. These are written in python and act as the building base of applications.
$git clone https://bitbucket.org/pypy/pypy
PyPy is a Python interpreter and just-in-time compiler. PyPy focuses on speed, efficiency and compatibility with the original CPython interpreter.[1]
PyPy started out being a Python interpreter written in the Python language itself. Current PyPy versions are translated from RPython to [C code](https://en.wikipedia.org/wiki/C_(programming_language) and compiled. The PyPy JIT compiler is capable of turning Python code into machine codeat run time.
It is defined in the file pypy/interpreter/pycode.py. Let us examine the fields of the class.
self.co_argcount
self.co_nlocals
self.co_stacksize
self.co_flags
self.co_code
self.co_consts_w
self.co_names_w]
self.co_varnames
self.co_freevars
self.co_cellvars
self.co_filename
self.co_name
self.co_firstlineno
self.co_lnotab
# store the first globals object that the code object is run in in
# here. if a frame is run in that globals object, it does not need to
# store it at all
self.w_globals
self.hidden_applevel
self.magic
It is very visibly similar to the PyCodeObject of Cpython.
It is defined in the file pypy/interpreter/function.py. Let us examine the fields of the class.
self.name
self.w_doc
self.code
self.w_func_globals
self.closure
self.defs_w
self.w_func_dict
self.w_module
It is very similar to the function object defined as a C structure in CPython.
It is defined in the file pypy/interpreter/pyframe.py
It is defined in the file pypy/interpreter/generator.py.
self.space
self.frame
self.pycode
Self.running
It is strikingly similar to the generator object of Cpython.
It is defined in the file pypy/objspace/std/intobject.py on line number 311.
It is defined in the file pypy/objspace/std/complexobject.py on line number 186.
It is defined in the file pypy/objspace/std/floatobject.py on line number 139.
It is defined in the file pypy/objspace/std/dictmultiobject.py on line number 360.
It is defined in the file pypy/objspace/std/listobject.py on line number 168.
The interpreter loop of pypy is located in the file pypy/interpreter/pyopcode.py on line number 145 which is the function dispatch_bytecode. It is very similar to the PyEvalFrameEx function which is the interpreter loop of Cpython.
