[PEAK] Using BytecodeAssembler

Aaron Lebo aaron.m.lebo at gmail.com
Mon Feb 18 19:24:14 EST 2008


Man, you sure have created some great libraries PJE. I am thoroughly
enjoying using them.

I've been using BytecodeAssembler lately. I'm finding the manual is pretty
solid but I am unclear on how to do a few things.
1. Say I am implementing an interpreter. Am I going to want to have a single
peak.util.assembler.Code instance for an entire file and continue to add to
it, or should there be multiple ones? Also how does Suite play into this?
2. What steps do I need to take to create a .pyc file out of a collection of
bytecodes?
3. How are individual Python literals represented by bytecode? I tried c =
Code(); c(1); exec c.code(), but found that was an invalid opcode, and I
actually  to add c.RETURN_VALUE() to get it to work correctly. Is it
necessary that c.RETURN_VALUE() is called for each literal?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eby-sarna.com/pipermail/peak/attachments/20080218/b349bbcd/attachment.html


More information about the PEAK mailing list