Does the world need another v0.1 python compiler?

Grant Olson olsongt at verizon.net
Wed Feb 7 20:00:35 EST 2007


I'm feeling a little guilty here.  I spent a lot of my free time last year
working on an x86 compiler for python.  I made a reasonable amount of
progress, but my interests wandered off into other areas.  I basically just
got bored and stopped working on the thing maybe 6 months ago.  So today, I
went to the directory that contains all of my source checkouts, and saw this
v 0.1 compiler just sitting out there AGAIN.

It's not that I don't want to release the code, but it's just not in quite
good enough shape to just throw out there and hope that other people pick up
and get things working.  I've seen more than a few half-assed compiler
implementations out there and part of me thinks I'd just be wasting my time
by just zipping up what I have and throwing it out there.  Also, I don't
really expect any significant speed increases, which seems to be what people
want out of a compiler, but was primarily interested in creating standalone
.exes without the need for a 'runtime environment' (whatever that means).
There might be a little speed increase from unrolling the eval loop, but
nothing too serious.

The basic approach I took was compiling to bytecode, and then
transliterating python bytecode to x86 asm.  And it is working a little bit.
There is a slightly modified version of the CPython interpreter that
introduces xfunction and xcode objects, that basically act the same as
function and code objects, but run native code.  I've successfully generated
some very simple .pyds that can be imported into this interpreter.  I also
have some tests that test each bytecode on a small scale and they all seem
to be working.  I can just barely run pystones.  The biggest problem right
now seems to be that reference counting isn't adding up, resulting in some
serious performance degradation.

On the downside, right now it's Windows only.  There's nothing inherently
windows specific, but I don't have anything to build on other platforms.  It
also assumes you've got the visual studio toolchain.

So like I said, I feel a little guilty about keeping this thing hostage on
my systems at home.  On the other hand, if anyone else is interested,
they're going to need to be a VERY early adopter.

Does anyone have any serious interest in taking a look?

-Grant




More information about the Python-list mailing list