Perl history and plans for the Parrot next-generation interpreter

Change can be scary, especially for those who have grown accustomed to the status quo over a period of several years. And in the programming world, sweeping change is brewing. Perl 6 is a fairly ambitious redesign of both the Perl language and the Perl interpreter, so Perl 5 developers may be a bit nervous about the prospect of drastic changes, which NewsFactor explored in Part 1 of this story. But Allison Randal, one of the Perl 6 design team members, told NewsFactor that programmers have little to worry about.

“There will be some learning involved, but it isn’t like learning an entirely new language,” she said. “It’s more like adding a few new words to your vocabulary.”

Damian Conway, another member of the design team, agreed. “The most important message is … that the ‘feel’ of the language won’t change at all,” he said.

Worry Not

Outside of the design team, Gurusamy Sarathy, a senior developer with ActiveState who was the release manager for Perl 5.6, said he is encouraged even though the language design is not yet complete. “I see a tremendous potential for the birth of a great new version of the language,” he told NewsFactor. “I’m also happy to see that there is a good deal of cross-pollination between the Perl 5 and Perl 6 teams. Various ideas from the Perl 6 design discussions have been implemented to work under Perl 5, and Perl 5 has been used to prototype subsets of the Perl 6 language.”

To be sure, Perl 6 scripts will look different than Perl 5 scripts. However, companies and organizations that depend on Perl 5 scripts will not be left out in the cold.

Conway told NewsFactor that “most scripts will need some updating, but the Perl 6 interpreter will have a ‘backwards compatibility’ mode.” For example, he said, “any file starting with the keyword ‘package’ will be treated as a Perl 5 file.” In addition, Conway said, the language designers will include a utility to help translate scripts from Perl 5 to Perl 6.

Parrot What?

The changes within the Perl language itself are the most visible ones, of course, but the Perl interpreter is undergoing an overhaul as well.

The next-generation interpreter is called Parrot. Astute observers may pick up on a Monty Python reference in the name, taken from the famous (or, perhaps, infamous) dead parrot sketch. Also, Parrot was the name given to an April Fool’s prank announcing the merger of Perl and Python. Those two languages did not, in fact, merge, but the name stuck when it came time to choose one for the new Perl interpreter, which is being written from scratch.

Parrot is no joke, though — and it is designed to support not only Perl, but also other compiled dynamic languages. According to Randal, “Cross-language cooperation is one of our primary goals.” She noted that other projects, such as Ruby (a programming language similar to Perl), already are starting to work with Parrot.

In some ways, in fact, the April Fool’s joke may have been prophetic. Although the Python and Perl languages will remain separate, Randal said Parrot may someday handle execution of Python scripts as well as Perl ones. “A number of other languages, including Python, also have plans to target Parrot. We also have a lot to offer embedded scripting languages, like those commonly used in gaming engines.”

What Parrot Can Do for Perl

Of course, Parrot has benefits for Perl as well. Perl 6 project manager Nat Torkington told NewsFactor that the new interpreter’s inner workings will make Perl a little speedier. “The bytecode for this virtual machine is emitted from a compiler and stored on disk,” he explained. “This will make Perl 6 programs execute faster — compile once, run repeatedly.”

Conway added that the interpreter already has made significant progress. “Parrot already provides alpha versions of compilers for nearly a dozen other languages, most significantly Basic, Forth and Scheme. And some of them run faster than the ‘native’ interpreters for these languages.”

Too Much, Too Fast?

Admittedly, the anticipated changes are radical. From an outsider’s perspective, it might seem as if the Perl 6 team is taking on too much, too fast. Is there any chance that the Perl community might be disappointed by the new version? According to Conway, that is not likely. “The community itself is driving most of the innovations we’re making,” he said.

“I’ve now given over two dozen presentations on Perl 6 all around the world,” Conway added. “Every time I do, the response is overwhelmingly one of excitement and anticipation. In fact, the thing about Perl 6 that most annoys my audiences is simply that it’s not yet available.”

Torkington added that he thinks the Perl community will see the advantages of Perl 6 once it is released. “Larry Wall created Perl, shepherded it through five major versions, and has generally proved a highly reliable guide through the language wilderness,” he noted. “When the complete implementation is available, I think people will realize the attraction of having all the language features interacting in predictable and logical ways.”

Support Your Local Perl Developer

Unfortunately, Perl 6 development has been slowed somewhat by a lack of money. Although Perl is an open source project, the key people involved in the project have been making a living by working on it — but that era may be ending.

“So far, it’s taken the core design team about two years to design maybe 40 percent of the new language,” Conway said. “But during that time, Larry Wall, Dan Sugalski and myself were all being financially supported by the Perl Foundation, from donations contributed by the incredibly generous members of the worldwide Perl community. That support, which had enabled us to work on the design full-time, finished last year.”

Randal agreed that the employment situation may be the biggest problem for Perl 6. “One of the biggest potential slowdowns we’re facing in the next couple of years is making sure we keep the major players in Perl 6 development employed in such a way that they have time to work on Perl 6.”

In fact, Conway said, lack of funds already is taking its toll. “Like so many others in the IT industry, all three of us [Conway, Sugalski and Wall] have been looking for work,” he noted. “Though we’re still devoting as much time as we can spare to the project, the pace of design has inevitably slowed. My best guess would be that we’ll have the [language] design stabilized in about two to three years.”

Fast Release After Design

Conway said developers will not have to wait much longer once the design is finalized. “Fortunately, the implementation team has a large number of exceptionally talented and dedicated developers, so the interpreter is moving ahead as quickly as the design process will allow,” he said. “Once we finally get the syntax and semantics mapped out, I’d expect to see a usable implementation within six months, maybe even sooner.”

Indeed, it has taken 16 years for Perl to get this far. In the overall scope of that time frame, a few more seem a fairly small price to pay for a redesign that could revolutionize the language. And until then, there is always Perl 5.

(Originally written for and published on NewsFactor.com, which is now defunct, under the headline “Perl Features of the Future – Part 2.” Rescued via the Wayback Machine. Decided to put this back up since it’s an interesting look at a point in time for the Perl community.)

Editor, writer, communications expert, former community manager, open source enthusiast, music nut, and cat guy. Not necessarily in that order.

Leave a Reply