[pypy-dev] Application-level helpers
holger krekel
hpk at trillke.net
Wed Jul 9 20:27:02 MEST 2003
Hi Christian,
[Christian Tismer Wed, Jul 09, 2003 at 06:14:18PM +0200]
> Armin Rigo wrote:
> > This clarification also means that it is an independent issue to know what we
> > should write by strictly sticking to RPython or not. Application-level code is
> > essentially just a way to avoid wraps. All interpreter-level code should be in
> > RPython, but then some application-level code could be easy enough for the
> > analyzer to understand too. If they are, the code generator can make efficient
> > code from them too (cool!), i.e. it would not matter if the code was defined
> > at interpreter-level or application-level. For very complex helpers, there is
> > always the option to fall back to emitting frozen bytecode and interpreting
> > it.
>
> Very very cool implications!!
>
> Let me try:
> If the analyser is able to produce interpreter-level
> code from application-level code in an efficient
> way, then this is the equivalent of producing
> C code from a Python function, in the "real world".
I'd say it's even slightly better. The analyzer should be able to
produce interpreter-level pyrex-annotated python code. From that we get
C-level code that "really runs" and can possibly be imported from cpython!
I think that could even be worth a first "development release".
It's probably only <picks some random number> 50 times slower or so :-)
> Furthermore, since the interpreter-level code is
> actually what is "the C library", this code
> can now be optimized for a specific Python function.
It at least means that using the builtins from a python-function
shouldn't spoil optimization efforts. If the AnnSpace would annotate
any python code (interpreter-level, app-level, RPython, whatever[*]) then
this might even have further implications. And somehow aiming at
this goal seems simpler because you know what you need to provide :-)
(but i don't really know how feasible this is, does anyone?)
> In other words, we have broken the "C library barrier",
> and reached one of the most ambitious goals of this
> project. (In theory. We just need the analyser :-)
i like to believe that, too, but there are still some
vaguenesses to fight :-)
cheers,
holger
[*] 'whatever' possibly the app-space itself so that it also
can pass through its machinery
More information about the pypy-dev
mailing list