Perl News

The Perl Journal January, 2005

By Shannon Cochran


Perl 6 Grammar Ready for Hacking

Luke Palmer and Patrick R. Michaud have unveiled their work on a formal grammar for Perl 6, and thrown the doors open to contributions from volunteers. "Perl 6 is a huge language, so the task seems better done incrementally by the community," Luke wrote on the Perl 6-compiler mailing list (http://www.mail-archive .com/perl6-compiler@perl.org/msg00135.html). "It's written in a top-down fashion so far (because that's how my brain works with grammars), but feel free to work on it bottom-up, left-right (though recall that we have to make an LL grammar :-), inside-out, whatever. Let's just get rules written. Also, document your work as much as possible. We won't be accepting new rules without explanation unless they are *really* trivial...Most of all, hack liberally! Don't be afraid to change stuff around. These patches are easy to write, and they can be as small or as large as you feel necessary. It's also helpful to make suggestions even if you don't have a patch."

"When there's a doubt about how to do something," Patrick added, "we'll follow whatever is written in the most recent Synopsis/Apocalypse/whatever, and if it's a major language design issue, we'll kick it back to perl6-language for discussion...We're still working out some of the details of parsing, including operator precedence. As a result some things may be handwavy at first—that's normal."

A subversion repository has been set up at https://svn.perl .org/perl6; the Perl 6 grammar is currently archived under grammar/trunk/Grammar.perl6, although Patrick notes that "this and the overall repository structure will certainly change over time." Patches to the grammar can be contributed to the perl6-compiler list.

Passage of the Pumpking

Hugo van der Sanden has stepped down as pumpking of perl-5.10; "As work continues to demand more of my time, it has become clear that I will not be able to devote the time required for the role for the foreseeable future. This also means that I do not expect to be able to undertake the major reworking of the regexp engine I had planned, though I still hope to find time to implement some smaller improvements," he announced on the perl5-porters mailing list (http://www.nntp.perl.org/group/perl.perl5.porters/97896). Rafael Garcia-Suarez has been crowned the new pumpking.

Adam Kennedy Awarded Perl Foundation Grant

The latest grant from the Perl Foundation goes to Adam Kennedy to complete his work on PPI, a round-trip document parser for Perl source code. "That is," Adam wrote in his grant application, "it parses a contiguous chunk of Perl source as a document and not as code, and is able to perfectly reassemble a parsed Perl document back into the original file (including whitespace and comments)."

Perl's dynamic grammar makes it very difficult—if not impossible—to truly parse. Characters with multiple uses such as "/", which can be either a divide operator or the beginning of a regular expression, along with the potential ambiguity of function signatures, give rise to the saying that "the only thing that can parse Perl is Perl." Or, as the PPI documentation (http://search .cpan.org/perldoc?PPI) puts it, "A true or 'real' parser needs information that cannot be found in the immediate vicinity. In fact, this information might not even be in the same file. It might also not be able to determine this without the prior execution of a BEGIN {} block. In other words, to parse Perl, you must also execute it, or if not it, everything that it depends on for its grammar."

PPI, therefore, no longer stands for Parse::Perl::Isolated: "In acknowledgment that someone may some day come up with a valid solution for the grammar problem, it was decided to leave the Parse::Perl namespace free. The purpose of this parser is not to parse Perl code, but to parse Perl documents. In most cases, a single file is valid as both. By treating the problem this way, we can parse a single file containing Perl source isolated from any other resources, such as the libraries upon which the code may depend, and without needing to run an instance of Perl alongside or inside the the parser (a possible solution for Parse::Perl that is investigated from time to time)."

Possible applications for PPI include automatically generating documentation; applying quality metrics or performing structural analysis; refactoring code; or changing the layout or presentation of code without changing its text. PPI is currently available in beta form from CPAN; The Perl Foundation's $3500 grant will support Adam for two months of work as he finishes the final version.

Calls for Proposals

The sixth International Free Software Forum, fisl6.0, is seeking speakers: "Submission of Perl-related proposals is much welcome," according to conference organizer Flavio Soibelmann Glock. Lectures will be 60 minutes long, including discussion time. The International Free Software Forum is scheduled for June 1-4 in Porto Alegre, Brazil; submissions are due by February 28. The call for papers is at https://fisl.softwarelivre.org/papers/index.en.html.

YAPC North America has also released a call for participation. Lightning talks, standard 20-minute talks, long and extra-long talks will be offered, along with half-day or full-day tutorials. "Submissions regarding all Perl topics are welcome," the organizers state, "but they must be technical topics aimed at the benefit of the attendees (not marketing talks aimed at the benefit of some product or service associated with the presenter)." YAPC::NA::2005 will be held in Toronto, Canada on June 27-29. The deadline for proposals is April 18. See http://yapc.org/America/cfp-2005.shtml for details.

YAPC::EU is gearing up as well; the theme this year is "Perl Everywhere," so talks about Perl on varied platforms are especially encouraged. The conference will take place in Braga, Portugal from August 31 to September 2. Proposals are due by May 15, and can be submitted through the wiki at http://braga.yapceurope.org/ index.cgi?TalkProposals.