Atlas · Details
Ancient Languages: Perl
Author’s note
This is a no-punches-pulled takedown of Perl, because it was actively harming the industry. But I should have been nicer to Larry Wall, who to his credit, did invent something that people loved for a long time.
I met Larry at a party once, and apologized to him. He was very gracious about it.
AI Notes
Steve opens by announcing he is too tired to argue about Perl anymore —
long unpublished essays, years of trying to make unreasonable people see
reason, all behind him. The piece that follows is, by Drunken-era
standards, calm. Larry Wall gets credit for two enormous things: wrapping
Unix into the language and elevating the String to a first-class citizen.
Then comes the obituary. The technical core is Perl's original sin —
Larry's decision to flatten lists by default, so that
(1, 2, (3, 4, 5)) collapses to (1, 2, 3, 4, 5) on
contact. Everything downstream (the bolted-on reference system, the
typeglob slot hacks, context-dependent operators, the periodic table of
sigils) is scaffolding around a design choice that prevented Perl from
ever having decent nested data structures. Marketing covered the gap;
then marketing became the language's main feature.
This is the one full airing of Steve's "languages are religions" thesis, which gets dispersed into later essays after this. It set the template for his later language-obituary pieces — generous about what the language did right, unflinching about what it did wrong, and explicit that the writer no longer cares enough to argue. He just wanted the receipts on record.
Related listings
-
2005
Choosing Languages
Same arc — the column where Steve actually names which languages he does want to use (Java + Ruby). The Perl piece is the negative space around that decision.
-
2004
Tour de Babel
Same year — the broader survey that frames the verdict. Tour de Babel is the museum tour; Ancient Languages: Perl is one room's plaque, expanded.
-
2005
Language Trickery and EJB
A near-companion. The Perl rant is the negative case (a language that aged into a museum); Language Trickery is the positive case (what good design lets you reach for).
Where it was argued
- Hacker News Aug 2013
From the peanut gallery
Read the rest of the thread · 3 more
-
(Is it bad form to reply to my own comments?)
>>>The lack of truly polymorphic access to the built-in containers in Common Lisp is rather annoying.
But I just noticed that (coincidentally) Michael Parker has written at least a partial fix for that too:
http://www.geocities.com/mparker762/
>>>Also a generalized reference system, so you can get and set lists, arrays, strings, hashtables etc polymorphically.
>>> This is not yet a full generalized container system, but
it's a handy first step.
If language designers can't be relied upon to get everthing right in every case (as seems likely), then the best alternative is to give the users a way to fix and extend things themselves.
-
I'd say the ad hominem attacks on Wall were unnecessary, except they seem to form at least 1/3 of your argument. If you had ever met the guy, or attended a State of the Onion talk, you would see how humble this guy is. Expectations are so high for his talks to be hilarious and insightful simultaneously that sometimes he misses both marks, understandably. And, you have to give some slack since the talk was intended to be given only with aural sarcasm and only for Perl & Linux zealots.
Anyway, I think of perl perhaps in a reverse way, trying not to miss the forest for the trees. There are certainly too many quirks in the language, that basically just have to be memorized (list flattening is one of them) - and probably more in Perl than in any other language. Perl doesn't appear to be derived from a minimal set of regular rules; rather it is, but to a language theorist there are so many exceptions as to drive you crazy. Perl is to computer languages as English is to natural languages.
Generally these are the result of well-intended DWIM (Do What I Mean) that has aged poorly. That's why perl has a "cult" - if your DWIM matches well with perl's DWIM, you are a happy camper; if not you are stevey. :) Actually the large number of well-intended yet stupid DWIM's in Perl 5 are the driving force for Perl 6. If it ever arrives, it's anybody's guess whether Ruby programmers will flee to Perl6 the way Perl5 programmers are currently fleeing to Ruby.
Ultimately the productivity, success, and happiness of the people using perl will have to be the judge of the success of the language itself.
I wish your future non-Perl company well. But don't worry about Perl at Amazon. All our programmers who use Perl also use at least 1 other language daily...let's get the same from our Java programmers.
-
Thanks for the well-considered comments, Doug. The essay is just my own opinions, and language discussions always come down to matters of taste, so my responses here are of little worth. Nevertheless...
> I'd say the ad hominem attacks on Wall were unnecessary
I'm afraid they really are necessary. Larry has turned what was a gentleman's war into guerilla tactics. He consistently and cleverly (I never said he wasn't brilliant) slanders other languages and language communities, and encourages this behavior in his lieutenants. He's made logical fallacies fair game, and he regularly crosses the bounds of common decency, so I have no qualms about employing ad hominem in response. I've given it considerable thought, and tried for at least a year to finish this essay. It was only when I realized I have to combat his tactics with my own political commercials that I was able to make progress. So ad-hominem it is. He's crazy, and I'm not going to politely gloss over the issue. Reminds me of this movie dialogue:
Will Graham: I know that I'm not smarter than you.
Doctor Hannibal Lecktor: Then how did you catch me?
Will Graham: You had... disadvantages.
Doctor Hannibal Lecktor: What disadvantages?
Will Graham: Passion. And you're insane.
> you would see how humble this guy is.
What he's like in person is irrelevant. Most of the world hears his message through his writing, as he well knows. His speech is by no means an atypical example of his writing, so his behavior at conferences can only be considered posturing. He is the consummate marketer, after all.
> Perl is to computer languages as English is to natural languages.
This is far and away the strongest argument against Perl. English is a terrible language, desperately in need of spelling and grammatical reform. By anyone's standards, it should be the last model you'd use for a design philosophy. Larry uses "Just like English" as one of his typical silly appeals to nonreason. Not surprisingly, Perl isn't very popular in non-English-speaking countries; they know better.
> Ultimately the productivity, success, and happiness of the people
> using perl will have to be the judge of the success of the language
This might be true, if you find a way to include the productivity, success and "happiness" of people who are forced to use it because there's so much of it at Amazon. Many people are miserable about the whole Perl experience, yet Perl's marketing (which is also conducted internally by card-carrying cult members) makes folks feel it's their fault for not liking it better.
> let's get the same from our Java programmers.
Indeed. Everyone ought to be comfortable with at least five languages. Twenty is even better. The one I've been tackling most recently, incidentally, is PostScript. Knowing a whole bunch of languages is very nearly as effective as writing a compiler or interpreter.
Perl, for all its flaws, is still preferable to C++ in most cases.
But what do you do until that day when you get to start your own non-Perl-based tech company? Is there gritting of teeth involved, or do you just go about your daily business, secure in the knowledge that you will do it differently - someday? I'm being a little cheeky, but it's also sort of a serious question stemming from my newness to Amazon.
I had a whole lot of flexibility at earlier positions, and I used this to my advantage: using Python when I thought it was the right tool for the job, using Ruby for other projects. That worked fine, but these were smaller ponds where I was a relatively big fish. What happens here, where it's a very very big pond indeed?
— Brian W · December 6, 2004 09:10
Another terrific essay Steve. I'm citing your blog to potential new-hires as another reason to work at Amazon...
On the clunkiness of the alternatives to Perl...
You include lisp, and with some good reason (The lack of truly polymorphic access to the built-in containers in common lisp is rather annoying. And string support is a bit insane in places.)
But at least lisp lets you _fix_ the things that you don't like, and in a seamless way. It's easy (as Paul Graham is doing in Arc) to write a variant of
'let'that defaults to a single binding and so eliminates all of the parentheses. And if you don't like the default hashtable functions, just write some convenient syntax wrappers.e.g. Michael Parker has written reader-syntax macros that implement most of Awk in Common Lisp
"Lisp isn't a language, it's a building material." - Alan Kay.
— Chris N · December 6, 2004 06:28