Creator Promises Perl 6 Will Be First Truly Extensible Programming Language
- By Joab Jackson
Perl creator Larry Wall promised version 6 of Perl will be the first truly extensible programming language during his annual "State of the Onion" speech at the O'Reilly Open Source Conference (OSCON), being held this week in Portland, Ore.
Other languages have claimed to be extensible, though they have all fallen short in one way or the other, Wall asserted.
"No computer language has ever taken extensibility seriously. All languages fall into the one true syntax syndrome, and we want to escape that," he said.
For power-users of this open source language, such extensibility could mean that they will be able to augment the language with instructions, syntax, expressions, operators and other features to meet their own needs. An office of the National Cancer Institute, for instance, could extend Perl to include features that could aid in medical research.
Initiated in 2000, version 6 of Perl will be a total rewrite of this widely-used programming language, one that has been called the duct tape of the Internet.
Judging from the Wall's presentation, Perl 6 could turn out to be one of the most permuable programming languages ever devised. Nothing in Perl 6 will be immutable. "Perl 6 has no core, no keywords, no built in operators. Everything that looks like an operator is actually defined by some grammatical rule or by a macro or by something that is added in," Wall said.
The developers' hope is that individuals will use this extensibility and redesign Perl in new ways. "We do not know what language we want in 20 years, but we want it to be Perl," he said.
It should be noted that this ability customize will largely be hidden from those using the language for basic needs. "We're trying to keep Perl 6 so that you don't need to understand what the fancy things are doing until you need them," Wall said.
For those perhaps less than willing to alter the language itself, the standard edition of Perl 6 will also offer more traditional improvements to ease programming.
In a session held earlier in the week, Perl developer Damian Conway, along with Wall, offered a few late additions to the Perl 6 feature set, including some exciting developments in module management, and streamlining of regular expressions.
For instance, the naming scheme of new modules will include a placeholder to specify the version number of the module. This approach will allow multiple versions of a module to run simultaneously, Conway said. Also, from your program, you can designate which specific version of a module it should use.
Another new feature: Future versions of Perl 6 will be backward compatible, at least back to version 6. A user can specify which version of Perl can run a particular Perl script. If the version of Perl being specified is older than the one being run, then the newer version will emulate the older version of Perl.
One of Perl's biggest strengths has always been its ability to work with regular expressions, the syntax used to match patterns of text. Some additional shortcuts have been added to simplify the creation of regex statements.
For instance, if you are looking for a long string of identical letters, you can just indicate the number of letters in the string, instead typing out each letter. In other words, with the current version of Perl, you'd type "aaaaa" to indicate you are looking for 5 a's. In Perl 6, you need type only "a**5." There, the 5 indicates the number of letter a's you seek.
You can also specify ranges with this technique, I.e. "y ** 3..5" means you are looking for a string of y's from 3 to 5 characters long. You can also ask Perl to do some on-the-fly calculation, I.e. the expression "z ** [get .max.rep()]" will find the maximum number of serial z's, and then find such strings.
Another feature is the ability to find all the unique abbreviations o a certain expression. Conway explained that some operating environments will allow you to abbreviate the names of programs or files, i.e. the name "executable," could be abbreviated as "exec," "execu," "execut," "executa," "executab," and "executabl."
Finding all the abbreviations for one word could be done in Perl 5, but "this is something that you can't easily do," Conway said. With Perl 6, a query like this "/exec<*utables /" would find all the variants of the word.
Other new features touted included a much more friendly set of error messages, as well a way to split up work into parallel so they may be executed simultaneously by multicore processors.
The developers, however, were less forthcoming with a final release date for the programming language. Wall gave no indication of when Perl 6 would finally be released, noting that the language's volunteer designers do not make promises about the release date. He did say the project is making "steady progress."
In his presentation, Conway, noted that the vast majority of the changes now being committed are now either for documentation or to fix simple typos. One developer we spoke with proffered that this must surely mean that the official release of this volunteer-led effort is close at hand.
Wall relayed the now-familiar joke that Perl 6 would be out by Christmas. He just won't say which Christmas.