Adam Kennedy wrote:

What I'm after are 3 critical features.

1. You always get back out what you put in.
$source eq serialize(parse($source)).

As Larry pointed out, this will depend on how much metadata your parser augments your parse-tree with. I think it will be doable (probably by subclassing the standard Perl parsing grammar).



2. No side effects. Autrijus Tang suggests this may be workable

No side effects of what? Of parsing? I don't think that's possible. Perl is defined such that compile-time "side-effects" can alter the syntax (and hence the parsing) of a program.



3. You can parse a document with broken dependencies.

This is clearly not possible in Perl (5 or 6) in the general case. Perl isn't that kind of language.



PPI can do all of these 3 things. Not 100% reliably, but for "normal" code (where "normal" is actually defined fairly broadly).

And Perl 6's C<grammar Perl> will be able to give you the same.


In any case, I would like to suspend this debate for a week, as I'll be talking with Damian (hopefully) at YAPC.AU. I'll report back afterwards, having hopefully imparted the full extent of my problem.

I believe I understand your problem pretty well already. But I'll be more than happy to discuss this whole issue with you.


Perl 6 rules or some variation therein may indeed be what I'm after, although I need to find out more about the internals.

So do we. That's why we're building it at the moment. ;-) See the mailto:[EMAIL PROTECTED] mailing list.


Do we have a working version yet I can create some demonstrations with?

No. We're working on that. There's a partial prototype that runs under 5.8.3 (but is broken under earlier and later releases) on CPAN as Perl6::Rules.
You should also (re)read Apocalypse 6 and especially Synopsis 6 on http://dev.perl.org


Damian

Reply via email to