DUers,
I know this summary is a bit late, but I was swamped with work.
First of all thanks to all who responded.
These opinion type of questions never REALLY get a solid answer,
after all they're opinions.
They're interesting none the less.
The reason I asked is that I was all set to continue with my Perl
education, but then got hold
of a Pro-Tcl page that really made Tcl sound like the perfect
interpretive prog. language.
Here that is for reference:
http://www.scriptics.com/scripting/perl.html
<
http://www.scriptics.com/scripting/perl.html>
At my tender level of Perl knowledge I was influenced by this Perl
vs. Tcl comparison.
I also, as I mentioned, have more experience programming in Tcl/Tk.
I still maintain that Tcl is easier and quicker (in most cases) to
write a small app. in than Perl.
Any comments or rebuttals on the above Web site would be welcome as
well.
HOWEVER, There are two main reasons why I will choose the Perl path
for my CGI programming:
1) It does have more support for CGI. A plethora of modules. Support
from Apache, Oracle ( Appl.
Server plug-in), etc. I have already used DBI and
DBD::Oracle with success.
2) It has a larger install base. There are far more Perl/CGIs and
probably Perl Apps. in general
than Tcl. This means that there will be more demand now and
in the near future for Perl programmers.
I have to think about the importance of the job market, and
Perl wins here.
I will admit that I wish Tcl's popularity was swapped with
that of Perl's, only because it's easier
to program to me (Syntactically, higher level )
Here are snippets of the responses I received.
I had many responses - too many to list I'm afraid.
A few recommended an alternate: Python. I've heard good things about
Python, but....
The snippets:
***********************************************************************
As I'm sure you know, the answer is "What do you want to do?" Each has its
strengths and weaknesses. I use sed much more often than awk, yet they do
similar things.
Personally, I use Expect, which is a tcl/tk based product. I use it
to do database refreshes and administration. I like the fact that I can
automate interactive Unix tasks.
***********************************************************************
I understand that the GUI will be HTTP based, and therefore I recommend that
you check a software named ColdFusion. ( www.allaire.com
<
http://www.allaire.com> ) its a web application server, with a dedicated
language for CGIs (CFML) you can write any ordinary GUI, with database
support in no time. the server itself runs on NT, Solaris and Linux. (don't
know about Alpha)
If ColdFusion is not an option, I would go for Perl. its the best
programming language for every purpose, and it has ALOT of CGI support.
(for example, you can generate HTTP requests from your CGI in no time by
using the LWP package.)
Perl has modules which can integrate with the Apache web server which makes
the script stay in memory in their byte-code representation. it makes it
very fast.
**************************************************************************
I do not really know Tcl, but over the time I found that Perl is much more
used than Tcl. First on many platforms (OpenVMS, Unix, NT and so on...).
Second the available modules (CPAN) seems to me much reach than that is
available for Tcl. Specially if you intend to use it with Oracle or CGI,
looking at the Cookbook or to CPAN, you will found everything you need to
develop your application.
***************************************************************************
I've been using Perl for years, and I hate Tcl, so I'm not exactly an
unbiased observer, however...
There are perl modules for every DB known to man. I hear they're pretty
good.
> 2.Regular Expression heavyweights.
you can't really say that about Tcl. Yes, Tcl has function-calls for
regexps, but they are NOT a part of the language. How often have you found
yourself sorting out the Tcl-metacharacters in your regexp that you need to
screen from the Tcl interpreter?
Perl, on the other hand, has REs built into the language. You choose:
regsub "\[0-9\]\[^ \t\]\[abc\]" $foo {} bar
vs.
$val =~ s/\d\S[abc]//;
> 4.Object Oriented capabilities.
haven't looked at OO Tcl. (why?) I know it used to be a bag-on-the-side, but
I've heard that it's been improved. Perl's got a lot of OO stuff again,
built-in.
> 5....All the usual programming constructs.
There's only one construct that I miss in Perl that Tcl has... "switch"
>
> To keep it short.. which one would prove to be a best all-around
programming
> (scripting) language on my Tru64 server ?
well, lessee... Perl of course!
***********************************************************
A vote from rainy Seattle for Perl. I'm doing a system/job monitoring
application for a group of Oracle servers on Alphas, and between apache,
mod_perl, and oraperl, all things are possible. I am not coding yet, but all
of the Perl-related T64U installs have gone off without a hitch.
***********************************************************
Will anyone else ever have to read your code? Perl is like C, awk, ...,
etc., while tcl is completely different. I've used a little Expect, which
is based on tcl, but much prefer perl.
***********************************************************
I'm a perl fan myself, so I'm biased ;-)
One reason that you may select perl, is that if you run the Apache web
server you can embed a perl interpreter within it (using mod_perl) This
means that your cgi scripts only get loaded once, saving the fork/load/exec
overhead - this can make scripts quite a bit faster.
************************************************************
I'm sure that you've already gotten a million responses saying the same
thing, but: instead of choosing between Perl and Tcl/Tk maybe you could use
Perl/Tk?
*************************************************************
Which of the two you choose will have impact on the choice of Web server.
Perl rules the Web, and there is a big library of modules you can use. tcl
is elegant and has smaller memory footprint.
I'd use both, with a front-end apache server passing requests to a mod-perl
apache server and an AOL server at the back as appropriate.
*************************************************************
python!
oh all right. i think perl is the better choice. YMMV.
**************************************************************
Forget Perl and TCL. Learn Python (see www.python.org)
<
http://www.python.org)> . It's very easy to learn (much easier than perl).
We do almost all our CGI programming in it now. It's got a huge collection
of public-domain modules available, including interfaces to make CGI
programming easy, interfaces to oracle, etc. Has hooks to call C from
Python and Python from C if you want. Has an interface to Tk, just like TCL
does, so you can build GUI's if you want.
And lots of friendly people hanging out on comp.lang.python to help.
****************************************************************
Why choose one or the other? When I had similar projects to complete I used
Tcl/Tk for the GUI front-ends and query/updates and (then) oraperl (now perl
dbi) to do the report generation.
****************************************************************
without a doubt, perl with DBI and DBD::Oracle.
****************************************************************
THE ORIGINAL QUESTION:
I know, I know, this is not REALLY a Tru64 UNIX question, but I do
plan to
use these languages on Tru64, so....
I am interested in creating CGIs and utilitarian GUIs for users in
my department.
My CGIs will interface with an Oracle database.
I was once an average Tcl/Tk programmer. I am just now learning
Perl.
I was wondering which path to take. They seem to be very similar.
1. Bytecode compiled
2. Regular Expression heavyweights.
3. Oracle database API's for the OCI.
4. Object Oriented capabilities.
5. ...All the usual programming constructs.
To keep it short.. which one would prove to be a best all-around
programming(scripting)
language on my Tru64 server ?
I am about to get some substantial work to create CGI Web Apps. and
want to know that
I've picked the best combination of "ease of learning" and
functionality.
I think this is my first "non-Tru64 UNIX" question ever in 3 years,
so please forgive me.
Thanks,
***********************
Wayne Sweatt
Principal Software Analyst
Litton / PRC
505.827.9288
***********************
Received on Wed Dec 08 1999 - 17:39:01 NZDT