Choosing Perl/Python for my particular niche

Fred Ma fma at doe.carleton.ca
Sat Mar 27 02:19:47 EST 2004


Hello,

This is not a troll posting, and I've refrained from
asking because I've seen similar threads get all
nitter-nattery.  But I really want to make a decision
on how best to invest my time.  I'm not interested on
which language is better in *general*, just for my
purpose.  My area of research is in CAD algorithms,
and I'm sensing the need to resort to something more
expedient than C++, bash scripting, or sed scripting.
What I hope to do is a bit multifaceted.  What I don't
do dabble in is web apps (though I'm not sure of the
similarities).  No XML processing or database
interaction in what I do.

One thing I expect to have to do is to modify design
files.  For example, there is a tool which takes ASCII
hardware desscription language (HDL) and converts it
to a C++ (augmented by hardware simulation library).
The translator is freeware, so has limitations which I
have to make up for by tweaking the HDL code.  In the
past, I've eeked out sed scripts for such tasks, but
would appreciate a more traditional language.  Since
Perl is used alot in digital IC design, I took a stab
at that, motivated by the simple need to convert my
mail aliases from one mail reader to the other.  It
took a while to do, and I'm concerned at the difficulty
level.  If I did this kind of thing constantly, I
would probably get proficient and use the power behind
it, but it's not my main area.

The alternative is Python, which is easier to read
from what I've read.  My concern there is that I cut
myself off from large availability of stuff that's
out there.  For example, I use a PC-to-solaris
viewer called VNC, and I've banged my head against the
startup script to change it a bit for my situation.
Likewise, the above translator uses Perl extensively
in its operation, as well as it's building and
installation.  If I wasn't passingly familiar with
Perl, I would have had a much harder time installing
it.  Being in the approximate area digit circuits,
I'm concerned about being on the band wagon, if only
to avoid reinventing things, or impediments to sharing
things.

An additional usage scenario is to (if reasonable)
replace my shell scripting e.g. I just converted to
bash from tcsh to write scripts that push a document
through a series of filters, or simply as a wrapper
around a tough-to-use utility e.g. pstops.  A final
example is to take a file of design information and
do more than tweak it e.g. extract all the information
about interconnections between circuit building blocks,
including which is the source block, and which are the
destination blocks.  Typically, this information will
be read by matlab scripts and passed to my C++ code
(I've managed to avoid writing code to parse the
input file from C++).

Whichever way I go, I would like to avoid the overhead
of learning both Perl and Python.  I will sculpt out some
time in a miserly fashion to slowly get to know one.  Since
I spend most of my time exploring the algorithm in Matlab or
C++/STL, there's only so much time to pick up higher level
languages (it took years before I shelled out the time
to switch from tcsh to bash).  One of the things that
makes the decision not clear is that despite Python's
claim to a gentler learning curve and clearer code, I
often like the expedience of sed e.g. a terse one-liner
that can be pipelined with other shell commands.  I
also note that Perl's unweldiness only comes for big
projects, and I don't expect to using Perl quite that
way.

I've seen mention of parrot and perl6, which is quite a
ways off.  I'm not sure how much that should weigh into
my decision, since it isn't real yet.

Thanks for any comments/suggestions.
-- 
Fred Ma
Dept. of Electronics, Carleton University
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6



More information about the Python-list mailing list