Fixed in r17210.
for Get python bytecode translator done
and Pass the pie-thon test suite. Are these still active
waypoints on the roadmap, or should we remove them?
Pm
Well, we were shooting for an end-of-August release, but needless to
say that's not happened. Both Leo and my translators were reasonably
near completion, and need to be pushed that final bit of the way.
Neither of us have the time, so... Anyone want to take a shot? Leo's
builds faster code
After spending a couple of hours looking at Python::Bytecode and the
Python source, I decided I didn't like the module. So I wrote my own.
I decided Bytecode::Python would work nicely for the name, though it's a
bit close to the namespace. I basically redesigned it, so it should be a
little
Leo --
I had tinkered around with this stuff back in 2003, and ended up writing
Python::Bytecode::SAX to help me visualize bytecode. IIRC, I ran into
the same issue of only disassembling one code block. I'd be interested
to know if P::B::S treats your example python bytecode any better than
P::B
On Mon, 12 Jul 2004, Gregor N. Purdy wrote:
Leo --
I had tinkered around with this stuff back in 2003, and ended up writing
Python::Bytecode::SAX to help me visualize bytecode. IIRC, I ran into
the same issue of only disassembling one code block.
I've finished up (yay, free time at lunch
The last rev of Python::Bytecode is up and available for poking at.
http://www.sidhe.org/~dan/Python-Bytecode-2.3.tar.gz if you want it.
Handles multiple code objects in a file now (woo!) as well as actually
supporting Python 2.1 and 2.2. I think. Tests would be in order, but I
haven't actually
Fixed a bug in the damn thing (that I'd introduced) and fixed the tests to
actually test properly, including both a Python 2.2 and 2.3 format
bytecode file in the archive.
Rather than mail the thing to people *again* I've just stuck it up for web
snagging.
http://www.sidhe.org/~dan/Python
Still a bit lacking, 'specially in the documentation department, but I've
got a version that sucks much less than it did, and is possibly even
correct. (Go figure. Surprised me, too... :)
Anyway, if you want to fiddle,
http://www.sidhe.org/~dan/Python-Bytecode-2.2.tar.gz and have
this a
shot. I don't know much about byetcode, but I'd love to save Dan from a
pie in the face (from what I gather he's had a rough go of it lately).
Maybe you could give me an example of some input and the correct output?
Or some documentation?
I've checked out parrot and installed Python::Bytecode, so
... is on CPAN (said Dan) and is broken. I'd be glad if people could fix
it and send me a running version ;)
* constants are messed up
* it doesn't disassemble all code objects of a .pbc - just one
$ cd languages/python
$ perl pie-thon.pl -dD some.py
shows more (and AFAIK correct) Python
Dan Sugalski [EMAIL PROTECTED] wrote:
The translation for a number of the python ops depends on whether
we're going with runtime stack action or compile-time stack-register
translations.
My experiments[1] show that the latter should be doable, the more because
...
BINARY_op:
restore
On Mon, 2004-07-05 at 19:27, Dan Sugalski wrote:
UNARY_NEGATIVE: restore $Px; new $Py, Undef; $Py = $Px * -1; save $Py |
$Px = -1 * $Px
Wouldn't something this do what is desired? I'm just guessing, though.
Brian
, it's ASCII)
For ops that take a parameter, the parameter name is in lower
case. These are part of the op stream in the python bytecode.
STOP_CODE: end
POP_TOP: restore $Px | noop
ROT_TWO: rotate_up 1 | noop
ROT_THREE: rotate_up 2 | noop
ROT_FOUR: rotate_up 3 | noop.
DUP_TOP: lookback Px, 0
# New Ticket Created by Dan Sugalski
# Please include the string: [perl #25854]
# in the subject line of all future correspondence about this issue.
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=25854
Simon Cozen's got a Python::Bytecode module on CPAN which
disassembles python
Or at least I can't get it going. Fixing it's a project for the
interested. (I'd ask Simon but, well, he doesn't do that stuff any
more)
--
Dan
--it's like this---
Dan Sugalski
16 matches
Mail list logo