Hacker News new | past | comments | ask | show | jobs | submit login
Why is perl losing its touch? (google.com)
31 points by gatsbysong on Feb 22, 2015 | hide | past | favorite | 69 comments



This one page isn't a good indicator of a language's popularity. It probably includes results referencing Monty Python, as indicated by the news article headlines, or the animal python.

The TIOBE index might be a better indicator of programming popularity using internet search results:

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

but that's still not perfect. You could also look at the number of job postings on sites like Indeed asking for Perl experience.


Looking at HTML, CSS, Ruby, Python, PHP, JavaScript, Perl... they're all losing popularity. http://www.google.com/trends/explore#q=php%2C%20ruby%2C%20cs...

Looks like this internet thing was just a passing fad after all.

EDIT: Even more interestingly, there is an inverse relationship between searches for PHP and pizza. What does this mean? http://www.google.com/trends/explore#q=php%2C%20pizza&cmpt=q...


Look at the queries... they're all noob oriented.

How to use a for loop, hash, or array?

I'm not saying that the supply of noobs drying up is a good thing, but...


TIOBE is almost more flawed, since it pretends to be scientific while only querying a bunch of search engines (google, SO, wikipedia) for "<language> programming", which is skewed towards languages that tend to be mentioned with the word, such as http://en.wikipedia.org/wiki/C_(programming_language) , as opposed to languages that have a unique enough name, such as http://en.wikipedia.org/wiki/PHP


I just looked at that, and apparently F# is more popular than Ruby! As much as I wish that were the case, it's pretty suspect...


Unless I'm wrong: The popularity doesn't mean anything necessarily good. More people are probably asking for help in F# than they are in Ruby (much simpler to comprehend). The results aren't really helpful they just give you back indiscriminating numbers.


Tiobe is gamed bigtime by promoters of some of the smaller languages in the 21 to 50 range, and postings for IT jobs that don't exist is a con that's been going on for decades.


You can filter a lot of that out.

http://www.google.com/trends/explore#q=perl%2C%20python%20-m...

Looks like the interest in monty python and snake pythons is pretty constant.


It's fairly obvious that the python programming language results are fairly drowned out by the Monty Python and snake results, as illustrated by all the news headlines shown for python, and by related topics and queries.

That's not to say that the trend shown is entirely incorrect, just that it would be mostly coincidental to the data shown here.


Comparing 'perl language' and 'python language' shows a similar trend: http://www.google.com/trends/explore#q=perl%20language%2C%20...


Which falls prey to the fact that people don't need to disambiguate "perl" when searching, but often do for "python". Changing it to "perl" and "python language" isn't very useful either, as it so severely limits the python query as to be unusable.

To be clear, I don't doubt there is a drop in Perl mindshare and usage, I just don't think the original comparison, or the alternative one you posted, really shows a relation between Perl and Python in any meaningful way.


How about "programming perl/python". a graph very similar to OP's http://www.google.com/trends/explore#q=programming%20perl%2C...


That's identical to "<> programming", which gets a boost because python gets disambiguated.


No, it doesn't. There's no reason for the proportion of people looking for perl related stuff who use "perl language" as a search term to change over time. That proportion might affect the absolute numbers, but not the trends.


It is pretty simple to check to see if it is really refrences to monty python.

http://www.google.com/trends/explore#q=perl%2C%20python%20-m...


Well, you can try selecting the right category:

http://www.google.com/trends/explore#q=perl,+python&cmpt=q&c...


To be honest, i'm not too sure how trustable that data is, given the odd details like the regional interests and that sharp change in this graph: http://www.google.com/trends/explore#cat=0-5&q=JavaScript%2C...


It's because perl guys doesn't need to google for answers after 10 years.


I'm not sure you are comparing apples to apples here. I would instead consider a graph like this one: http://www.google.com/trends/explore#q=%2Fm%2F05zrn%2C%20%2F...

Though I am not sure how Google categorizes search terms intro specific things like a programming language versus a python snake, etc. I wasn't offered a Python language selector so I changed it to Java and added Go for fun.


I'm sure you are comparing apples to oranges here. Perl mainly is an alternative to shell script. A language for administrators.


That's probably it's number 1 use case. However, I've seen it used to build million+ user game servers, GUIs, etc. It's general purpose.


I compared perl and JavaScript:

http://www.google.com/trends/explore#q=Perl%2C%20JavaScript&...

And they both have a similar decline.


JavaScript is so yesterday, Ada is clearly the language of the future. :P

http://www.google.com/trends/explore#q=ada%2C%20JavaScript&c...


JavaScript is so yesterday, jquery is clearly the language of the future.

http://www.google.com/trends/explore#q=JavaScript%2C%20jquer...


How does Google calculate interest? What's it normalized against? The overall decline might just be a function of the decline of software engineers as a percentage of the internet using population over time.


Javascript is ~2x more popular at the start but is ~8x more popular now.

The absolute decline looks similar but given javascript's higher starting value the relative decline is much less.


Death by a thousand cuts...PHP cut it off at the knees because it was trivialy easy to do web apps on a shared host; Perl hosting was far harder. Ruby came on the scene, and stepped in as a spiritual successor to Perl. Perl 6's infinite development cycle sapped the life out of the community. All of which led to fewer modules being added to, or updated on, CPAN. Fewer fresh modules drove more use to other languages that did have the fresh modules

I.e. a really nasty downward spiral that leaves perl occupying the same space as COBOL and FORTAN - a language used in massive legacy systems, but rarely used in new systems unless implemented by ancient wizards.

One the upside, pretty soon Perl wizards will be able to charge the same rates as COBOL & FORTRAN wizards...


> All of which led to fewer modules being added to, or updated on, CPAN.

That's a compelling story. Lots of folk believe it, including, it seems, you. But have you checked your sources and data? For those interested in data and irony, watch about 2 minutes of either or both of these from last summer:

The slashdot story ("Always check your sources"): https://www.youtube.com/watch?v=hHy5h6ZRL6M#t=4m

CPAN data: https://www.youtube.com/watch?v=hHy5h6ZRL6M#t=7m

> Perl 6's infinite development cycle sapped the life out of the community.

Again, lots of folk believe this story. For another dollop of irony the leading current P6 attacker was once the leading P6 booster around 2010. When he was pro P6 he didn't accept suggestions that it was slower than dog slow. (It was.) Now he's anti P6 he doesn't appear to be accepting that it's been speeding up every month and is due for official launch within a year. (It is.)

P6 is now flying under the radar but stories like this are around if you look for them, like this from a day or two ago here on HN: https://news.ycombinator.com/item?id=9089259


I would caution against bringing chromatic up in any context including Perl 6. That particular period of history is complex enough with enough blame to go around that I doubt any gain you hope to get by bringing it up will work as you expect. Best to respect his wishes and leave him out.


For another dollop of irony the leading current P6 attacker was once the leading P6 booster around 2010. When he was pro P6 he didn't accept suggestions that it was slower than dog slow. (It was.) Now he's anti P6 he doesn't appear to be accepting that it's been speeding up every month and is due for official launch within a year. (It is.)

I've asked you multiple times in multiple places not to speak for me. Your assertions here are nonsense.

Please cease and desist.


Because everything perl can do python can do better? Okay that is a though claim but perl and python fit about the same area - a dynamically typed scripting language that can take over when that shell script gets too big and all the way up to a full-blown app or website, but you are not going to win any prizes for speed - but python doesn't have all the weird crap that goes along with perl (what exactly does $#% mean again?) and it has everything else.

Perl was a great language in its day but I just don't see a case where are new programmer is better of starting a new project in perl rather than python.


Why wouldn't you want sigils?



I'm always at a loss as to why people take such delight in the real or perceived decline of Perl.

Perl and Python are similar, excellent programming languages, and I don't imagine Larry and Guido argue like children about it when they meet at conferences.

I'll just quote Bjarne Stroustrop: There are two kinds of programming languages. The one's people complain about, and the one's people do not use.


Perl was a victim of its own success.

Perl is one of the few languages associated with the web that was really pre-web. It's because of Perl's inspiration that we have PHP and Python. So while the language evolved, it was never web centric at heart.

Another great thing about Perl was in the early days of the web it appealed to both real coders and script kiddies. But as time went on the script kiddies tended to move on to languages like PHP, so only the pros are really left.

The last issue with Perl was that it was never a favorite of computer science programs, so it was always a bit of a hackers language at heart. So there is a wonderful community around Perl, but it makes it very hard if you run a shop to find kids out of school who know the language vs. Java back in the day (and other languages today).

But I know a few coders who still really love Perl in hearts, so while the popularity hasn't grown I would say the language does have a very hard core dedicated following.


> The last issue with Perl was that it was never a favorite of computer science programs

It's funny, it found a home for a long time in various linguistic programs.


There's a clear contender: http://www.google.com/trends/explore#q=perl%2C%20python%2C%2...

I also strongly recommend looking at the headlines marked on the graph.


The question assumes that the relevant forces weren't in motion much earlier (they were, it just takes time for the basic changes to show up clearly in things like this search)


Relevant: Trend analysis at the shallow end of the pool - https://news.ycombinator.com/item?id=9099675


Any idea on the high interest in Luxembourg?

Due to the financial industry?


The population of the country is only like 500k. With such a small dataset one guy can probably move the needle.


More interesting question is why the JavaScript curve is decaying at the same rate as Perl (add it to the graph and see).


I think a better indicator would be "Perl tutorial", since that might tell you how many new people are joining.


It turns out not to be all that much different, the ratio is about the same http://www.google.com/trends/explore#q=perl%20tutorial%2C%20...


I think it's better to flip the question around:

I make my living writing single-page web apps in JavaScript. These days, everything I do, even on the server, is in JavaScript.

What does Perl do a hundred times better than the latest in the JavaScript universe (ES6, Meteor, node.js, etc.)? If it doesn't, that right there is your answer.


> What does Perl do a hundred times better than the latest in the JavaScript universe (ES6, Meteor, node.js, etc.)? If it doesn't, that right there is your answer.

Well, for a start, it's relevant for more than 3 months.

Asking for doing something 100 times better is quite a mouthful, coming from a JS developer.


You clearly work in the web industry =)

perl does one thing hundred times better than (server-side) JavaScript: when you need to get data out of a server that you have no sudo privilege because your boss asked you to get stats on your trades ASAP.

This happens shockingly frequently in finance, and perl (and actually, awk) was the only scripting language that I could safely assume was installed.


Being sure that this one tool is available all the time is actually a key argument I have to say. One of the reasons I started to learn vim.


> What does Perl do a hundred times better than the latest in the JavaScript universe (ES6, Meteor, node.js, etc.)?

A concise POSIX interface. Conciseness in general, really. How many node one-liners do you see?


The fact that I can be contemplating career suicide after reading the source to CGI.pm one minute (once amazingly useful and best of breed, now a crufty monster) and the next doing insanely useful things with metaprogramming, declarative interfaces and terse, easy to read code :)


I have to agree. There's nothing you need Perl for, and nothing it specifically offers. Like if you want to do something in Wordpress you can only use PHP, no choice. If you want to code a Linux driver you have to use C. If you want nice features like awesome readability you choose Python. If you want awesome power you use some kind of Lisp or Haskell.

There is not a single (well known) reason for using Perl. Even if it's 10% better and faster than any other language without a unique selling point the cost of switching is just too high in most cases.


No language handles regular expressions as easily as Perl. Perl's power has always been in its power to do text processing.

That said, it's objects and pointers are a joke. At least Perl 5's are. As for Perl 6, I don't know. It couldn't hold my attention for 15 years.


"That said, it's objects and pointers are a joke. At least Perl 5's are."

MOOOOOOOOOSE!

http://moose.iinteractive.com/en/

I agree, nobody uses the native stuff.

Its like claiming Perl DB support is a joke. Well, yeah, everyone uses the addon package.


That can be also said about Python now that they pretty much froze the stdlib. You are right, a language should be evaluated by it's general power, not just by it's stdlib. If you can easily install Perl packages every Perl package should be part of the equation.


Why is AWK or SED not easy?

So yeah. There are a few languages which are quite good at text parsing nowadays. Another key argument was the huge amount of packages. But most languages have that now. There are also lots of scripting languages who can be written quite fast, like Python or Ruby. That's what I mean with there is not a single thing left that you really need or want to use Perl for beside having used it the last decade already. For everything that Perl can do there is at least another tool that is as good.

But all of that is not a shame. Every language will go that path, especially one that is so common as Perl was. Everybody wants to copy the best, until one day it's not the best anymore.


You missed qr/Moo(?:se)?/

All the nice bits of dynamic OO with the option to go procedural or functional when needed.


How does Perls regex stand up against Python? I mean once Perl was the pearl of regex/text processing (The Common Lisp package that everybody uses for regexis pcre, Perl Compatible Regular Expressions) but that was a long time ago.


= About Python regexes =

Aiui "The Future of Python Regexes" SO answer at http://stackoverflow.com/a/7066413/1077672 written by regex (and Perl) expert Tom Christiansen (and last updated by him in 2012) is still good info.

In brief, https://pypi.python.org/pypi/regex appears to be the path forward for Python. This engine is much closer to the power and Unicode compatibility of Perl 5's default regex engine.

= About Perl 5 regexes =

Aiui the default Perl 5 regex engine is significantly faster than the 're' regex feature included with Python 2. I don't know how it compares to the new 'regex' module.

Regexes in Perl have the advantage/disadvantage that they are syntactically integrated in to the language (a disadvantage if you don't like it being integrated).

Since Perl 5.10, a different regex engine can be plugged in and used without requiring any change in code that uses regexes (unless an engine uses a different syntax of course). (But it takes a lot of effort to package a regex engine up for use with Perl 5.)

A given regex engine can be extended using the overload module. Extending is relatively easy.

= About Perl 6 regexes =

A whole new ball game, two decades ahead of Perl 5 regexes.

http://en.wikipedia.org/wiki/Perl_6_rules

http://doc.perl6.org/language/grammars

https://github.com/moritz/json/blob/master/lib/JSON/Tiny/Gra...

Generally matches Perl 5 regexes feature-for-feature but with a much cleaner syntax. More importantly, unifies regexes and grammars.

Currently way slower than Python or Perl 5 regexes. Supposedly will eventually (5 years? 10?) incorporate all the key optimizations in the Perl 5 engine and become faster than Perl 5 regexes.


Case in point, with the countdown to Perl 6 now on the cause seems hopeless:

Perl 5.20 / 19Mb Apache log file / time: 1 sec

perl -wnl -E 'say $1 if /\b(\w{5})\b/' logs.txt

Perl 6 (MoarVM 2015.02) / 19Mb Apache log file / time: 88 secs

perl6 -n -e 'say $0 if m/(<<\w5>>)/' logs.txt

Given that efficient text & regex parsing is Perl's forte I don't see Perl 6 satisfying the basic requirements of Perl 5 hackers.


i totally understand that such key words are polluted with searches like Monty Python, but the trend does seem to change much even if we apply more restricted key words, as already pointed out by many other replies before. in the end it's really just a matter of habit using what programming language to do what, it's still, however, interesting to see how popularity of one language come and go.


Perl always will be my favorite language. Its absolutely a joy to write. What's interesting to me is that all the things that people like about JavaScript, Perl had first, and I think better (closures, first class functions).

The criticisms that people had about Perl, such as that it langrage like line noise was unfortunate. Being able to tell whether something was a scalar, array, or hash by the character that preceded it was helpful.

Being able to slap a set of braces around code to create a closure was also much better than needing to do the same in a function like JavaScript.

Perl formed some much new ground. CPAN was the predecessor of npm, etc.

I'm just glad to be able to write functional code again through JavaScript, just like when I wrote Perl. I don't miss writing Java (or any static typed object oriented language) at all, and hope I never will again. I just hope that ES6 doesn't turn JavaScript engineers into object oriented programmers.


Which popular language nowadays doesn't have closures? Even the so hated (by HN) PHP has had that for many years already.


Python is often claimed not to have closures but that isn't really true, what it doesn't have is anonymous functions. It does have a lambda statement, but that is limited to a single statement.

So what you end up writing is more akin to:

    def multiplier_maker(a):
      def temp(b):
        return b * a
      return temp
That is because Python allows you to declare a function anyware, even inside other functions.


And if you want to emulate static variables in a function, you can do that:

    def counter():
        counter.x += 1
        return counter.x

    counter.x = 0
    counter()
    > 1
    counter()
    > 2
Beware! singleton variables, mutable state, etc.


You can do it by closing over a variable as well. Python closes over things just fine, it just has problems rebinding variables in outer scopes that aren't the global one. Here, I just make the variable a container, so I can alter a value inside it, instead of rebinding it ( only python2 has this problem, python3 has a "nonlocal" keyword to work around this in the language )

    >>> def counter():
    ...   x = [ 1 ]
    ...   def count():
    ...     y = x[ 0 ]
    ...     x[ 0 ] += 1
    ...     return y
    ...   return count
    ... 
    >>> count = counter()
    >>> count()
    1
    >>> count()
    2
    >>> count()
    3
    >>> count()
    4
    >>> 
    >>> otherCount = counter()
    >>> otherCount()
    1
    >>> otherCount()
    2
    >>> count()
    5
    >>> count()
    6
    >>> otherCount()
    3
    >>>


> what it doesn't have is anonymous functions

If it's not anonymous it's not a closure though.


Bullshit. It closures around its environment, it is a closure.


Python.


Under what definition of closure does python lack them?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: