just a few musings on bootstrapping the grammar. someone mentioned the
idea of using Perl6::Rules to help with this and i think that could be a
great way to go for several reasons. it will take a fair amount of time
to get a new p6 rules engine (fearless leader said 1 month but i think
that is aggressive). also writing up and testing parts of the grammar
will take time too. we could split off parts of the compiler to be done
in parallel with p6:r.

first off, i propose we design the grammar for parsing perl6 to use a
subset of the full rules chosen to match the features of p6:r. then we
can start with defining grammar rules for p6 and doing tests for them
(table driven of course). these will be run under p6:r but will be
converted to test the new p6 rules engine as well (with hopefully little
modification needed). working rules can be put together into grammars
which can be used to generate prototype AST stuff. we can even bootstrap
the code generation phase by using this AST and writing p5 (or PIR!)
code to generate PIR. this could be done as a separate process/pass so
the process can be done in p5 or PIR.

the main reasons for these ideas is to allow more people to attack the
project at the same time and as early as possible. i smell^Wsense a
large groundswell of pent up energy for the p6 compiler so this could be
a way to utilize all of it. that newbie volunteer could work on a rule
test scaffold and with others start adding needed p6 grammar parts to it
for testing. others can use that work and generate AST and/or PIR.

this is how we ported a PL/I compiler from a prime (via 9 track tapes
and a vax intermediary) to a power6 (not the current ibm chips :) over
20 years ago. we worked on cross compilation first (same as using p5 to
code generate PIR) and the compiler code itself (the grammar in p6) used
many fewer ops than the language supported and it skipped normal i/o and
used a custom simple i/o lib. we do the same by not using all possible
grammar features in the p6 grammar (we can change/optimize that once we
are bootstrapped) and by using p5 and p6:r as crosscompilation tools.

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to