develooper Front page | perl.perl6.internals | Postings from June 2002

Re: Perl6 grammar

Thread Previous | Thread Next
Melvin Smith
June 17, 2002 14:03
Re: Perl6 grammar
Message ID:
At 02:30 PM 6/17/2002 -0600, Luke Palmer wrote:
>On Mon, 17 Jun 2002, Melvin Smith wrote:
> > 1) I hear some people throwing around recursive descent:
> > Ok, when you talk rec-descent it is useful to define how much
> > lookahead you need. There are tools available that accelerate
> > LL(k) parser development, (pccts, antlr). I had a strange dream
> > that pccts even generates Perl but I've not looked at it in a while
> > to confirm it.
>I think they were talking about Damian's Parse::RecDescent, just because
>it's very versatile and a lot easier to work with than yacc.  I think this
>is a good idea, as it integrates the parser and the lexer like Larry said
>would happen.  Plus, if we're first-cutting in perl, this is definitely
>our best bet. If not, well, out of the question.

I agree, recursive descent is always easier to work with to a certain
point. It is when top-down methods become unusable for parsing
that it no longer is easy to work it. LR/LALR is harder to work
with but is more capable in general (except error reporting).

> > 3) Using the tools from (2) rewrite the bootstrap in Perl6.
> > (Repeat, please don't write it by hand)
>What about Parrot?  Will it be sufficiently full-featured (regexes and
>such) by that time to pull it off?

In the time it will take to implement a bootstrap compiler in Perl5, I expect
Parrot will have doubled in capability. However, Parrot provides enough
instructions now to do any type of regex algorithm you could throw at it, it
would just be either ugly, slow or both.

> > Notice I made no mention of the lexer. From what I gather, Larry wished
> > there to be less ambiguities in Perl6 as to shrink the workload of the 
> lexer.
> > I've yet to really study Perl6 enough to know this is true, but I trust
> > Larry. :)
>I got the opposite impression.  He's said things like the parser and lexer
>will no longer be considered seperate entities.  And his quote in response
>to my first post to perl6-language:
>"If strain on the lexer were a design criterion, I blew it long ago."

I'm not sure what this tells me, except that the Perl5 lexer is complex,
which we all agree on. :)

The hole I see is not having a Perl6 grammar to toss about.
You must sift through the apoc/exe pile to formulate it. Regardless of
which approach is taken, I'd like to see a BNF style grammar floating around
before we talk tools.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About