Perl Vs Python, Associative arrays, regex, and other considerations.

Mike Meyer mwm at mired.org
Thu Feb 27 11:07:15 EST 2003


"John Smith" <someone at microsoft.com> writes:

> Speed

Perl is slightly faster. Both are run on a vm, and include translating
things to C as an optimization step.

> Code size,

Hard to say, as it depends on your style.

> Interpreter size.

Comparable.

> Cleanless  (I have heard Python to have an advantage there).

I would say so. Python is one of the cleanest languages I've run into.

> Ability to compile, and/or encapsulate the interpreter, in order to have an
> executable, on most platforms.

I believe both can do this on Windows. Python has "psyco", which does
compilation-like magic on x86 architectures.


>     Real (easy) Portability is a big thing in my view.

Both run on most common platforms. There is an implementation of
Python in Java, which probably gets it on more platforms than Perl.

> Interfacing with other languages and GUI,s

About equal. Both can be interfaced to other languages through C, you
can wrap C and C++ libraries for both with SWIG, and both have a
number of guis available, with tcl/tk being popular on both.

> Tools: debuggers. A friend told me ddd for Perl is great. How would be
> Python?

You can use pdb in lieu of ddd with python. There's an interactive
development environment bundled with the distribution as well.

> Ease of leaning (this may be subjective.. transfert of existing knowledge,
> like C or ...).

I think that's the big difference. You can learn all of Python in an
afternoon. Perl is much bigger because "there's more than one way to
do it." In reality, to use both of them well you need to learn the the
libraries that are available for them. Perl includes fewer libraries
with the distribution, but has CPAN which makes access to the external
libraries easier. Python tends to include everything in the libraries,
but doesn't have anything as overreaching as CPAN, though it does have
archives of libraries.

        <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.




More information about the Python-list mailing list