⊙ AntiQuark

Truth, Beauty, Charm, Strange

2004/11/26

Is perl6 Parsable?

I'm not sure if this post to perl.perl6.language is meant to be a joke, if it's serious, or somewhere in between.

Adam Kennedy, the author of the perl5 parser module Parse::Perl::Isolated seems to think that perl6 will be unparsable (at least of the technical sense of parsing, such as with YACC).

Here's the original post:
Will _anything_ be able to truly parse and understand perl?

The discussion continues here:
Lexing requires execution

I've been following perl6 development since 2000, and it's really evolving into a massive clusterhack. You have only to look at the Periodic Table of Perl Operators to get a feeling of how hypercomplicated the language is becoming. I think one of the underlying themes of perl6 is to provide a platform without limits, where any conceivable syntactic scheme can be implemented in the language. For example, perl6 will let you create operators of any unicode character and with any precedence. Things like that might be great for the writer of the code, but man, think about the poor sod who has to read and debug it later on!


4 Comments:

  • At 9:26 PM, Michael G Schwern said…

    Folks complain about the complexity of Perl 6 all the time, and use things like the Periodic Table of Operators as an example. Why does Perl 6 look so complicated? Because for the first time we can, and are, specifying the whole Perl language. There is no Perl 5 specification. We "discover" features and behaviors all the time. The fact is Perl 6 is much simpler than Perl 5. You're just in shock for seeing all that is Perl layed out before you for the first time.

    We know Perl 5 is unparsable by anything but perl. PPI just handles most of the common code out there, but in the end it is not parsing Perl 5. The Periodic table shows 18 levels of precidence in Perl 6, Perl 5 documents 24 and there's probably more undocumented ones. The incomplete list of operators at the beginning of perlop lists over 50, and I'd suspect there's really over 70.

    It would be a fun exercise for someone to lay out a Periodic Table of Perl 5 Operators just to compare.

     
  • At 6:58 AM, DJB said…

    Perl 6 is much simpler than Perl 5? I think not. From Exegesis 6:

    sub part (Selector $is_sheep,
    Str +@labels is dim(2) = <<sheep goats>>,
    *@data
    ) returns List of Pair
    {
    my ($sheep, $goats) is constant = @labels;
    my %herd = ($sheep=>[], $goats=>[]);
    for @data {
    when $is_sheep { push %herd{$sheep}, $_ }
    default { push %herd{$goats}, $_ }
    }
    return *%herd;
    }

    A truly grotesque combination of sigils, perlisms and optional typing. When your code is uglier and harder to read than C++, you know your language has a problem.

    Please, just use Ruby.

     
  • At 7:10 AM, Bob said…

    I am pretty sure they are talking about PARSING and not WRITING.

     
  • At 10:06 AM, Derek said…

    Hello all,
    Here's a recent discussion on the plethora of operators in perl6:
    link

    Someone asks:
    I just started following the list again after a few months (though I
    have been skimming the bi-weekly summaries) and I'm a little alarmed
    at what seems to be a trend towards operaterizing everything in sight
    and putting those operators in the core.


    Larry Wall himself actually answers the question by pointing out how obvious the following code is:
    $x = [»+^=«] @foo;

    (That's one thing I like about the perl6 groups. You get to read lots of postings by Wall, and see how his mind works.)

     

Post a Comment

<< Home