The "Irrefutable Wave" Myth

Yesterday, Gabor and I went to a PyWeb-IL meeting. It's a monthly gathering of mostly-web Python programmers. We went there to see what can be learned from our peers and to understand the image of Perl in other communities. It was interesting.


There were two lectures: Optimizing Python and RDF and Python. The RFD lecture was actually a lecture I heard at the last W3C gathering a while ago, by the exact same person. Only this time he added a few lines in Python to show how to get things rolling. At least this time someone (me) explained the difference between URI and URL (at the W3C meeting, it took roughly half an hour for 3 different people to explain it).


Off the top, the optimization lecture could be ported to Optimizing Perl. The same claims for "It's not fast, but it's fast enough" and "You don't care about speed until you do". The default method is using a JIT compiler (Psycho), which is only supported in various places and version 2 of it is only available on some SVN and not any website. The other methods include profiling, fixing up some methods Python does wrong, compiling regexes (which are apparently auto-compiled anyway), using sets instead of double for() and if(). That is, slicing instead of multiple loops, avoiding blocking IO, caching (but avoiding memory leaks). Algorithms, algorithms and algorithms. Basically it was close (or similar) to what you would write in a Perl lecture.


The RDF lecture was a bit boring since it contained no code (except the end) and tried to explain metadata and relations. It wasn't enlightening except it gave me an idea for automatically creating RDF of Moose objects. Just a funny thought. Oh, and we thought of maybe adding RDF data to CPAN. Won't it be cool? I don't know, really.


We had a discussion with someone who wrote about "web frameworks", and didn't mention Perl at all (!) and when Gabor asked him about it, he said no one really uses Perl anymore for web, there are no web frameworks, etc. I iterated roughly 7 off the top of my head. He was kind of shocked. This was a lesson: many people who don't like Perl, are fixed on the old image of Perl. He continued with "last time I touched Perl was 5 years ago". I asked when was the last time he even saw Perl code, he said "5 years ago". This reminded me of the title on the Moose beer-coaster I got from Gabor, that says "Not Your Father's Perl".


This brings me to the "irrefutable wave" myth. He said "there's nothing that can be done, there's a wave of Python and Ruby right now. Perl can't fight it. I don't even know what features Perl has right now." Is the wave honestly irrefutable? I don't know what that "wave" really is, but I think it's marketing.


On Email he agreed to try and publish an article about programming web in Perl if we wrote it. After the talk we had at the meeting he simply asked me for "10 reasons to write web in Perl", and he'll try and write an article around that. I think it's a major improvement, since it shows he was impressed and actually cares now to learn more. You're more than invited to name your reasons for writing web in Perl.

5 Comments

Regarding Perl and RDF, there is a hackathon next month in Norway for Perl-RDF people[1]! I would also point you to Class::OWL on CPAN that takes OWL/RDF and compiles it to Class::MOP objects and probably needs some love to port it to a MooseX::OWL.

[1]: http://www.perlrdf.org/workshops/geilo-hackathon.html

No, Perl can't fight anything. Nor should it. It is a friendly programming language that comes with a healthy ecosystem of very good tools and very competent people.

That's one reason why I love to write web / anything in Perl.

All my web stuff these days is static pages and javascript (including AJAX) -- which for me is the irrefutable wave. For that perl is the clear winner since behind the scenes I need authentication and authorization (thank you mod_perl for the hooks), and database access and json spewing (thank you DBI and JSON).

1) Web programming is at its core processing a stream of text and generating a stream of text (a lot of programming actually boils down to that). Perl excels at this task.

2) Dancer.

In Python, when you are building big web applications with tons of dependencies you inevitably seem to end up scraping together code from multiple different places and repositories, and from random svn and git repositories like with Psycho.

In Perl webapps, if you want to add pretty much any new random feature, you just look it up on search.cpan.org and then run "cpan Whatever::Module" and you're done in 5 minutes.

Our work application has 85 direct dependencies, 200 recursive dependencies, and takes 180meg of RAM just to load all the code into memory, and maintaining the entire dependency stack takes only about 4 hours twice a year or so, to keep right up to date with the very latest releases.

And it all self-tests.

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz