Thursday, April 27, 2006

April 27th, 2006 -- The Plan

I tried to feed the yadaLiteral rule describe yesterday (this morning) to Pugs::Compiler::Rule and found it failed to parse. The problem is that there is a $<sym> ~ ' - not yet implemented' in it but it's not valid perl 5 nor does the ad-hoc translator changed it correctly. But why is the production rule executed (eval-ed) before the rule is used to parse anything? Since the constructor did that.

I quickly wrote it down and planned to ask fglock, the main author of P::C::Rule, after dinner if s/he's online again. But when I attached the screen, the window eleven of the irssi is marked red and I found that audrey found this blog :) Welcome Audrey.

I had some thing to ask her, too. It's about the (just mentioned) perl 6 to perl 5 translator. After the conversation, the bootstrap plan forms (full text is here):


  1. This module, Pugs::Grammar::MiniPerl6, uses Pugs::Compiler::Rule to read a special *mixed* perl 6 rule whose production rules are written in perl 5 (the current requirement of P::C::Rule).

    The rule is used to translate a subset of perl 6, MiniPerl6,
    to Haskell.


  2. Then, Pugs::Compiler::Emit::Parsec lands and uses this module to translate the full perl 6 grammar into a parser. The full grammar can now write production rules in MiniPerl6 since P::C::E::Parsec can use this module to translate such production rules to Haskell and makes the final output be pure Haskell.


  3. When compiling Pugs, the .hs preprocessor will use
    Pugs::Compiler::Emit::Parsec to accept the full perl 6 grammar
    generating Parser.hs. Then GHC will compile it to executable.


  4. The executable can now read the full perl 6 grammar again generating compiler in PIL. Then self hosting is done.



That's all about today. There's a deadline this weekend so that there may not be any progress before Monday, sorry :(

2 Comments:

Anonymous Anonymous said...

May 27 / Apr 27 ????

4/28/2006 1:25 PM  
Blogger Shu-Chun Weng said...

Thank you. I still make mistakes on names of month in English :(

4/28/2006 2:11 PM  

Post a Comment

<< Home