OO misconceptions

François Pinard pinard at iro.umontreal.ca
Tue Jul 17 21:49:08 EDT 2001

[Steve Holden]

> Having been involved with Snobol in a previous incarnation I really
> liked Icon.

I did like Snobol, and worked a lot with it.  It was a quite powerful
language.  I found it very good for Kleenex programs, that is, those you
use once or twice, then throw away! :-) I remember how painful it was to
_punch_ Snobol code.  And later, many people told me great good about Icon.

> Not the fastest language, like Python it ended up interpreting bytecodes.

Nevertheless, it was quite fast for what it was doing.  The interpreter was
relatively small (maybe two or three inches thick, once printed).  I'm not
sure I remember correctly, but I think it was using a peculiar and unusual
representation for internal strings: packing up to 7 characters, then a
pointer to the rest, up to 7 characters, then a pointer to the rest, etc.

> > I'm still dreaming about an automatic Perl to Python converter.

> Suppose a Perl-to-Python conversion were possible (and I'm not suggesting
> it isn't): would it be the kind of Python you'd want to use to teach the
> language?

Surely not.  The idea is not to use it to teach Python, but to help quickly
migrating already written Perl code to Python.

> Given that Perl is ubiquitous, would there really be any point?

Besides converting one's programs, the point might be to move over Perl
libraries or modules for being able to use them within Python with much
simplicity, without having to resort to bigger tools like, say, Minotaur.

> I'd rather do something new in Python and keep the trusty old Perl scripts
> around, performing day in and day out, than translate them into Python
> just to avoid using Perl.

I've surely nothing against using Perl per se, as long as I do not much
have to maintain the scripts, or otherwise dive in the code.  Preventing
translation to Python is a way to aggressively dissolve the maintenance
fear, but it requires energy.  In any case, if a Perl to Python converter
produces horrible Python, we would not gain much in this area, and I guess
it might be rather difficult producing legible Python from such a conversion.

> > If I could swallow that snake [of tokenizing/parsing Perl] , the rest
> > would not necessarily be easy, but at least, it would be fun! :-)

> Ah, well, if you'd do it for fun I have no objection at all.

Oops!  Each thing in its proper proportion...  There might be some
miscommunication, here.  There are a lot, really a _lot_ of projects that are
more attractive than a Perl to Python converter.  It is only that it seems
that such a tool, if it existed, would solve a recurrent request on this
mailing list, and thus, presumably, a need.  Perl probably helped itself by
providing sed-to-Perl and awk-to-Perl converters rather soon in its history.
Maybe it would be worth for the Python cause to have such tools.  Maybe not?

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

More information about the Python-list mailing list