I owe a whole lot to Perl. So does the practice of computing in general, and the construction of the Web in particular. Perl’s situation is not terribly happy; I wouldn’t go so far as to say “desperate”, but certainly these are not its glory days.
Herewith some thoughts on Perl’s place in history, and how a tiny piece of it bit back at me at OSCON this week.
History · Perl proved a bunch of things that now seem obvious but, a couple of decades ago, would have seemed unlikely and in some cases unbelievable:
You can get serious work done in a language without requiring a compilation step. In other words, a “scripting language” is a perfectly OK thing to be.
You can get serious work done in a language that allows the programmer to say very little about the type of data items.
Content-addressable stores (hashes, dictionaries, whatever you call them) are basic to doing, well, anything; they should be built-in to languages, with a convenient readable syntax.
Regular expressions make many tasks easy which would otherwise be difficult; they should be built-in to languages, with a convenient readable syntax.
It is unsurprising when a powerful general-purpose programming tool is an open-source construct.
It is unsurprising when a powerful general-purpose programming tool includes a vast repertoire of high-quality libraries constructed by a global community of volunteers.
A large proportion of all computer programming consists of string manipulation. As a consequence, languages which have high performance in string processing will be perceived as fast.
Yes, there were other languages with some of these characteristics before Perl. But Perl had all of them and went from an obscure sysadmin tool to the glue that held the early Web together in what seemed a matter of weeks. It taught us a lot of lessons. Which means that its author Larry Wall taught us a lot of lessons, and we all owe him a vote of thanks.
Perl and Me · The text you are now reading has been prettified for your benefit by a large glob of Perl code; this blog’s infrastructure may not be pretty, but it’s largely bug-free and pumps out hundreds of GB month without ever sneezing. Thank you Larry!
Also, in my career I have written two rather large-scale (as in, they harvested billions of pages) Web crawlers, one which in a certain sense made my fortune. Both were implemented in Perl and I found it a highly-appropriate tool for the job. I remember with a certain vindictive glee the doomed pathetic thrashing of the follow-on project; someone with Enterprise Experience decided that my pathetic amateurish Perl crawler should be replaced by a properly-architected Java version.
Recent History · It hasn’t been that kind to Perl. Many people, for example me, have moved on; largely to Python and Ruby, even though they are neither faster nor equipped with better libraries or documentation. I think this process carries two uncontroversial lessons which nonetheless bear repeating:
Object-Orientation is good.
Readability is important.
Yes, I know that Perl can be written in an object-oriented and readable way. And most of all, that Perl remains in wide use and highly relevant in all sorts of situations. But I think the lessons remain valid.
The Ribbon Thing · At conferences there are badges and on badges there are ribbons, often with labels such as “Sponsor” or “Speaker” or “Chair”, designed to make their bearers seem more important. At OSCON, there are ribbons, but anyone can have as many as they want; a bunch of preconfigured ones are provided and there are facilities for customization. Here are mine.
The Ruby ribbon is truncated because it read “Ruby Rockstar” and I’m not one of those. Note the turquoise one reading “Desperate Perl Hacker”; It turns out that, a long time ago in a galaxy far away, I coined that phrase.
The year was 1996 and the XML co-conspirators had plenty of experience with the relative ease of wrangling large datasets in open textual as opposed to closed binary formats. The narrative was something like this: A Vice President with his hair on fire runs into a hacker’s cubicle saying “We have to change all appearances of ‘Soviet Union’ to ‘Russian Federation’ in the whole legal-publications suite and support system and there’s no time and no head-count! We’re doomed!” But the Desperate Perl Hacker triumphs, because the data is in transparent text files. The D.P.H. was repeatedly invoked during the XML design process to support this or that simplifying feature.
Here’s the sad part: Parts of the community at this year’s OSCON deemed the D.P.H. ribbon inappropriate in view of Perl’s somewhat beleaguered status, and it was no longer on display by the time I got there. I managed to obtain one from a plain brown envelope with a bit of nudge-nudge wink-wink, and I wore it with pride.