[pypy-svn] rev 864 - pypy/trunk/doc

anna at codespeak.net anna at codespeak.net
Sat Jun 21 18:02:09 CEST 2003


Author: anna
Date: Sat Jun 21 18:02:08 2003
New Revision: 864

Added:
   pypy/trunk/doc/ObjSpc.txt
Log:
add ObjSpc.txt

Added: pypy/trunk/doc/ObjSpc.txt
==============================================================================
--- (empty file)
+++ pypy/trunk/doc/ObjSpc.txt	Sat Jun 21 18:02:08 2003
@@ -0,0 +1,39 @@
+=====================
+PyPython ObjectSpace
+=====================
+
+See ObjectSpaceInterface_ for a draft version of the interface specification to ObjectSpace objects.
+------------------------------------------------------------------------------------------------------
+
+In a Python-like language, a running interpreter has three main parts:
+
++ the compiler, which represents the static optimization of the source code into an intermediate format, the bytecode;
++ the object library, implementing the various types of objects and their semantics;
++ the main loop, which suffles data around and calls the operations defined in the object library according to the bytecode.
+
+The main loop generally assumes little about the semantics of the objects: they are essentially black boxes (PyObject pointers). The interpreter stack and the variables only contain such black boxes. Every operation is done via calls to the object library, like PyNumber_Add().
+
+In PyPy, the three parts are clearly separated and can be replaced independently. I will discuss below the reasons I think it is very useful to have, in particular, the object library be replaced. We call object space such an object library. The standard object space is the object space that works just like Python's, that is, the object space whose black boxes are real Python objects that work as expected. We will call wrapped objects the black boxes of an object space. 
+
+Here are four examples of object spaces:
+
+- TrivialObjectSpace_
+- StandardObjectSpace_
+- AbstractObjectSpace_
+- TranslateObjectSpace_
+
+(We should also talk about turning the compiler and the main loop into explicit concepts, as Rocco discussed in pypy-dev.)
+
+I believe that the above examples should give a hint at why we might really want object spaces that behave differently: this is called abstact interpretation in the litterature. But there are also more funny ways to use object spaces, for example:
+
++ running with several object spaces at once, to clearly separate the data into domains
++ proxy object spaces, which forward all requests over a network to a "Python object server"
++ and more... there have been numerous ideas in pypy-dev.
+
+------------
+
+.. _ObjectSpaceInterface: ObSpIntfc.html
+.. _TrivialObjectSpace: TrivObSp.html
+.. _StandardObjectSpace: StObSp.html
+.. _AbstractObjectSpace: AbObSp.html
+.. _TranslateObjectSpace: TranObSp.html


More information about the Pypy-commit mailing list