[pypy-dev] appspace considerations and genrpy

Christian Tismer tismer at stackless.com
Thu Nov 25 20:04:18 CET 2004

Hi Armin, all,

finally I realized that I'm doing way too much in my translation
efforts. It happened to me when I turned md5.py into RPython
using my prototypic genrpy transformer, that this is in many
cases not needed at all.
If you look at md5.py, you'll see that it *is* already almost
restricted Python. I can just move almost all functions
over to the interpreter level.

In a sense, md5 and sha do not really belong to the appspace modules.
Instead, they are almost ready internal implementations.
Just the interface to the exported objects and methods needs
to be created, to provide the importable builtin module.

How do we handle such things?
I guess such almost-interpreter level things should have a different
folder. The published module would simply be filled with app2interp
gateway calls to the internal stuff, or, well, directly
writing down the wrappers would be fine as well, I guess.

So my idea for cases like such is: Instead of transforming everything
from appspace into interpreter level, we can use stuff almost as-is.
Only non-trivial datatypes or unsupported features need to be
translated from app to interp. Please correct me if I'm wrong.
I was just shocked when I read the transformed MD5 source, like
"hell, what am I doing here, this is no app code at all!" :-)

Any ideas how to express the necessary actions?
Do we move those files elsewhere?
Do we use the __all__ attribute to name the interface stuff,
or do we simply add the interface things by hand?

thx & ciao - chris

Christian Tismer             :^)   <mailto:tismer at 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/

More information about the Pypy-dev mailing list