LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Perl or Ruby or Python? Or something else? (https://www.linuxquestions.org/questions/programming-9/perl-or-ruby-or-python-or-something-else-706137/)

MasterOfTheWind 02-20-2009 04:03 AM

Perl or Ruby or Python? Or something else?
 
Hello all!

Yes, yes, I know it's one of THOSE threads again. I would like your opinion on what scripting language suits best my needs :-P

First a little about my background: I've been using C++ for 8 years on and off, for pretty much everything from useful file formatting "scripts" to game programming (SDL, OGL...) to statistical computations and visualization. I have had some experiences with M-code in MatLab and of course (as a devoted linux user for the past 7 or so years) bash scripting.

Despite C/C++ being versatile and fast I don't always want to bring out the bazooka to kill a moth so to speak, so it would have been great with a slightly more flexible (albeit perhaps not as fast) alternative.

So, what do I want? Here are my main priorities:
  • Easy file handling and (re-)formatting (convenient retrieval of columns/rows, flexible output control)
  • Statistics are crucial to me. So this scripting language should have an (as extensive as possible) statistical library.
  • Visualization should be easily accessible. Not necessarily interactive, but I would very much like to save to either raster or preferably vector formats.
  • (edit) Oh, yes, and bindings to some GUI lib could have been useful.

Can anyone suggest a flexible scripting language which may suit my needs?

Thanks in advance

Hko 02-20-2009 04:24 AM

As you already know much has been said about this subject. So, I think it is best to read some of them and pick a choice and go through a tutorial. If you don't like it, pick another.

I do think it is safe to say that of those 3 languages, perl has the most libraries/modules available. And also that ruby as well as python invite you to code more cleanly/readable than perl.

After learning C, C++, java, bash and PHP, personally I picked python and I don't regret it. Languages I now still use are C, bash and python.

H_TeXMeX_H 02-20-2009 04:35 AM

I dunno, but python has numpy:
http://en.wikipedia.org/wiki/Numpy

For perl there are many modules available including many statistics-related ones:
http://search.cpan.org/

As for ruby, maybe see here:
http://rubyforge.org/projects/rubystats/

All of them have bindings to GUI toolkits.

If you want just pure statistical computation + graphics then:
http://www.r-project.org/

chrism01 02-20-2009 06:11 AM

For Perl you've got:

1.file formatting etc: Perl is very good at this.
2. Stats: try the PDL aka Perl Data Lang modules
3. I believe Perl has modules for this too
4. GUI Perl has bindings to several, inc TK.

Look at the hundreds (thousands?) of modules at search.cpan.org
Also, http://perldoc.perl.org/ & http://www.perlmonks.org/?node=Tutorials

I don't know Ruby or Python...

Sergei Steshenko 02-20-2009 06:28 AM

Quote:

Originally Posted by chrism01 (Post 3450918)
For Perl you've got:

1.file formatting etc: Perl is very good at this.
2. Stats: try the PDL aka Perl Data Lang modules
3. I believe Perl has modules for this too
4. GUI Perl has bindings to several, inc TK.

Look at the hundreds (thousands?) of modules at search.cpan.org
Also, http://perldoc.perl.org/ & http://www.perlmonks.org/?node=Tutorials

I don't know Ruby or Python...

Perl also has bindings for gtk+ and Qt.

Perl is probably the most powerful of the three, and shines in its functional (opposed to traditionally imperative) part, as well as data structures and scoping. And, of course, closures.

One of its strongest features is anonymity - where desired. Anonymity allows you to avoid name conflicts/namespace pollution. I know anonymity is a difficult subject for people with C++ background - I have a good friend of mine writing in C++ :-).

Because of Perl's strong functional feature one can implement various OO models - in addition to the "standard" Perl one.

ghostdog74 02-20-2009 07:28 AM

Quote:

Originally Posted by MasterOfTheWind (Post 3450783)
H
Can anyone suggest a flexible scripting language which may suit my needs?

Thanks in advance

you only have 3 choices. If you do have not experience in any of them, study and research them for at least a week each. Then pick the one you like. you can easily do research using google.

bigearsbilly 02-23-2009 02:49 AM

Quote:

Perl also has bindings for gtk+ and Qt.
hay naranja!
have you tried using the perl GTK?
it's horrible!

Sergei Steshenko 02-23-2009 04:14 AM

Quote:

Originally Posted by bigearsbilly (Post 3454084)
hay naranja!
have you tried using the perl GTK?
it's horrible!

I wrote a pretty complex GUI in Perl gtk+. As I see it, the problem is not in Perl, but in gtk+ itself.

At the moment I decided to choose gtk+ and not Qt Qt Perl bindings were unsupported, and Qt wasn't LGPL (it is going to become LGPL this March).

Nowadays there are new (another author) Qt Perl bindings, so today I would have started from them.

bigearsbilly 02-23-2009 04:46 AM

yes I agree, sergei.
i've done the same doing perl and glade, It's like pulling your own teeth out.
what makes it so bad is that the gtk documentation is abominable.


anyway has the OP reached a conclusion?

GodofPain 04-30-2009 02:09 PM

Take a look at this site.

http://perlqt.wikidot.com

PerlQt is a very fast and easy way to create great looking GUI programs using the Qt drag and drop form designer and Perl. PerlQt is powerful enough for advanced developers and easy for beginners as well.

Sergei Steshenko 04-30-2009 02:29 PM

Quote:

Originally Posted by GodofPain (Post 3526073)
Take a look at this site.

http://perlqt.wikidot.com

PerlQt is a very fast and easy way to create great looking GUI programs using the Qt drag and drop form designer and Perl. PerlQt is powerful enough for advanced developers and easy for beginners as well.

Youy URL points to http://perlqt.sourceforge.net/ , which is the one of unsupported Qt bindings.

Here are newer bindings (Qt4):

http://qt-apps.org/content/show.php/...?content=69748
http://code.google.com/p/dongxu/wiki/PerlQT
.

Su-Shee 05-02-2009 10:48 AM

One "newer binding" is last updated in 2007 and the other one isn't available to download.

I couldn't even get the one to build which is actually available for download.

I'd say: right now, there's no QtPerl. (Or I didn't find it yet ;) )

GtkPerl is more or less painless from the perl-side - and if you need better documentation, just use the PyGtk documentation; it translates very easily into GtkPerl.

http://www.pygtk.org/pygtk2reference/index.html

amysaraantony 05-07-2009 06:02 AM

Perl and Python are things of the past ...
Go Ruby baby !!!
:)

Debian

Sergei Steshenko 05-07-2009 06:59 AM

Quote:

Originally Posted by amysaraantony (Post 3533170)
Perl and Python are things of the past ...
Go Ruby baby !!!
:)

4x slower. Seriously, compare the features.

Telemachos 05-07-2009 07:10 AM

Quote:

Originally Posted by amysaraantony (Post 3533170)
Perl and Python are things of the past ...
Go Ruby baby !!!
:)

I actually like Ruby quite a lot, but I wouldn't necessarily recommend it for a couple of reasons. (1) The core implementation (the Matz interpreter) is still significantly slower than either Perl or Python. (2) It's a bit of a moving target at the moment: 1.9.1 is out (and shows some nice speed increases, apparently), but although reasonably stable is not a true stable release. For example, many gems (Ruby's version of libraries/modules/add-ons) don't work yet with 1.9.1.

Perl is outstanding for text handling, and I believe it handles statistics quite well, but I've heard nothing but horror stories about using it for GUI apps. (It's my preferred language, by the way, so I'm not picking on it, just reporting what I have read.)


All times are GMT -5. The time now is 10:09 AM.