Robin Berjon wrote:
> I just have yet to see someone point at one place 
> where Perl 5 hinders XML processing in such a way that Perl 6 could help. 

If my understanding of the design of Perl 6 is correct, the lexer, parser
and any other related components will be highly configurable and/or 
replaceable.  The goal is to provide support for "little languages" by
separating Perl the language from perl the interpreter.  It will be 
possible to modify or replace Perl the grammar so that perl the program
can parse other languages, including Python, Ruby and presumably, XML.

So instead of writing Perl programs to parse and manipulate XML, it 
should be possible to modify Perl itself so that it parses the XML directly
into some internal form suitable for programmatical manipulation.

I presume that it should also be possible to extend the rules of a default
non-validating XML parser grammar with additional rules to encode an XML
schema.  On top of that it should be possible to define further production
rules that are invoked as the source document is parsed, i.e an XML schedule
(schema/schedule ~= pattern/action).  

How exactly this will manifest itself, I cannot tell.  Nor can I say if this
is actually a sensible thing to do or not.  But unless my understanding is
warped, support for parsing XML and other markup languages could be moved
down into the core of the parser internals for Perl 6.

For example, it might be possible to do something like this:

  use Perl6::XML; 

    <thingy>
        <blah>blah blah</blah>
    </thingy>

  use Perl6;

    print $thingy.blah;

This is all speculation and hand-waving, of course.  But the point is that
Perl 6's extending parsing capabilities could well provide a much greater
level of integration between Perl, XML and various other programming and
markup languages.

My rant against the XML machine was really an aside.  Take everything I say
with a pinch of salt.  :-) 

A

Reply via email to