[Novalug] Best programming language for "munging?" Not Perl? Ruby? Python?

James Ewing Cottrell 3rd JECottrell3 at Comcast.NET
Wed Oct 28 16:21:58 EDT 2009


Like I said, Perl was designed to make System Administration tasks 
easier. For quick tasks, it's great. Having dynamic strings, hashes, and 
arrays, as well as regular expressions makes it faster than programming 
in C. So when a project feels too heavy for a shell script, Perl has 
been the logical next step for me. I can use or ignore the features I 
don't need or like.

I dunno Python at all, other than from grubbing thru a few anaconda 
scripts, so I dunno how well it can bang out those easy tasks quickly. 
I'm assuming it can.

But I think the Next Big Thing is Ruby, especially on Rails. Ruby was 
designed to fix Perl, and as an alternative to Java. In fact, I'm 
reading a book right now called From Java to Ruby, by Bruce Tate, which 
says that Java is Too Heavy, burdened with Cumbersome Frameworks, and 
that RoR is orders of magnitudes more productive (not to mention FUN) 
than Java.

Bruce has written several Java books too, so it's not just a case of "My 
Language can beat up Your Language". And he says that a lot of other 
Java gurus are wringing their hand at what Java has become too.

To be fair, the book was published in 2006, so developments in Java 
could have changed the tide somewhat. Or not. I dunno.

Change is always difficult, but it is ultimately rewarding. I learned a 
lot when I switched from csh to ksh, and from vi to emacs, and probably 
when I switched from Solaris to Linux.

So now I need to make another change, from Perl to Ruby.

The counterpart to CPAN is Ruby Gems. A large repo is RubyForge.ORG

Consider the first item from the following URL:

http://rubyforge.org/softwaremap/trove_list.php?form_cat=87

Net::SSH even looks like a CPAN name, doesn't it? I bet many a hacker 
cut their teeth on Ruby by rewriting the Perl modules from CPAN.

So what are you waiting for? I wonder what took me so long.

JIM

Paul D. Bain wrote:
> James Ewing Cottrell 3rd wrote:
>>>
>>> PROS:
>>>
>>> When Perl was made, it was a nice unification of sed/awk/sh/C. Easy 
>>> to understand and Get Things Done. But it has turned into a monster, 
>>> mostly because it pretended to be a Language when it stretched that 
>>> term to the breaking point. It's a collection of Special Cases.
>>>
>>> Perl did get some things right. The idea of \special always being 
>>> literal in regexps is nice.
>>>
>>> And taking the left or right values from || and && is WAY better than 
>>> the stupid 0 or 1 of C, altho making them boolean results as in Java 
>>> is useful.
>>>
>>> And it IS totally cool that you can create reference to hashes of 
>>> arrays of arrays of hashes on the fly all in one statement.
>>>
>>> CONS:
>>>
>>> The grammar is Context Sensitive and Ambiguous. Cardinal Sins.
>>>
>>> OK, let me ask you folks, what would you call the string =~ in the 
>>> following statement: $var =~ /regexp/;
>>>
>>> Is it an operator? NO! OK, then what is it? Well, it's a Glorified 
>>> Comma. The operator is "m" here, and "=~m" is the infix notation for 
>>> "$var" and /regexp/ if you will.
>>>
>>> After using Perl for about 5 years I was calling for a Perl II 
>>> language back in the early 90s. Well, they finally got to it with 
>>> Perl 6, but they are going in the wrong direction ... it's even MORE 
>>> complex.
>>>
>>> JIM
> 
> Jim,
> 
>     Thank you for giving us the opinion of a long-time Perl user. I had 
> suspected that Perl 6 was headed in the wrong direction, but I was not 
> certain because I am not a long-time Perl user and because I have not 
> been following Perl 6 developments closely.
> 
>     My question is this: If Perl is deficient in some respects, then 
> which language is now best for "munging," the transforming of messy 
> input into cleaner, culled data? In yesteryear, Perl held this 
> distinction -- does it still? Or does that distinction now belong to 
> Ruby? I understand that Ruby processes strings just as well as Perl does 
> because, for example, it supports Perl-style regular expressions.
> 
>     One of Perl's huge advantages is this respect is CPAN.org, which 
> has, AFAIK, no Ruby counterpart. CPAN has many good modules for 
> processing and munging email, which is important to me. Furthermore, 
> Ruby's libraries are still considered inferior to Python's. Moreover, 
> the number of mature Perl and Python frameworks is huge, probably far 
> larger than the number of Ruby frameworks. In this regard, Ruby-on-Rails 
> (RoRails) does not count. RoRails is a Web application development 
> framework only, and I am interested in munging tools _only_.
> 
>     BTW, this is an important question in the field of legal technology. 
> That is why I am asking.
> 
> 
>>> American Dave wrote:
>>>> On Fri, Oct 23, 2009 at 01:07:39PM +1300, Mark Smith wrote:
>>>>> On Thu, Oct 22, 2009 at 04:42:52PM -0400, James Ewing Cottrell 3rd 
>>>>> wrote:
>>>>>> I've pretty much been writing in Perl (and shell) for 20 years now. 
>>>>>
>>>>> even today, it's a really good language for just about everything.
>>>>> sadly, some folks have negative connotations associated with perl.
>>>>> not sure why it gets a poor review from those people. 
>>>>
>>>> The complaints usually revolve around the following:
>>>>
>>>>   * Vars like $_ are horrid to read, especially when implied
>>>>   * No out-of-the-box GUI support
>>>>   * Perl's base is much smaller than many other modern languages,
>>>> meaning you've got module soup after a while.  This is also a feature.
>>>>   * Without 'use strict' code isn't maintainable.
>>>>   * Perl 6 is very, very late.
>>>>
>>>> I should note that I like Perl.
>>>> -A. Dave
> 
> 
> ------------------------------------------------------------------------
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.423 / Virus Database: 270.14.36/2465 - Release Date: 10/28/09 09:34:00
> 




More information about the Novalug mailing list