[Python-Dev] Re: native code compiler? (or, OCaml vs. Python)

Skip Montanaro skip@pobox.com
Mon, 3 Feb 2003 14:47:33 -0600


    >> I'd help play around with rattlesnake.

    Brett> Any links on rattlesnake?  I tried googling and came up with only
    Brett> a brief mention by Ping and Skip about it.

You just didn't look far enough back. ;-)

Rattlesnake was something I started in 1998 (based on 1.5.1 as I recall) to
come up with an alternate, register-based virtual machine for Python.  The
observation that Tim made which got me headed in that direction was that
three-register machines are much easier to optimize than stack-based
architectures.  The plan was to mechanically translate the bytecode for the
stack architecture to the bytecode for the register architecture.  (I used
my peephole optimizer as the basis for that translator.  Conversion to the
new architecture was thus a rather substantial "peephole" operation.) The
result should be relatively easy to optimize (just by eliding many of stack
motion, if nothing else).

A few of us got a reasonable start on it, but it eventually fizzled.  There
were a couple things that didn't ever work right, and starting with 1.5.2
the virtual machine started moving faster than I could keep up in the odd
spare moment.  It sat idle until a little over a year ago when Neil began
working on it.  To the best of my knowledge, he's never released anything,
but whatever he's got laying about is bound to be more current than anything
I could point you at.

Still, here are some pointers for those interested:

* Here's a pointer to a paper about the peephole optimizer:

    http://www.musi-cal.com/~skip/python/spam7/optimizer.html

* Here's the latest stuff I bundled up for Neil in 2001:

    http://www.musi-cal.com/~skip/python/rattlesnake20010813.tar.gz

* Here's the long inactive mailing list:

    http://groups.yahoo.com/group/rattlesnake

* There's a python-dev thread from February 2002:

    http://mail.python.org/pipermail/python-dev/2002-February/thread.html

  (search for "rattlesnake").

* Finally, here's a python-dev thread about rattlesnake from 1998:

    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=7399hf%24scb%241%40nnrp1.dejanews.com&rnum=1&prev=/groups%3Fq%3Drattlesnake%2Bmore%2Bbite%2Bfor%2Bpython%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D7399hf%2524scb%25241%2540nnrp1.dejanews.com%26rnum%3D1

Skip