[pypy-dev] Annotating space status
arigo at tunes.org
Mon Jul 7 11:40:58 CEST 2003
On Sun, Jul 06, 2003 at 11:37:50PM +0200, Günter Jantzen wrote:
> BTW I remember one of our goals was to target not only C.
> I see a danger when RPython mimicries to much C (in its informal
> definition - see code examples below).
> Maybe I miss *again* the point, but I think at this time we can't know if
> "append" will be mapped to "realloc".
You are right about this. Your example for repr__String() shows easily enough
that sticking to C-like code too closely leads to bad code (more complex and
obscure and much more error-prone).
We may extend RPython to allow more operations, or alternatively to avoid code
duplication we may use the objects we have already defined in stringobject.py
and listobject.py to do that, and write more operations as helpers. For
example, the first version of repr__String() would be nice as just an
application-level function. Similarily, an algorithm that needs a lot of
list.append() can be written at the application-level, where it is not
restricted at all.
Turning helpers into something efficient at translation time is a different
issue (Holger is working on some cool ideas about them) than merely extending
the definition of RPython.
More about it later...
More information about the Pypy-dev