The Topy project

François Pinard pinard at iro.umontreal.ca
Fri Apr 5 15:52:31 EST 2002


Hi, people.  I merely feel like chatting a bit. :-)

Maybe nine months ago, I sent a message to this list about a `perl2py'
program I was working on.  After an intense burst, I put this `perl2py'
project on ice, partly because I was hitting some difficult problems, partly
because the program was significantly slower than I expected.  But I had
the vague intention of revisiting it one of these days...  Fun enough, a
Perl to Python compiler was announced earlier this week, yet the announce
was made on April 1st, and the description was giving simple things as
difficult, and difficult things as easy: I did not take it seriously! :-).

Two weeks ago, feeling overwhelmed by the tedious aspects of translating
a non-small Scheme project to Python, I decided to try automating the work
somewhat.  So, I took my unfinished `perl2py', ripped off the Perl processing
parts (while carefully putting them aside for later, who knows!), and added
code to read and process Scheme input.  I even tried to draw a clean line
between the front-end part for Scheme and the back-end part for Python.

I hit a few of the same walls than for `perl2py', but this time, I have been
able to traverse those I decided to, so far.  The fact that Scheme is, in
a sense, a less complex language than Perl, helps me at sorting out ideas.
Well, I would not say that Scheme is simple to process (at least for the
poor little me), but Perl is, euh, how should I put it, hum, "exhausting"...
A few walls remain for the Scheme to Python converter, and while none is
easy, I think I perceive angles that could successfully tackle each of them.

One sure thing is that Topy's speed is acceptable, even if not blazing. :-).
I wish myself good courage, as I would really like Topy by my side before
resuming the work on the Scheme biggie.  Moreover, if this tool ever works
satisfactorily for Scheme, this might invite us to work at other front-ends.

I might not be ready to publish even an alpha before a few weeks, but I'll
let you know when there is something (even dimly usable) to share.  My goal
is to produce legible and maintainable Python, _not_ at all to produce code
that might be blindly executed: serious post-edition and debugging are meant
to be unavoidable.  I roughly aim R4RS (without delays nor continuations),
Python approximations for various types and standard library functions,
and surely various limitations -- I'll make an inventory of them later :-).
Python 2.0 is needed to run the converter, the result is 1.5.2 compatible.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list