May 23, 2004

Moving right along

As I've been digging through the python bytecode decoder I found out where things were going "wrong" with it. As it turns out they weren't, there were just a few sensible but incorrect assumptions made in the decoding code. (Mainly that there's only one code object, which turns out not to be the case) It also explains why dis.py and Python::Bytecode were giving different answers--dis.py decodes the first code object in the file while Python::Bytecode got the last one. The fix is a touch convoluted, but not too bad to do.

Oh, and I've got about half the python bytecode instructions having direct parrot equivalents after doing a bit of stack-to-register decoding. The easy ones, of course, but you've gotta start somewhere. (I think I'm going to have to implement a good chunk of extended-precision math for this, since that's part of the python core. Parrot's got some that needs some swamping out, so I'll probably start there)

Posted by Dan at May 23, 2004 04:15 PM | TrackBack (0)
Comments

Don't know if there is anything there you can use, but I ran into some problems with Simon's Python Bytecode module back in 2003, and wrote this

http://www.gregorpurdy.com/gregor/gw/by-entry/000476.html

(see also http://www.gregorpurdy.com/gregor/sw/Python-Bytecode-SAX/)

Posted by: Gregor N. Purdy at June 8, 2004 12:27 AM