39 comments

[ 3.8 ms ] story [ 119 ms ] thread
"Perl is an amazing programming language. And, with its growing worldwide re-popularization"

Have I missed something? I'd kinda like this to be true, Perl is still my go-to language when I need to hack something together - not because I think it's necessarily "the best" language to do most jobs, but because I know it's "the best" language for _me_...

Has everybody _else_ figured that out too? ;-)

The Perl community is pretty pleased with the state of things. The Moose object system is stable and amazing, and I'm sure future language designers will take not and copy it. Plus a new book just went out 'Modern Perl', that talks also about it.

The Perl 6 - rokudo is a usable Perl 6 implementation, already reasonable fast and getting faster every release, and bringing new features from the spec.

The release team of Perl 5 is working too, making a new version every two years, with new toys for us to play.

Web frameworks are coming out, CPAN is expending... fun times.

"Perl is an amazing programming language. And, with its growing worldwide re-popularization"

Just because this guy says it is so, doesn't make it is so. Tell me 1 metric that tells me definitively Perl is coming back. If this guy told me Perl is never going away, I'd believe him, but when he told me Perl is coming back, with no data to back it up but his ass, and use that as an excuse to brain-wrap the next generation of programmers to think in an alien language that looks like comic characters cursing with $_@qw()<>$@{}*&lc()~>>>$.$/$<$:, I'd brand it as a trash.

One metric: more new modules uploaded to CPAN on a daily basis than ever before.
And another metric shows that Perl continues its years-long decline:

http://www.tiobe.com/index.php/content/paperinfo/tpci/index....

This is one of the factors why we have replaced Perl in our curriculum with Python. The other being that Python is far more fit for education.

If you are using TIOBE to make decisions on what to teach, I feel bad for your students :)
That's true, but having said that, it's well known (or at least often joked about) that Perl makes a poor first programming language but a fine _last_ programming language.

Jokes aside, I think the sentiment has some strong truth - if for no other reason that there are some very heavy assumptions in the standard documentation that the user is well versed in Unix, shell and C libraries. "perldoc -f printf" and "perldoc -f sprintf" are _not_ what I'd expect first-programming-language learners to have to work with.

Unfortunately, the usual refrains of "patches welcome" are unlikely to solve this problem, because as a 2nd or 3rd (or 17th) language, it's precisely the documentation I want.

That's a caricature of my comment (given the smiley this is probably intentional). The primary motivation was educational fitness, the second consistency within the education program, the third popularity. Of course, not popularity according to the TIOBE index, but to what typical employers require. Of course, in the market C# and Java are more popular, but popularity is just one factor.
If you use the TIOBE index as a measurement for language popularity you shouldn't be controlling a curriculum related to information technology because it indicates you don't have high-school level knowledge of statistics. TIOBE is based on "searches for a given language", there are all sorts of factors that can skew the outcome pretty badly. See http://www.tiobe.com/index.php/content/paperinfo/tpci/tpci_d....
You must have misread my comment. Popularity (as in what typical future employers require) is one of the factors (besides fitness for education and program consistency), TIOBE is not.

The TIOBE reference was to show that there are nearly always metrics that show your point.

But I guess it is easy to stomp on people based on presumption. Let's just stick to arguments, rather than poisoning the well.

For stuff like string handling, text processing and even variable interpolation, Perl blows Python and Ruby out of the water (and despite criticizing Perl's regex, Python ended up copying it almost identically). Much of this power stems from Perl's much-derided use of sigils (e.g. $scalar, @array, %hash) and context.

Personally, I find Perl's $header2 = "Dear $title $name,";

to be more readable than Python's header2 = "Dear %(title)s %(name)s," % vars()

Another benefit to using sigils is that it's immediately clear when reading code what type of data is being referred to, while in other languages you often have to read back through the code.

On the other hand, Python has done a great job in positioning itself as the new BASIC (in a good way), and so of course Python gets much more exposure in the educational setting and thus has greater mind-share amongst younger coders.

Python is simpler and easier to learn well than Perl, but nevertheless Perl is a very powerful and useful language that takes a lot of undeserved criticism (e.g. see the comment of wyuenho in this thread).

Incidentally, I found the Google Trends link hilarious, as all the news snippets on the right of the page refer to people called Ruby and actual Python snakes (hey, maybe people are searching for things other than programming languages..)!

I think what you have said is quite fair. However, I must clarify that I wasn't criticizing Perl's use of sigils, I was criticizing Perl's use of punctuations. There's big difference. Sigils does indeed make the types of variables clear, tho I find that context alone is enough. Objects in natural languages don't have to have types in their spellings to convey their categories after all. The use of genders in some languages is superfluous, Chinese doesn't require that.

All I'm saying is, Perl requires too much more mental power to process than Python because of it's large vocabulary and inconsistent grammar rules. It is really a natural language, but a natural language is not needed for programming.

Yeah, punctuation, wow. I mean, here's a sierpinski triangle generator:

32.times{|i|i.upto(31){|k|putc~k&i>0?32:35};puts}

Oh, wait. That's Ruby. I meant to say:

<?for($n=33;$k=--$n;print~\xf5)for(;$k;)echo-$n&--$k?~\xdf:~\xdc;

Oh, sorry! That's PHP. My bad... here we go:

print map($%&$_?$":'#',0..~($%=$_)),$/for-32..1

There we go... You're right, Perl is so much worse!

The point is, of course, you can write ugly code in any language, or you can write beautiful code in any language. Python actually is fairly legible nearly all the time...

n=32

while n:print''.join('# '[-n&k>0]for k in range(n));n-=1

but that comes at the cost of added verbosity and reduced flexibility . Whether that's better is a matter of taste, not of fact.

I'm sorry, but which grammar rules in Perl 5 are inconsistent? I've taught Perl 5 professionally, and while I certainly do acknowledge that Perl isn't optimal for learning, "inconsistent grammar" is not on my list. It does have a more-complex grammar than, say, lisp, but it's still an extremely consistent grammar, as far as I've been able to tell.

I also disagree with the claim that a large vocabulary in Perl is a notable issue. The size of the Perl grammar and language is sufficiently smaller, in my experience, than the size of all of the library APIs that I have to deal with when writing Perl programs.

For stuff like string handling, text processing and even variable interpolation, Perl blows Python and Ruby out of the water...

I agree on Python. I disagree for Ruby. It is a tossup. In most cases they are equivalent, Perl has autovivification, it is easier to interpolate functions into strings in Ruby. All in all it doesn't matter.

http://www.google.com/trends?q=perl The downwards trend seems to be flattening off, maybe "it's losing popularity at a slower rate" would have been more accurate? Seems pretty cruel teaching undergrads Perl when they could learn Python.
Interesting that Ruby and Python have been flat for a while.

http://www.google.com/trends?q=perl,+python,+ruby&ctab=0...

I wouldn't have guessed they'd each surpassed Perl around 2007.

Edit: Also, despite a steady decline, watch Java dwarf them all:

http://www.google.com/trends?q=perl,+python,+ruby,+java&...

Most programming topics are going downwards on Google Trends. Probably because more non-programmers are getting online, while all programmers are already using the internet. The exceptions are very new and hot programming topics.
This was done as a free summer course. Language bigotry aside, offering a course to learn another language outside those taught in the standard curriciulum, especially one which costs students nothing, is a win for everyone.
If I offered you free cyanide but I told you it's candy, it's that a win too?
LOL PERL USES FUNNY LETTERS!
I rather learn what $_ means in Perl, just like I know what % means in math or @@ in Ruby, than have to close blocks with things like '))))))))))))))))))' in Lisp languages. The beauty is in the eye of the beholder.

Metrics? How about job trends?

http://www.indeed.com/jobtrends?q=perl&l=

Facts? How about blekko.com and duckduckgo.com, two search engines written in Perl?

It's not about beauty, it's about the ramp-up speed. When Perl was invented, it was really easy to get up to speed if you were already coding a lot in `sh` and `awk` and `make`. You sort of already know the meanings of the punctuations. These days, the most widely recognized punctuations students and other new programmer know are math symbols, so learning a new language that reuse these are far easier than learning Perl. After all, it's far easier to learn and remember French grammar and spellings if you are an English speaker, than to learn Chinese. For this reason alone, I stay clear from languages with a lot of punctuation symbol abuse, i.e. Ruby, Perl, Scala.

Don't get me wrong I don't dismiss the continuing importance of Perl, that's why I was very careful in my wording (minus a spelling mistake). I don't think there's even 1 metric we can agree on when measuring language popularity (Python is ranked 4th on TIOBE and 6th on StackOverflow and there's exactly 0 job posting for it in Hong Kong), so never-mind 1 that tells me definitively that Perl is coming back. After all, for it to come back, it must have gone away before. Ever thought of why? Even if it is coming back, what's the significance? We've had other viable choices for a very long time now. Python, PHP are all doing a very good job that Perl was traditionally good at. Hell, I'd even throw in Ruby as another viable choice too.

Arguing success stories is kind of pointless too, theoretically I can write anything in any Turing-Complete language, so for all I care I could have written Blekko and DuckDuckGo in assembly.

What the hell are you talking about? The only "weird" symbols you need for writing day-to-day perl code are the sigils. The only punctuation you need to use are things that are already well-established in basic math and other very traditional programming languages: commas (list building), exclamation marks (negation), question marks (branching), colons and semicolons (statement ending).
Theoretically, you could also hardwire the entire system into the hardware like in the ENIAC days, no need for a language at all. Theoretically, you could write solutions for np-complete and AI problems with a simple brute-force algorithm. But anyone with a clue knows that's not the case.
The author is (evidently) referring to something well-known to those inside the Perl community which some call the Perl renaissance, a.k.a. the Modern Perl movement, a.k.a. the Perl enlightenment.

There are meta-modules which allow you to pull in all the goodies with a single line of code, e.g. "use Modern::Perl;" or "use Task::Kensho;"

At that point, you are effectively coding in a "modern" dialect of Perl and it's a definite break from the past.

If you are not already interested in Perl, it's arguably not enough to persuade you, but I find it really exciting.

IMO, I think Perl has had its time. It's time to move on. It was invented by Larry Wall to sort of have a unified language that minimizes retraining for a `sh` and `awk` programmer, that's why it keeps so many weird punctuations. These days, the thing that Perl is really good at - regular expression - is found in virtually every language that comes after it. It's had accomplished its historical mission, people have learned a great deal from it.

There was a time when there was nothing but Perl could solve effectively. That was in the 90s. We've had Moderm Perl dialects for a very long time now, they are called PHP, Ruby, and arguably, Python.

Your post is implicitly based on the premise that languages have some sort of ordained-by-Nature sunset process and that Perl's continued insistence on living is some sort of affront against the Natural Order. That's an awfully large premise to slip into a post without justifying it; one could plausibly claim it to be outright begging the question. If a language continues to evolve and clean itself up (and not merely grow without bound), who's to say it can't live for a very long time?
I didn't say it can't live for a very long time, that's why I said I believe it will still be around in my first post. I just don't care much of it anymore now that I have alternatives.
Is it okay if others continue to develop the language, though?
That's why it's called "the Perl renaissance." Renaissance == rebirth, another life.

Incidentally, like an old girlfriend, the language kept going even after you broke up with her :)

LOL. Yeah I suppose I can still see my ex, and you can have her. I'm not marrying her anyway.
She seems happier, more relaxed, more modern these days :)
We've had [Modern] Perl dialects for a very long time now, they are called PHP, Ruby, and arguably, Python.

With all due respect, none of PHP, Ruby, or Python come close to Modern Perl in quality or reliability.

How about this:

http://www.alexa.com/siteinfo/cpan.org+rubygems.org+python-e...

CPAN's popularity vs other language module distribution systems could probably explain why perl is a lot less searched for: most of the typical programming problems have already been solved, tested and smoked in perl. Writing perl these days boils down to integrating things from CPAN, and you don't need the funky characters to do that.

  $_@qw()<>$@{}*&lc()~>>>$.$/$<$:
Which happens to appear to not be valid Perl code.

  $ perl -e '$_@qw()<>$@{}*&lc()~>>>$.$/$<$:'
  Array found where operator expected at -e line 1, at end of line
  	(Missing operator before ?)
  Scalar found where operator expected at -e line 1, near "$.$/"
  	(Missing operator before $/?)
  Scalar found where operator expected at -e line 1, near "$/$<"
  	(Missing operator before $<?)
  Scalar found where operator expected at -e line 1, near "$<$:"
  	(Missing operator before $:?)
  syntax error at -e line 1, near "$_@qw"
  Execution of -e aborted due to compilation errors.
Btw slides aren't in English (and download is disabled, what's up with that?).
I hope he makes the students code. Teaching any student anything without the student understanding the need for it is probably not a good idea.

Thinking back to my undergraduate mindset, I am sure I wouldn't care about what is being said at lecture unless it was practically applicable to something I was currently working on. Just my two-bits.