Perl Monks is a major hub for the cream of the Perl geeks. A few days ago, someone posted an article called Perl is Dying (link may not work now), which got picked up pretty quickly by people on del.icio.us. Intriguingly, however, while I can load other stories on Perl Monks at the moment, that story keeps returning a 403 when I try to access it. A temporary glitch or are they trying to silence what is, essentially, the truth? (Found a sneaky way around it so you can still read the article.)
I've been using Perl since 1996, professionally since 1998, and it's not a bad language. It was certainly the best for what it did at the time, and I still feel Perl is probably the most flexible scripting language out there when it comes to libraries and extensibility. Even PHP can't claim anything as cool as CPAN (and, no, PEAR isn't it), and PHP is basically a highly-useful, fast, mish-mash of the worst of Perl and the worst of C, so Perl has had its place till now.
This is rapidly changing, however. Python (on the systems side) and Ruby have both taken away significant developer / hacker mindshare from Perl, and PHP has become the de-facto language of basic Web development, while Java has continued its stride into the enterprise. Perl's niche has been pulled from under it by better languages, and the glacial development of Perl 6 (which, in many ways, looks like a grotesque version of Ruby) has helped hammer the nails into the Perl coffin.
I still actively use Perl, primarily because Ruby's unicode support is crap and I don't like Python, but I've quickly come to realize that Perl's time is, really, up. It's not object-oriented (enough), it's messy (even if you code in a tidy manner), and there's too much syntactic salt all over the place.
The anonymous author of "Perl is dying" remarks:
Perl needs a new, snazzy web application server right now. Something that has the performance of mod_perl but doesn't expose Apache's internals; something as easy to install as PHP or RoR, with a great name and a great API. (A toned-down version of mod_perl coupled with T2T and Mason would suffice.) Perl hackers need to get their act together. Stop writing bad code, or at least write less of it. (Read Code Complete 2 for starters.) Finally, Perl 6 needs to come out in some form this year. Not in 2008 or 2010. By then, no one will care.
I think they're being too optimistic about Perl. When you look at Ruby or Python (or even PHP5) and then look at Perl, Perl is still a mess of a language. It doesn't fit in with modern development techniques and style. It's a great hacking language, but it stinks for large-scale development. Developing a Rails-esque framework for Perl (and one does already exist, Catalyst) will not solve the problems the language inherently has. People flock to Rails because of this:
crucial_task = Person.find_by_name("Fred Bloggs").tasks.first
crucial_task.completed = true
crucial_task.save
And not to Perl, because of this:
sub foo : Global {
my ( $self, $c, @args ) = @_;
$c->stash->{template} = 'foo.tt';
$c->stash->{data} = $c->model('Database::Foo')->search( { country => $args[0] } );
if ( $c->req->params->{bar} ) {
$c->forward( 'bar' );
}
}
(and that was clean Perl code..)
I've been using Perl for 10 years and it's served me well, but I'm ready to admit.. its time has passed.
Thanks for the great post. That original Perl Monks thread can be found here:
http://www.perlmonks.com/?node=perl+is+dying
I'm a perl coder and have recently moved to Rails. It's faster and cleaner to develop than Perl, I would agree. However, the example you have at the end of your post is not really fair. Just as Ruby (and Rails) have ActiveRecord, Perl has Class::DBI.
my $person = Person->search(name => 'Fred Bloggs');
$person->contacted(1);
$person->update;
What's so bad about that?
I'm still maintaining Perl projects, and I have to say that Class::DBI, HTML::Mason and frameworks like Catalyst are great to work with. Not as elegant as Rails (and not as fun), but they have been working for over five years now.
Posted by: Jeremy Seitz at July 17, 2006 03:25 PMYeah, the code comparison is dodgy, I should probably change that ;-) Thanks for posting though!
In my case, unlike many others it seems, I feel the issue is not that there's no "Rails for Perl" (although Catalyst, Mason, and Class::DBI are all great attempts) but that Perl is simply an inflexible language compared to others nowadays.
When I go back to working on Perl stuff and I have a situation like this (in Ruby):
string = "something"
puts string.length
I tend to start writing.. print $string.le^H^H^H^H^H^H^H^H^Hlength($string) .. and it feels totally counterintuitive. Worse, if you want to create a string class that deals with all of this, you don't get the functionality for 'free' in all your apps.. you gotta then do nonsense like this:
$string = OOString->new("something");
print $string->length;
And that's just cumbersome.
As far as I'm concerned, Ruby is Perl 6 (or Perl 7, or whatever). It's enough like Perl for it to be comfortable, but it does OO right while still retaining Perl mannerisms.
Ruby is "Perl done right for the 21st Century".. so my irritability with Perl isn't so much with the whole culture of Perl, but merely that Perl is outdated, and the new version, Ruby, is a lot easier on the eyes ;-)
Posted by: Peter Cooper at July 17, 2006 03:32 PMTo better answer the 'what's so wrong with that comment'..
my $person = Person->search(name => 'Fred Bloggs');
$person->contacted(1);
$person->update;
It's more long winded than it needs to be. Ruby and Python have proven to me that the day of the semi-colon is over. In an ideal world, the above Perl, to me, would read more like so:
person = Person->search(name => 'Fred Bloggs')
person->contacted = 1
person->update
(or how about Person->search(name => 'Fred Bloggs')->contacted=(1)->update)
It looks like Perl, but the extraneous crap has been thrown away. Sadly it seems like Perl 6 is attempting to add even more extraneous syntax to the language, and that's why my excitement for it has died (although Parrot still kicks ass, and it's a shame Ruby isn't officially considering targeting it).
I guess this argument is really flogging a dead horse though. Perl simply isn't an OO language, and I'm stating the blinding obvious :)
Posted by: Peter Cooper at July 17, 2006 03:42 PMPeter, try Moose::Autobox from CPAN. It lets you call methods on native types, so you can have your "String"->length :)
Posted by: Sam Vilain at July 19, 2006 10:10 PMThanks for the lead, Sam!
print [ 1 .. 10 ]->map(sub { $_ * $_ })->join(', ');
That is very cool. It feels a bit like taping a warp engine to a 69 Chevy, but hey :)
Posted by: Peter Cooper at July 19, 2006 10:15 PMReturn to the homepage.
Privacy Policy