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

Perl6 grammar

Thread Next
From:
Melvin Smith
Date:
June 17, 2002 12:48
Subject:
Perl6 grammar
Message ID:
5.1.0.14.2.20020617150259.03e27548@pop.mindspring.com
I moved this to perl6-internals since that seems to include
most of the people actually interested in implementation.
(given 0 responses to Dan's p6-lang post)

Dan writes to perl6-language:

# We're looking for folks to work on the first cut perl 6 parser over
# on perl6-internals. All you need is a good knowledge of perl 5 (which
# is our first cut implementation language) and a willingness to dig
# through the Apocalypses and Exegeses. (Well, that and not minding the
# first version likely getting tossed out when we do the final
# implementation... :)

Ok, then we should start some nitty-gritty talk. I'm familiar with
implementing parsers for LR(1) grammars. I hope Larry, and other
people that have been digesting the Apocalypses (I can't say I have)
can fill us in about the characteristics of Perl6's grammar.

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.

2) Brent mentions Parse::Yapp:
Again, the same question, how much lookahead does Perl6 require.
I'd like to see a work start on a formal grammar before anyone
takes off on writing a parser. Does Larry have even an informal grammar
lying around that we could bat around?

Concerning implementation:

Why not do what other self-hosting languages do:

1) Implement a bootstrap compiler using a conventional parser generator,
whichever that is. (Please don't write it by hand)

2) When an adequate amount of Perl6 can be compiled with the bootstrap,
implement a parser generator for Perl6 itself, even if the parser generator
is written in Perl5.

3) Using the tools from (2) rewrite the bootstrap in Perl6.
(Repeat, please don't write it by hand)

4) When the subset of Perl6 can compile itself, incrementally improve
both Perl6 and the capabilities of the parser generator.

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. :)

-Melvin


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About