I'm getting excited about Perl6 Grammars. We're going to be taking a big step up from normal regex's, a step that I think will make many things easier, and allow for cooler things to be possible. I've heard some grumblings from different places about how much regex's will be changing in Perl6, but as I read through Apocalypse 5, I kept thinking, "This is going to be cool." None of the Apocalypses thus far have impressed me more or had the coolness factor of the new grammar constructs. (Sorry for the overuse of 'cool.')

Full-fledged parsing will become much easier to do directly in Perl. I think this will simplify many many CPAN modules that are mostly based around parsing. Of course the other functionality provided by those modules won't go away, and in fact may be more easily enhanced by the use of grammars. I highly expect CPAN to begin offering not only modules but also standalone grammar definitions, ready to be downloaded and used directly if one of the parsing modules doesn't fit your exact needs. Perhaps the extension .pg will soon become as commonly recognized as .pm is now.

The nice part about the grammars is that if you don't need a full one, you can still write simple rules for quick and easy matching, like it's done now. But you'll still have the ability to take advantage of the flexibility, control, and power inherent in these grammars. Considering the ties to object orientation (grammars with inheritance, polymorphism, etc), this is going to be some great stuff.

Well this is the Discussion Meditation section, so what thoughts have you had regarding the new Perl6 grammars? What great ideas are forming in your minds? Do you think they're going to be juicy or junk?

kelan


Yak it up with Fullscreen ChatBox

Edited (by multiple janitors): ~Mon Sep 23 22:51:01 2002 (GMT): Moved from Perl Monks Discussion to Meditations, per Consideration.


In reply to Perl6 Grammars by kelan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.