![]() |
![]() |
![]() |
|
Perl Gets An Extreme Makeover
After 17 years, Larry Wall's creation is about to get a major facelift. The verdict: Perl 6 isn't perfect, but it's clearly a big step forward for one of the world's most popular and important programming languages Perl has long excelled as a productivity tool for text processing and, with the advent of object support in Perl 5, as an application development tool. However, for just as long developers have derided Perl for its syntactical rules; it has been a source of wonder and consternation among programmers. In any case, the fact is that Perl is getting rather long in the tooth. In the summer of 2000, when the Perl community decided to go back to the drawing board, as opposed to merely pursuing incremental improvements to Perl's "State of the Onion," they embarked on an ambitious journey. Although that journey isn't over yet by any means (it's still unclear exactly when Perl 6 will be ready for prime time), it's obvious that some big changes are in store. Perl Gets A Parrot The biggest change ahead is the separation of the syntax that gets parsed and compiled ("Perl 6") from the virtual machine that runs it ("Parrot"). Let's start with Parrot. What began as an April Fools joke a few years ago is now the name for the underlying virtual machine (VM). In this model, Perl is parsed down to an abstract syntax tree and compiled into the Parrot assembly language bytecode. Parrot then interprets the bytecode, optimizes the code and executes the program. While all of this infrastructure is intended to support Perl 6, the intent behind Parrot is to keep it agnostic about a high-level language's constructs. As a result, plans are in the works for Parrot to interpret and transform other bytecode formats, such as the .NET Common Language Runtime (CLR) and the Java virtual machines (JVMs). The big win with Parrot is that it was designed to support unicode and threading from its inception--not just as an awkward afterthought. Eventually, Perl, Python and other languages may all share the Parrot VM as a common runtime engine. Better, Faster, Stronger Another one of the major goals of the Perl 6 project is to enhance rapid development support. Towards that end, Perl 6 promises a number of improvements: All of these sound like very useful features, and some of the grammar changes are downright neat. For instance, declaring type constraints is cool, but declaring composite data structures in Perl 6 almost reads like a Celtic poem: my %hash is Hash of Array of Hash of Array of Int; OK, maybe I'm out on a limb there. Anyway, the variable type declaration features of Perl 6 should assist program debugging. By imposing data type constraints, programmers can (hopefully) identify errors at compile time that might have otherwise turned into runtime mystery bugs. Working With Weirdness That's enough of the good news. On the other hand, some of the changes to the Perl language lead to one conculsion: No matter how much Perl changes, the sum total of the language's complexity, nuance and weirdness stays constant. For instance, I was pleased to hear that Perl 6 will remove the built-in function format.. But when I read of a new built-in function (zip) for interleaving two arrays, my Bad Idea Alarm went off. In addition, silly things like negative condition operators will also continue to clutter the language unnecessarily.
On Mondays, Wednesdays and Fridays I love Perl 5. The sheer simplicity with which it expresses complexity is truly sublime. On Tuesdays and Thursdays, however, I hate Perl. The function bloat is silly and not only is there more than one way to do it, there might be more than a dozen syntax variations for each way. I suspect with Perl 6, I'll only hate it on Tuesdays; Thursdays will succumb to the love. Ian Kallen is an application and software systems architect, consultant, and author. He lives in the San Francisco Bay Area.
|
PERL RELATED RESOURCES Over the past three years, Larry Wall's Apocalypses have defined the technical foundations of Perl 6. At the same time, Damian Conway's Exegeses provide practical interpretations and explanations of Wall's "Apocalyptic" writings. Together, the two collections are essential reading for developers interested in a detailed look at howand whyPerl 6 is evolving. The Perl 6 RFC is the Perl community's "wish list" upon which Larry Wall based many of the new features in Perl 6. More Perl related links appear below the ad.
|
|||||||||||||||||||||||||||||||||||||||
DEVELOPER PIPELINE MARKETPLACE (sponsored links) |
|||
|
|
|
Copyright © 2006 CMP Media LLC. | DEVELOPER PIPELINE All rights reserved. Privacy Policy | Your California Privacy Rights | Terms of Service
|