
Hi, I hope the past sprint was fun and I was wondering if any kind person from it would like to give an overview of activities, developments etc.... please? That would be really great!! Thanks, Richard

Richard Emslie wrote:
I don't know much, but from pypy-svn checkin messages it seems the good place to start is to run: pypy/trunk/src/goal/translate_pypy.py You can see what options are available by passing -h (for help) to it. It will try to annotate and translate PyPy, and will also launch Pygame viewer to navigate some enourmous datastructures it produces. Lots of changes in annotation directory. builtin.py annotates some builtin functions' effect. Pygame viewer is at translator/tools/pygame. In translator directory, main changes were in genc.h (Macro and utility function definitions) and genc.py. appspace directory got file object written in Python, using low-level os module. Also MD5 and SHA module in Python. No doubt others will do much better job on this than me. :-)

Richard Emslie <rxe@ukshells.co.uk> writes:
Hmm, I was there and I could do with the same! :-) Reading pypy-svn is probably the best way to get an idea of what happened. Most of the work was on the annontator/translator, although there was some appspace stuff -- md5, sha-1 hashes and files, although files are not plumbed into the rest of pypy yet -- and the usual polishing of the standard objects space. On the annotator side, there seems to be a general feeling that we have roughly the right approach now, although there are still an unknown number of hopefully small details to work out. The translator basically works, but there are some nasty hacks knocking about and we haven't really tackled the gnarly issue of how to make use of type annotations (currently the annotator is only used to work out *which* functions are called, and the knowledge of *how* they are called is ignored). Evolution, not revolution, I'd say. Cheers, mwh -- MGM will not get your whites whiter or your colors brighter. It will, however, sit there and look spiffy while sucking down a major honking wad of RAM. -- http://www.xiph.org/mgm/

Michael Hudson wrote:
Well, let me add the little bits from my side. It took me long to get an understanding of everything since I was practically out of the project for half a year. Then I worked on a different topic which we had not touched yet, but it made some sense. I'm trying to generate interpreter level code from appspace code. That is, I run the flow machine over some python code which is *not* supposed to be restricted Python, but application code. The latter is used to implement lots of functions which would look nasty when implemented in RPython (see for instance _formatting.py, md5.py etc.). The idea is to do a flow analysis of these implementations without annotation and create RPython source code for that what the interpreter would have executed. The hope is that we *then* can apply the translator to this generated Python code, so it gets annotated, simplified and turned into C code. I'm still working on it, and there are a lot of things wrong or missing, but it gets better and will probably be ready in a couple of days. I guess it will be built in as a preprocessor, which compiles app code into interpreter code in some cache directory. Note that this transformation does not treat the app code as full Python, but again some restrictions apply: - globals are constant - methods never change - imports are done at compile time - exceptions are not generated if there is no try clause - imported stuff must obey the same restrictions
Evolution, not revolution, I'd say.
Yeah, but the results made me very positive about PyPy's future. ciao - chris -- Christian Tismer :^) <mailto:tismer@stackless.com> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/ 14109 Berlin : PGP key -> http://wwwkeys.pgp.net/ work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/

Hi, For a number of us, the sprint was a full week of running translate_pypy.py and wait for the next crash, then debugging and thinking and fixing and workarounding the issue. Then start again at step #1. In the last days it generally took some time (and lots of memory) before it ran into a problem and crashed. It also reported increasingly large amounts of warnings... well, more precisely, we turned increasingly many errors into warnings :-) These ones report problems that should eventually be fixed. This mostly occupied Marius, Holger, Michael and myself. (Cheers to Marius, btw, for having caught up so quickly with PyPy!) Some time in the middle of it all, the basic annotation-less 'translate_pypy.py -no-a' was able to compile and run (-6)*(-7) and successfully gave us the ultimate answer. I guess the next step here is to try to change the 'entry_point' so that 'translate_pypy' can actually compile and run the interactive command-line interpreter. Bob worked on more specific pieces of code: the user interface of the Pygame graph viewer (Marius did bits of that too), and the genc.py C code generation, which now generates code with tons of debugging features. The best one is probably that if the generated C code fails with a Python exception, you can use pdb.pm() to debug it! You see the C frames with the content of their variables, with line numbers set correctly. pdb will display extracts of the C source code in the tracebacks :-) Christian worked on using the flow graph analysis to understand application-level code and transform them to interpreter-level code. For example, each + in the source becomes an add operation in the flow graph (using the existing almost-unmodified flow object space), which then (this is Christian's work) gets translated as a space.add() by genrpy.py. This is useful for application-level helper code, for example string formatting, which is currently written in _formatting.py as regular, app-level Python code. The goal is to turn this nice piece of code into its obfuscated interp-level equivalent automatically. This is essentially an optimization only, which will allow the code to run a bit faster because PyPy's own interpreter doesn't have to interpret the app-level _formatting.py every time it has to do a string formatting operation. It also allows future more advanced optimizations. Jacob and Laura, who didn't feel like digging into the PyPy internals too deepdy, focused on reimplementing some of the C functionality in plain Python. We now have MD5 and SHA-1 and a 'class file' replacement based on low-level primitives (generally the 'os' module). You can play with the 'file' class by importing 'appspace/_file.py' in CPython. The general guidelines to integrate this kind of pure Python module with PyPy is: (1) try the module in py.py when it works in CPython, and (2) plug it -- for the 'file' class, it's done by inserting 'from _file import file' in 'module/__builtin__module.py'. Warning, this will probably be quite slow :-) Finally, we got news from the EU. In all likelyhood the project will really start on the 1st of December. Yippee! End of the phase 1 of the administrative overload! Now we have to plan for more closely-packed sprints. The next one might take place somewhere around the end of January in Switzerland. Last but not least, thanks to the Programmers of Vilnius for the excellent sprint organization! See you soon, Armin.

Richard Emslie wrote:
I don't know much, but from pypy-svn checkin messages it seems the good place to start is to run: pypy/trunk/src/goal/translate_pypy.py You can see what options are available by passing -h (for help) to it. It will try to annotate and translate PyPy, and will also launch Pygame viewer to navigate some enourmous datastructures it produces. Lots of changes in annotation directory. builtin.py annotates some builtin functions' effect. Pygame viewer is at translator/tools/pygame. In translator directory, main changes were in genc.h (Macro and utility function definitions) and genc.py. appspace directory got file object written in Python, using low-level os module. Also MD5 and SHA module in Python. No doubt others will do much better job on this than me. :-)

Richard Emslie <rxe@ukshells.co.uk> writes:
Hmm, I was there and I could do with the same! :-) Reading pypy-svn is probably the best way to get an idea of what happened. Most of the work was on the annontator/translator, although there was some appspace stuff -- md5, sha-1 hashes and files, although files are not plumbed into the rest of pypy yet -- and the usual polishing of the standard objects space. On the annotator side, there seems to be a general feeling that we have roughly the right approach now, although there are still an unknown number of hopefully small details to work out. The translator basically works, but there are some nasty hacks knocking about and we haven't really tackled the gnarly issue of how to make use of type annotations (currently the annotator is only used to work out *which* functions are called, and the knowledge of *how* they are called is ignored). Evolution, not revolution, I'd say. Cheers, mwh -- MGM will not get your whites whiter or your colors brighter. It will, however, sit there and look spiffy while sucking down a major honking wad of RAM. -- http://www.xiph.org/mgm/

Michael Hudson wrote:
Well, let me add the little bits from my side. It took me long to get an understanding of everything since I was practically out of the project for half a year. Then I worked on a different topic which we had not touched yet, but it made some sense. I'm trying to generate interpreter level code from appspace code. That is, I run the flow machine over some python code which is *not* supposed to be restricted Python, but application code. The latter is used to implement lots of functions which would look nasty when implemented in RPython (see for instance _formatting.py, md5.py etc.). The idea is to do a flow analysis of these implementations without annotation and create RPython source code for that what the interpreter would have executed. The hope is that we *then* can apply the translator to this generated Python code, so it gets annotated, simplified and turned into C code. I'm still working on it, and there are a lot of things wrong or missing, but it gets better and will probably be ready in a couple of days. I guess it will be built in as a preprocessor, which compiles app code into interpreter code in some cache directory. Note that this transformation does not treat the app code as full Python, but again some restrictions apply: - globals are constant - methods never change - imports are done at compile time - exceptions are not generated if there is no try clause - imported stuff must obey the same restrictions
Evolution, not revolution, I'd say.
Yeah, but the results made me very positive about PyPy's future. ciao - chris -- Christian Tismer :^) <mailto:tismer@stackless.com> tismerysoft GmbH : Have a break! Take a ride on Python's Johannes-Niemeyer-Weg 9A : *Starship* http://starship.python.net/ 14109 Berlin : PGP key -> http://wwwkeys.pgp.net/ work +49 30 802 86 56 mobile +49 173 24 18 776 fax +49 30 80 90 57 05 PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/

Hi, For a number of us, the sprint was a full week of running translate_pypy.py and wait for the next crash, then debugging and thinking and fixing and workarounding the issue. Then start again at step #1. In the last days it generally took some time (and lots of memory) before it ran into a problem and crashed. It also reported increasingly large amounts of warnings... well, more precisely, we turned increasingly many errors into warnings :-) These ones report problems that should eventually be fixed. This mostly occupied Marius, Holger, Michael and myself. (Cheers to Marius, btw, for having caught up so quickly with PyPy!) Some time in the middle of it all, the basic annotation-less 'translate_pypy.py -no-a' was able to compile and run (-6)*(-7) and successfully gave us the ultimate answer. I guess the next step here is to try to change the 'entry_point' so that 'translate_pypy' can actually compile and run the interactive command-line interpreter. Bob worked on more specific pieces of code: the user interface of the Pygame graph viewer (Marius did bits of that too), and the genc.py C code generation, which now generates code with tons of debugging features. The best one is probably that if the generated C code fails with a Python exception, you can use pdb.pm() to debug it! You see the C frames with the content of their variables, with line numbers set correctly. pdb will display extracts of the C source code in the tracebacks :-) Christian worked on using the flow graph analysis to understand application-level code and transform them to interpreter-level code. For example, each + in the source becomes an add operation in the flow graph (using the existing almost-unmodified flow object space), which then (this is Christian's work) gets translated as a space.add() by genrpy.py. This is useful for application-level helper code, for example string formatting, which is currently written in _formatting.py as regular, app-level Python code. The goal is to turn this nice piece of code into its obfuscated interp-level equivalent automatically. This is essentially an optimization only, which will allow the code to run a bit faster because PyPy's own interpreter doesn't have to interpret the app-level _formatting.py every time it has to do a string formatting operation. It also allows future more advanced optimizations. Jacob and Laura, who didn't feel like digging into the PyPy internals too deepdy, focused on reimplementing some of the C functionality in plain Python. We now have MD5 and SHA-1 and a 'class file' replacement based on low-level primitives (generally the 'os' module). You can play with the 'file' class by importing 'appspace/_file.py' in CPython. The general guidelines to integrate this kind of pure Python module with PyPy is: (1) try the module in py.py when it works in CPython, and (2) plug it -- for the 'file' class, it's done by inserting 'from _file import file' in 'module/__builtin__module.py'. Warning, this will probably be quite slow :-) Finally, we got news from the EU. In all likelyhood the project will really start on the 1st of December. Yippee! End of the phase 1 of the administrative overload! Now we have to plan for more closely-packed sprints. The next one might take place somewhere around the end of January in Switzerland. Last but not least, thanks to the Programmers of Vilnius for the excellent sprint organization! See you soon, Armin.
participants (5)
-
Armin Rigo
-
Christian Tismer
-
Michael Hudson
-
Richard Emslie
-
Sanghyeon Seo