![]() |
![]() ![]() | |
| . | |
T A B L E__T A L K Chat room ethics: Share your personal list of do's and don'ts in Table Talk's Digital Culture area - - - - - - - - - - R E C E N T L Y Typing for nonconformists Let's Get This Straight The games people play Wired acquired Under the Microscope - - - - - - - - - - BROWSE THE - - - - - - - - - -
- - - - - - - - - -
|
|
THE JOY OF PERL | PAGE 1, 2, 3
How exactly does Perl do it? How is it different, really, from the host of other computer languages vying for supremacy under the digital sun -- Java or Python or Tcl? Perl, says its fans, is a "Swiss Army chain saw" -- a tool that can do anything with brute efficiency. One doesn't have to be the kind of programming genius who can think in Java or C++ to be able to use Perl, although its own flexibility can make it confusing -- especially to hard-core programmers who are accustomed to having just one right way to do something. But Perl's greatest advantage lies in the way it functions as a bridge between other computer languages. "Perl has always been, and continues to be, the archetypal glue language," says Chip Salzenberg, one of Perl's leading code contributors. "Its evolution is, by design, driven by the needs of real programmers as they face the day-to-day challenges of making complex and uncooperative systems work together." Larry Wall believes that this evolutionary process mirrors how the real world works. "Perl does a lot of hand-holding," says Wall, "and gives very good feedback on what it thinks is wrong with your program, so there is a very rapid turnaround if you are trying to develop something quickly. You try something and it breaks and you fix it, you just grow it, evolve it. This is how I program, this is how I write. This is how a lot of people write, this is how they think." Perl's reflection of real life -- its humanism -- is, says Wall, built into the deep philosophical structure of the language. Perl is "the first postmodern computer language," says Wall -- "an artificial natural language" that imitates how programmers think. The deep structure of all languages has always been a central concern for Wall. Before he committed to a lifetime of systems administration and associated hacking, he and his wife were graduate students in the linguistics department at UC-Berkeley. Their plan, says Wall, was to become field missionaries dedicated to assisting Bible translation. They would go live with a tribe that had no written language, learn it from scratch, write it down and then help translate the Bible into that language. He and his wife abandoned that mission, but he replaced it with another -- assisting other people in the ever-relevant goal of connecting with one another to do useful things. When it came to creating a programming language, instead of building something totally new from the ground up, Wall -- inspired by his linguistics training -- chose to build something that replicated how real humans thought and acted. First and foremost, that meant providing a number of different approaches to solving every possible problem -- which led to the Perl battle cry, "There is more than one way to do it." "If you think of a human language as an artistic medium," says Wall, "it has to give you room for creativity. If you want to be able to optimize for different things -- if you want to be able to write recipes and poetry and newspaper columns or magazine articles in the same language -- then there has to be flexibility. This is the antithesis of what people are taught in computer science. People are taught that if there is any redundancy at all that that is evil, wicked. Coming from a natural language perspective, I just don't buy it." Perl evolved the way a real language does, assimilating chunks of other languages over time -- a little Unix, a little C++, a little BASIC, a little this and a little that. And if anyone else came up with something new and useful, Perl would incorporate it. When Wall invokes the concept of "postmodernism" he is referring to Perl's eclectic, inclusive approach -- its ability to find a little bit of truth in every nook and cranny -- without at the same time pinning itself to any one grand Truth. "When it comes down to it, most computer languages try to make the programmer think like a computer," says Wall. "I tried to make the computer think a little more like a programmer, with some degree of success. The question is, who's to be master, that's all." Despite Perl's popularity, the language is not without its detractors. Marc Ewing, chief technical officer at Red Hat, the leading distributor of commercial versions of Linux, prefers working with Python; and Infoseek, the Internet search engine company, uses Python for its internal development work. Perhaps the most pointed criticism comes from Eric Raymond, who has long touted Perl as one of the great success stories of the open source movement. "The design of the language is showing its age and significant signs of bloat," says Raymond. "Perl was never a pretty or elegant language; its lure lay in its brute usefulness. Over time, the problems consequent from Larry's early choices seem to me to be accumulating and reinforcing one another just a little faster than the benefits pile up." "These problems have created a significant brain drain away from Perl to other scripting languages," says Raymond. "I'm part of this trend personally; I have essentially abandoned Perl for Python, a younger language with a similar application range but a much cleaner design ... I expect that Perl's relative importance will probably decline in the future, even while its developer base continues to increase in absolute size, because its competitors will grow faster than Perl does." Perl is anything but clean -- indeed Perl hackers use the word "messy" almost as a point of praise. But for Perl's detractors, and especially for Python devotees, messiness is not next to programming godliness. "One complaint about Perl that I hear frequently from Perl users who also use Python -- and who often but not always prefer Python -- is that even your own Perl code is hard to read back when you've been away from it for a while -- let alone someone else's Perl code," says Guido Van Rossum, Python's principal author. "This is much less a problem with old or unfamiliar Python code. While Perl proponents make big efforts to encourage Perl users to write clean Perl, and newer Perl versions contain features to help them, Perl's insistence on the value of messiness means that it will always be a problem with Perl." On one level, the Perl/Python debate is just another example of the endless jockeying for supremacy that characterizes hacker discourse. But the core tension is real -- a tension between those who seek purity and those who are content with utilitarian efficacy. "Language purists have always said that Perl was ugly," says O'Reilly, "that Perl was a 'kitchen sink' language, that Perl would collapse under its own weight. Yet Perl goes on solving more problems than all the other scripting languages put together." "We sell the bestselling books on both Perl and Python," adds O'Reilly, "and what we see is a continued healthy growth in the use of Perl, while Python use is flat. Perl is orders of magnitude more widely used than Python, and we see no signs of that changing, at least based on book sales." "Perl is not suffering a brain drain of any magnitude," adds Salzenberg. "At most you could say that other languages are growing at the same time that Perl continues to grow. And that's fine for Perl. A glue language is most useful when there are lots of things that need gluing ... Perl will continue to become whatever is needed to connect everything to everything else." Wall lets others man the defenses against Perl's assailants. When I asked him for a response to a point-by-point critique from Raymond, he sent me a one-line e-mail quoting Leo Tolstoy: "'It is amazing,' wrote Tolstoy, 'how complete is the delusion that beauty is goodness.'" For Wall, goodness is making connections, which has a beauty all its own. Perl glues more than just the world of C programmers to the world of Unix shells, or the digital severity of the computing world to the inchoate confusion of human reality. Perl also bridges the gap separating the two extremes of the free software world -- the commercial pragmatists represented most volubly by Raymond, who espouse free software principles because they produce the best software, and the radical moralists led by the Free Software Foundation's Richard Stallman, who believe in free software as an absolute good. Those who wish to modify and change Perl can choose to do so under the restrictions imposed by two different licenses. They can operate under the GPL -- the extremely strict license created by Stallman's FSF that is aimed at ensuring free software always remains free. Or they can choose Wall's own "artistic license" -- a more forgiving set of rules that means, Wall says, that "essentially you can do anything you want with Perl as long as you leave me artistic control over it." "It was enough to sneak it by the FSF without raising their hackles," says Wall, "but in actual fact the artistic license is closer to my feelings on the subject. I want Perl to be used." And it is. Perl opens up possibilities in seeming dead-end alleys -- one major reason why so many Perl hackers, when asked why they love Perl, simply reply that it's fun. I asked Larry Wall why he thought Perl was fun. "It lets you be creative," he says. "It gives you choices. Your typical computer language is like a train, it will take you anywhere as long as there are tracks there already. Perl is more like an off-road vehicle that will get you where you are going, even if there is no official way to get there." When you can facilitate that kind of path-finding, you reap what you sow. Larry Wall, sitting in his living room in Mountain View, petting his cats, listening to the weird sounds ricocheting around his house, looks like a pretty happy guy. He's given something very valuable to the Web, and the Web won't let him forget it. "Hardly a day goes by that somebody doesn't write me a message saying that I love your stuff," says Larry Wall. "'It changed my life, I used to hate programming -- now programming is fun again.'"
Share your thoughts on Perl in the Digital Culture area of Table Talk.
The saint of free software: Maverick Richard Stallman keeps the faith -- and gives Bill Gates the finger. The little operating system that could: Microsoft, beware -- Linux fans are hell-bent on world domination. Let my software go! Netscape was desperate for a new strategy against Microsoft. Eric Raymond had one. Apache's free-software warriors Developers collaborate online -- and shake Microsoft and Netscape. |
Arts & Entertainment | Books | Comics | Life | News | People
Politics | Sex | Tech & Business | Audio
The Free Software Project | The Movie Page
Letters | Columnists | Salon Plus
Copyright © 2000 Salon.com All rights reserved.