Live data from Hacker News

The Perl Renaissance

lanyrd.com

1–10 of 130 posts

Re: The Perl Renaissance

#2
...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument)

...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way!

(don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a much better place if Rasmus Lerdorf would have learned Perl and written a nice Perl web framework instead of inventing PHP :) )

Re: The Perl Renaissance

#3
Wow.. I've been using Perl heavily for the last three years and he still managed to cram some amazingly useful stuff I didn't know into that short talk.

Well worth watching if you still equate "Perl code" with "line noise" :)

Re: The Perl Renaissance

#4
post #2

...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…

- CPAN

- efficient and compact regex scripts

- one-liners.

Of course, some of these could be considered a reason NOT to use Perl depending on your specific circumstances.

Re: The Perl Renaissance

#5
post #2

...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…

Python significant white space. Really, that's what preventing me for ever liking Python.

Re: The Perl Renaissance

#6
post #2

...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…

So it's dying, but not visibly? I can't really parse that, but I bet the answer will contain quite a few Perl 6 references…

Re: The Perl Renaissance

#7
post #4
post #2

...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…

- CPAN - efficient and compact regex scripts - one-liners. Of course, some of these could be considered a reason NOT to use Perl depending on your specific circumstances.

CPAN ~ pypi ~ rubyforge. Ruby allows you to write decent one-liners too, though people don't like to use it this way.

the only argument I can extract from this is "Perl has a much nicer syntax for working with regexps", and I agree with this (and I hate it when other languages don't fully embrace regexps and treat them as first class citizens).

but that's the thing, not even the "reasons not to use it" are unique to Perl any longer: heck, if you want to write incomprehensible code for "job security" reasons, Ruby gives you enough rope to hang the whole neighborhood (and Python too has a "dark side", but fortunately most people don't know or want to learn about it)

Re: The Perl Renaissance

#8
Great talk! I've never posted before, but I'm inspired to today. Forgive me if my code is formatted terribly this post.

I used Perl back around 2000, like everybody else, to make CGIs. Then went away from it for a long time. But I've used Perl over the last year to create a large DMCA takedown system, the bulk of which is spidering and analyzing web pages for infringements. Torrent trackers, one-click file download sites, etc.

It's been a beautiful experience. The code runs quickly (for a scripting language), and CPAN is AMAZING. I feel Perl was the best choice for this project, and since I enjoy the language--and trust me, it's NOT line noise: these aren't little scripts, this package-based, documented, modular software development, the likes of which people normally associate with Java (for instance.

I have to say I disagree with one point in that talk. I don't think there are "too many" ways to do OO in Perl--and this sort of ties into his gripe about "@_" and slurping in subroutine arguments, which I think is pure joy. I'm not certain, but I think Larry Wall got this from Lisp. Please correct me if I'm wrong on my history there.

Anyway, in one package that I use as an object, I have this code:

    #/ @param object $this    an Offense::Analyzer
    #/ @param string $event    an EVENT_x constant value
    #/ @param int $targetId    a target id
    #/ @param int $obvious    TRUE for obvious offenses, or FALSE
    #/ @param int $same    TRUE for offenses found on the same target, or FALSE
    #/ @return int    the value for the given event, or undef
    sub getEvent($$$$$) {
        my ($this, $event, $targetId) = (shift, getEventFor(shift), shift);
        my $obvious = getObviousKeyFor(shift);
        my $same = getSameTargetKeyFor(shift);

        return undef unless $this->hasTarget($targetId);
        $this->{'data'}{$targetId}[$obvious][$same][$event];
    }

And I supplement that code with the following convenience getters:

    sub getIgnored($$$$) { shift->getEvent(EVENT_IGNORED, @_) }
    sub getNotified($$$$) { shift->getEvent(EVENT_NOTIFIED, @_) }
    sub getQueued($$$$) { shift->getEvent(EVENT_QUEUED, @_) }
    sub getRemoved($$$$) { shift->getEvent(EVENT_REMOVED, @_) }
I love the convenience of being able to use the incoming arguments array in this manner. In fact, because you explicitly pass the object reference as the first argument to methods in Perl, I even have this:

    #/ @param object    an Offense::Analyzer
    #/ @param string    an EVENT_x constant value
    #/ @param int    a target id
    #/ @return int    the value for the given event
    sub getEventTotal($$$) {
        int(getEvent(@_, TRUE, TRUE)) +
        int(getEvent(@_, TRUE, FALSE)) +
        int(getEvent(@_, FALSE, TRUE)) +
        int(getEvent(@_, FALSE, FALSE));
    }
Those are not static method calls (so to speak--package sub calls), but are object method calls. I love that convenience.

Does your fluency need to be very high for this to seem like a good idea? Probably. And in this manner, Perl can never compete with Python. But I guess my argument is similar to the argument a lot of Lisp dialect programmers make: I'm an advanced user, I don't need to be babysat, I can take care of myself, and I'm ok with exploiting the expressiveness of the language.

Re: The Perl Renaissance

#9
post #6
post #2

...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…

So it's dying, but not visibly? I can't really parse that, but I bet the answer will contain quite a few Perl 6 references…

I use "visibly dying" for a technology that people are migrating away from - this usually generates things like blog posts titled "X is moving away from RoR because it's crap and rewriting their stack in new fangled scala framework".

But there are other ways something like a language can die in: no new projects get written in it, no new programmers learn it etc. ...this is a slow "death in silence and darkness" (think Pascal).

Re: The Perl Renaissance

#10
post #2

...don't get mad for the question, but: anybody has any arguments for using Perl instead of, let's say Python, these days? (besides the "I already know it incredibly well" argument) ...cause the lack of an answer to such a question has only one conclusion: the language is dying, even if this is not already happening in a visible way! (don't get me wrong, I'm not a Perl hater, and fyi, I think the world would be a muc…

It's a very fun language to begin with. Which is not unimportant if you want to keep being motivated after three decades being a programmer. Peter Norvig described 7 features which made Lisp different. Perl shares 6 of them. Important features like first-class functions, dynamic access to the symbol table, and automatic storage management. (source "High Order Perl" by MJ Dominus).
Post reply on HN