[pypy-dev] enabling marshal

Christian Tismer tismer at stackless.com
Sat Aug 6 12:56:22 CEST 2005


Some small issues which came up when I enabled marshal:
-------------------------------------------------------

a dict that never gets a value does not create an
emptydict, but rtyper crashes. This happens easily,
when code is disabled, temporally.

os.write does not know that it returns a nonnegative int.
I think we should have a way to express this instead of
putting assertions.

A funny observation on stringobject: The RTyper did not
know how to handle mul_str_times. That should imply that
marshal pulled this code in, what I don't understand,
because I thought all multimethods would be instantiated.
I had to initialize the buffer list in the exception case.
But later on, I removed this hack and it still worked.
Later it was needed, again, so I finally kept it with XXX.
Strange interaction, must have been a side effect.

I would love to use rpython dicts of integers for caching
ids of objects. Is this hard, or bad?
Should I use a real dict, instead?

Addendum: I don't really see why we have more than one
dict implementation at all. In a way, they all share
the same basic layout. How hard would it be to factor
this out and create the dicts we need, regardless if
we are doing rtyper dicts or applevel dicts? It could
be possible to do this with specialization.

Translation works, but it is a huge batch run, very
unpythonic so far. I would like to get into a direction,
where we start to isolate modules for seperate compilation.
One possible candidate would be marshal. We would need
of a way to spell that something is not here, yet, like
a stub for marshal's exported methods that raises or
redirects to an applevel implementation.

I'm anyway very impressed how great this all works, folks!

-- 
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