<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-27075926</id><updated>2009-02-21T14:29:06.296+08:00</updated><title type='text'>Yet Another Pugs Hacker's Blog</title><subtitle type='html'>I'm one of the committer of Pugs, Perl User's Golfing System.  After one year of stopping hacking, I restarted again.  This is the blog recording my works.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-27075926.post-115562254572185733</id><published>2006-08-15T13:52:00.000+08:00</published><updated>2006-08-15T14:15:45.736+08:00</updated><title type='text'>August 15th, 2006 -- Last Day of SoC</title><content type='html'>In fact, this is a post for 8/14.  I worked until three o'clock this morning.&lt;br /&gt;&lt;br /&gt;Since fglock++ worked a lot on changing Pugs::Rule::Compiler to make module v6 better, I also made some changes to make my existing code work after the merge from pX/ to perl5/.  After that, since most parts of Literal.hs are in the test file of the Parsec emitting module, I began writing the translation tool.&lt;br /&gt;&lt;br /&gt;It is now &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/scw/rule2parsec.pl"&gt;here&lt;/a&gt;, with the &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/scw/Literral.grammar"&gt;Literal.grammar&lt;/a&gt; added.  Since parameter of rules is not supported, three of them are still written in Haskell after the "use Haskell" statement. Beside that, a &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/scw/Literal.patch"&gt;patch file&lt;/a&gt; is included which make the generated file really work.&lt;br /&gt;&lt;br /&gt;The reasons of needing a patch file are: non-LL grammar which need backtrack and a weird error message without type annotation.  There are three places where "try" is added in the generated source to allow backtrack, they can be avoid by rewriting the grammar.&lt;br /&gt;&lt;br /&gt;But the need of annotation is not clear to me.  The original parser is like this:&lt;br /&gt;&lt;blockquote&gt;ruleTwigil :: RuleParser String&lt;br /&gt;ruleTwigil = option "" . choice . map string $ words " ^ * ? . ! + ; "&lt;/blockquote&gt;And the generated version is (ugly and obviously not hand-written)&lt;blockquote&gt;ruleTwigil = option "" $ do&lt;br /&gt;  string "^"&lt;br /&gt;  &lt;|&gt;&lt;br /&gt;  string "*"&lt;br /&gt;  &lt;|&gt;&lt;br /&gt;  string "?"&lt;br /&gt;  &lt;|&gt;&lt;br /&gt;  string "."&lt;br /&gt;  &lt;|&gt;&lt;br /&gt;  string "!"&lt;br /&gt;  &lt;|&gt;&lt;br /&gt;  string "+"&lt;br /&gt;  &lt;|&gt;&lt;br /&gt;  string ";"&lt;/blockquote&gt;Without type annotanion, both version of code cause the error&lt;blockquote&gt;No instance for (MonadState RuleState (GenParser Char st))&lt;/blockquote&gt;Any comment?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-115562254572185733?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/115562254572185733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=115562254572185733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/115562254572185733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/115562254572185733'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/08/august-15th-2006-last-day-of-soc.html' title='August 15th, 2006 -- Last Day of SoC'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-115428034626112097</id><published>2006-07-31T00:44:00.000+08:00</published><updated>2006-07-31T01:25:46.273+08:00</updated><title type='text'>July 31st, 2006 -- Parsec emitter and underlay problems</title><content type='html'>Main goal of this week was to complete the Parsec emitter.  However, due to some natural limitation, it's not possible to really "complete" it, I just try my best to complete as many components as I can and hope those be enough for writing complete Perl 6 grammar.  The accepting grammar constructions implemented from last post are:&lt;ul&gt;&lt;li&gt;:sigspace option&lt;/li&gt;&lt;li&gt;complete \X syntax (but not \Xxxx)&lt;/li&gt;&lt;li&gt;numbered captures&lt;/li&gt;&lt;li&gt;subrule with parameters&lt;/li&gt;&lt;li&gt;non-capture group&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;And I mailed pmichaud++ about the different semantics of "non-backtrack" in Perl 6 rules and Parsec parsing strategy.  The :ratchet option, which is turned on by rule and token, is to make backtrack over atom fail.  But different branches are still tried even if first several atoms in one branch are matched.  In Parsec, the whole parsing fails if it goes into some branch, consumes some tokens and is unable to go on further.  However, this can be changed by wrapping the branch with "try," which, as the name tells, tries to match the branch but will try other ones if failed.  Such action is like adding a "::" after each atom instead of adding ":", which is done by rule and token in Perl 6 grammar.&lt;br /&gt;&lt;br /&gt;One way to solve it is to add "try" everywhere.  But that means giving up the high-efficiency parsing provided by Parsec.  When the grammar is not LL, it's unavoidable.  Parsec performs best on LL grammar (from &lt;a href="http://www.cs.uu.nl/~daan/download/parsec/parsec.html"&gt;official page&lt;/a&gt;), so in this stage, I'll feed only LL grammar to it and no additional "try" is added.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-115428034626112097?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/115428034626112097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=115428034626112097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/115428034626112097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/115428034626112097'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/07/july-31st-2006-parsec-emitter-and.html' title='July 31st, 2006 -- Parsec emitter and underlay problems'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-115366736051992760</id><published>2006-07-23T23:58:00.000+08:00</published><updated>2006-07-24T00:09:43.776+08:00</updated><title type='text'>July 23rd, 2006 -- Pugs::Emitter::Rule::Parsec</title><content type='html'>I finally escaped from the final exams and projects, and the unexpected busy early July.  The first checkin of the &lt;a href="http://svn.openfoundry.org/pugs/perl5/Pugs-Compiler-Rule/lib/Pugs/Emitter/Rule/Parsec.pm"&gt;Pugs::Emitter::Rule::Parsec module&lt;/a&gt; is on July 20th.  It accepted and emitted correct Haskell code on the yada example given in the &lt;a href="http://svn.openfoundry.org/pugs/perl5/Pugs-Grammar-MiniPerl6/README"&gt;README&lt;/a&gt; of MiniPerl6 module.  (By the way, the Pugs::Grammar::MiniPerl6 and Pugs::Compiler::Rule modules have been moved from pX/ to &lt;a href="http://svn.openfoundry.org/pugs/perl5/"&gt;perl5/&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;After three days' hacking, it now accepts a lot of rule constructions. Also, a &lt;a href="http://svn.openfoundry.org/pugs/perl5/Pugs-Compiler-Rule/t/11-parsec.t"&gt;test file&lt;/a&gt; was added. In &lt;a href="http://svn.openfoundry.org/pugs/src/Pugs/Parser/Literal.hs"&gt;Parser.Literal&lt;/a&gt; there are 10 parser routines, two of them take arguments (namedLiteral and possiblyTypeLiteral) which I currently don't know how to present in Perl 6 rule, one uses previous parsing state to decide next action (ruleWordboundary), two use negative look-ahead (ruleDot and ruleLongDot) but &lt;code&gt;&amp;lt;!before pattern&amp;gt;&lt;/code&gt; is not ready yet, all other five can be easily generated.  In fact, all five of them are already in the test file, the result is tested by replacing existing code by the generated one proven that it gears Pugs' parser, too.&lt;br /&gt;&lt;br /&gt;UPDATE: &lt;code&gt;&amp;lt;!before pattern&amp;gt;&lt;/code&gt; support is added to both Pugs::Compiler::Rule and Parsec emitter.  However, since the existing parser is not LL, I have to put an additional "try" in the generated code by hand to make it work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-115366736051992760?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/115366736051992760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=115366736051992760' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/115366736051992760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/115366736051992760'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/07/july-23rd-2006-pugsemitterruleparsec.html' title='July 23rd, 2006 -- Pugs::Emitter::Rule::Parsec'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114951902943213807</id><published>2006-06-05T22:31:00.000+08:00</published><updated>2006-06-05T22:50:29.443+08:00</updated><title type='text'>June 5th, 2006 -- Named Captures</title><content type='html'>Someone in another open source project I joined made some mistake and since the system is online, it corrupted many users config files which took me a lot of time help fixing it.  (The error report is still growing..)&lt;br /&gt;&lt;br /&gt;I added a rule to Pugs::Grammar::Rule so that it accepts more named capture syntax.  It accepted only $&amp;lt;var&amp;gt; := (pattern).  The parentheses was necessary.  Now more general $&amp;lt;var&amp;gt; := [pattern] and $&amp;lt;var&amp;gt; := &amp;lt;subrule&amp;gt; are also valid. &lt;br /&gt;Since when dealing with Perl 5 ratchet emitter, I've hacked the named capture emitting routine and made sure that it still work with the extended syntax.  What made me surprised is, even the non-ratchet emitter works fine with the newly acceptable syntax.  However, I'm still suspecting that the positional capture is not correctly generated.  When $&amp;lt;var&amp;gt; := (pattern) is used, the (pattern) should NOT be listed in the positional captures.&lt;br /&gt;&lt;br /&gt;Any way, the tests in ratchet shows that Pugs::Emitter::Rule::Perl5::Ratchet works correctly.  And I'll add tests for the non-ratchet one if possible.&lt;br /&gt;&lt;br /&gt;On the other hand, the Pugs::Emitter::Rule::Parsec plan has been in my brain for a while and there IS a Perl module for it now -- in my working copy and has a lot of functions with empty body.  As soon as it has some basic construction, I will check it in and begin our Parser/*.hs replacement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114951902943213807?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114951902943213807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114951902943213807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114951902943213807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114951902943213807'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/06/june-5th-2006-named-captures.html' title='June 5th, 2006 -- Named Captures'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114933775895253306</id><published>2006-06-03T22:41:00.000+08:00</published><updated>2006-06-05T22:50:47.290+08:00</updated><title type='text'>June 3rd, 2006 -- Well formatted grammar</title><content type='html'>Still not begin writing Pugs::Emitter::Rule::Parsec.  Still dealing with MiniPerl6.  Aufrank++ and spinclad++ gave some great comments about my variable matching rule.  And the post I sent to perl.perl6.language, which was NOT sent to the list since I posted it dirctly by group.google, was replied by pmichaud++, my mentor :)&lt;br /&gt;&lt;br /&gt;The thread is &lt;a href="http://groups.google.com/group/perl.perl6.language/browse_thread/thread/8f908baeb598395d/3197361b55f562a8#3197361b55f562a8"&gt; here&lt;/a&gt; (&lt;a href="http://0rz.net/7b1pZ"&gt;http://0rz.net/7b1pZ&lt;/a&gt;).  Following his comments, I changed the matching rule of &amp;lt;ws&amp;gt; and changed some rules into tokens.  The grammar file is not so hateful now.&lt;br /&gt;&lt;br /&gt;Update: Audrey++ confirmed that the PGE-way of &amp;lt;ws&amp;gt; is correct and has updated S05.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114933775895253306?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114933775895253306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114933775895253306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114933775895253306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114933775895253306'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/06/june-3rd-2006-well-formatted-grammar.html' title='June 3rd, 2006 -- Well formatted grammar'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114915443784392779</id><published>2006-06-01T17:02:00.000+08:00</published><updated>2006-06-01T17:33:57.856+08:00</updated><title type='text'>June 1st, 2006 -- A new month, a new stage</title><content type='html'>Since the MiniPerl6 is finished, and it seems that there will not be big changes, I am planning moving on next stage, Pugs::Emitter::Rule::Parsec.  There is no progress yet but I spent some time exploring papers on monads (most of them are published 10+ years ago) mostly for my current researching topic but also that Parsec is a monadic parser and I haven't totally understood monad.&lt;br /&gt;&lt;br /&gt;On the other hand, I don't really like (pronounce "hate") the current &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/lib/Pugs/Grammar/MiniPerl6.grammar"&gt;MiniPerl6.grammar&lt;/a&gt;.  It was well-formatted before :sigspace was implemented in Pugs::Compiler::Rule.  But after the default-on option was implemented, I could not put extra spaces to format it well anymore.  I concluded two reasons why it happened and posted a &lt;a href="http://groups.google.com/group/perl.perl6.language/browse_thread/thread/8f908baeb598395d"&gt;suggestion&lt;/a&gt; on perl.perl6.language but no one replied yet.&lt;br /&gt;&lt;br /&gt;The two reasons (or, suggestion of changes) are:&lt;ol&gt;&lt;li&gt;Spaces at beginning and end of rule blocks should be ignored since space before and after current rule are most likely be defined in rules using current one.  (The spaces around the rule-level alternative could also be ignored).&lt;/li&gt;&lt;li&gt;I am not sure the default rule of &lt;ws&gt;, I couldn't found it in S05.  Currently the engine use :P5/\s+/ but I would like it to be :P5/\s*/ when it's before or after non-words and remains the same (\s+) otherwise.&lt;/li&gt;&lt;/ol&gt;I think these will help me formatting the grammar file better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114915443784392779?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114915443784392779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114915443784392779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114915443784392779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114915443784392779'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/06/june-1st-2006-new-month-new-stage.html' title='June 1st, 2006 -- A new month, a new stage'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114881869382517722</id><published>2006-05-28T20:07:00.000+08:00</published><updated>2006-05-28T20:18:13.836+08:00</updated><title type='text'>May 28th, 2006 -- MiniPerl6 Finished Again</title><content type='html'>Continue on yesterday's work, I finished converting MiniPerl6 module so that it now work happily with ratchet.&lt;br /&gt;&lt;br /&gt;The problem is that I used \w+ to match variable names but I should use [&amp;lt;alpha&amp;gt;|_]\w* instead (since the variables named with numbers are numbered captures, a special category).  Another problem was hidden, or bypassed, by changing the order of alternations after I fixed the rule-using problem.  It happened to be that the named capture parsing code in Pugs::Emitter::Rule::Perl5::Ratchet used a reference of boolean value in an "if" statement.  I have to add another pair of ${} around it, at least before switching to Perl 6.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114881869382517722?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114881869382517722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114881869382517722' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114881869382517722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114881869382517722'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-28th-2006-miniperl6-finished-again.html' title='May 28th, 2006 -- MiniPerl6 Finished Again'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114874121506935913</id><published>2006-05-27T21:39:00.000+08:00</published><updated>2006-05-27T22:46:56.380+08:00</updated><title type='text'>May 27th, 2006 -- Ratchet MiniPerl6</title><content type='html'>The Pugs::Grammar::MiniPerl6 module was broken since the default setting of parsing option of Pugs::Compiler::Rule several days ago so that the ratchet option was turned off in it.    Currently compile_p6grammar.pl generates a module used no ratchet feature which is identical to that it used to do.  So that I focused on it these days.&lt;br /&gt;&lt;br /&gt;I fixed the ratchet Perl 5 emitter on backslashes and named capture yesterday.  And, I've almost finished fixing the MiniPerl6 module itself.&lt;br /&gt;&lt;br /&gt;The main parts are to revise the grammar and update the translator compile_p6grammar.pl.  The former one including changing some rules into "token" and rewrite the others to fit the :sigspace.  And the later part is to make it accept "token" and "regex" as well as "rule."&lt;br /&gt;&lt;br /&gt;Another big change is a modifier ":p" on rule ProductionRule.  Since ProductionRule is the top rule in the grammar, the match of it should start from the very begin of input string.  Correspondingly, compile_p6grammar.pl also translate it correctly.&lt;br /&gt;&lt;br /&gt;I said that I "almost" finished fixing it.  That means some of them are still broken and if you tried "make test" you will find the last test failed.  I'll fix the temporary variable declaration as soon as possible.  Stay tuned!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114874121506935913?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114874121506935913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114874121506935913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114874121506935913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114874121506935913'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-27th-2006-ratchet-miniperl6.html' title='May 27th, 2006 -- Ratchet MiniPerl6'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114874369436921600</id><published>2006-05-24T23:14:00.000+08:00</published><updated>2006-05-28T01:31:28.053+08:00</updated><title type='text'>May 24th, 2006 -- Google Summer of Code!</title><content type='html'>My proposal of "Pugs Self-hosting Bootstrap From Perl 5 and Rules" was accepted by google summer of code.  There are &lt;a href="http://code.google.com/soc/tpf/about.html"&gt;five projects&lt;/a&gt; accepted from &lt;a href="http://www.perlfoundation.org/"&gt;The Perl Foundation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;My proposal is listed&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;Shu-Chun Weng&lt;br /&gt;&lt;br /&gt;Contact information&lt;br /&gt; email: (hidden)&lt;br /&gt; IRC: freenode.net #perl6 with id "scw"&lt;br /&gt; Blog: http://YAPHB.blogspot.com&lt;br /&gt;&lt;br /&gt;Perl 6 Self-hosting Bootstrap From Perl 5 and Rules&lt;br /&gt;&lt;br /&gt;Synopsis&lt;br /&gt;  This is a subproject of Pugs (&lt;a href="http://pugscode.org"&gt;http://pugscode.org&lt;/a&gt;). One of the goals&lt;br /&gt;  of Pugs is to give an implementation of Perl 6 and help it&lt;br /&gt;  bootstraping. A new bootstrap plan has been proposed shortly. It&lt;br /&gt;  takes four steps and I propose to complete the first two steps in&lt;br /&gt;  this subproject. It consists of two new perl 5 modules. One&lt;br /&gt;  translates a very restrictive subset of Perl 6, MiniPerl6, to Haskell&lt;br /&gt;  and the another translates the Perl 6 Rule in to Parsec (a Haskell&lt;br /&gt;  parsing module) parsing code.&lt;br /&gt;&lt;br /&gt;This is the easiest way to bootstrap we currently found. Bootstrap&lt;br /&gt;from pure Perl 5 has been proven unbelievable hard due to the lack of&lt;br /&gt;good parsing components. Pugs itself is written in Haskell because of&lt;br /&gt;the Parsec module. It makes the parsing easier but still the parser&lt;br /&gt;has grown too large to debug and maintain. Since the Perl 6 Rule has&lt;br /&gt;been discussed for a long time and became stable and powerful enough,&lt;br /&gt;the Perl 6 seems better be parsed by Perl 6 Rule itself.&lt;br /&gt;&lt;br /&gt;Another feature of this project is that there is no "mixed" components&lt;br /&gt;in the whole process. Bootstrap plans often consist of some parts&lt;br /&gt;mixing two languages to get over the language gap before the target&lt;br /&gt;can be used. But we carefully designed the plan and languages to be&lt;br /&gt;used making that every components are written in a pure Perl 5 or Perl&lt;br /&gt;6. This make the project reusable.&lt;br /&gt;&lt;br /&gt;Deliverables&lt;br /&gt;  Module Pugs::Grammar::MiniPerl6&lt;br /&gt;    This module includes a Perl 6 Rule file and a Perl 5 script&lt;br /&gt;    translates the rule into Perl 5 parser module with the help of&lt;br /&gt;    Pugs::Compiler::Rule.&lt;br /&gt;&lt;br /&gt;  Module Pugs::Emitter::Rule::Parsec&lt;br /&gt;    This is the module used in the second step of bootstrap. It emits&lt;br /&gt;    Haskell code from the AST producted by Pugs::Compiler::Rule.&lt;br /&gt;&lt;br /&gt;  Module Pugs::Compiler::Rule&lt;br /&gt;    This is an existing module mainly written by Flavio S. Glock&lt;br /&gt;    (FGLOCK). Since it's heavily used is the above two modules and is&lt;br /&gt;    not completed, I may spend some time improving it to support more&lt;br /&gt;    Perl 6 Rule syntax.&lt;br /&gt;&lt;br /&gt;Project Details&lt;br /&gt;  The new bootstrap plan is: (original in &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/README"&gt;http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/README&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;   1. This module, Pugs::Grammar::MiniPerl6, uses Pugs::Compiler::Rule&lt;br /&gt;      to read a special *mixed* Perl 6 Rule whose production rules&lt;br /&gt;      are written in Perl 5 (the current requirement of P::C::Rule).&lt;br /&gt;   1a. The rule is used to translate a subset of Perl 6, MiniPerl6,&lt;br /&gt;       to haskell.&lt;br /&gt;&lt;br /&gt;   2. Then, Pugs::Compiler::Emit::Parsec lands and uses this module&lt;br /&gt;      to translate the full Perl 6 grammar into a parser. The full&lt;br /&gt;      grammar can now write production rules in MiniPerl6 since&lt;br /&gt;      P::C::E::Parsec can use this module to translate such production&lt;br /&gt;      rules to haskell and makes the final output be pure Haskell.&lt;br /&gt;&lt;br /&gt;   3. When compiling Pugs, the .hs preprocessor will use&lt;br /&gt;      Pugs::Compiler::Emit::Parsec to accept the full Perl 6 grammar&lt;br /&gt;      generating Parser.hs. Then GHC will compile it to executable.&lt;br /&gt;&lt;br /&gt;   4. The executable can now read the full Perl 6 grammar again&lt;br /&gt;      generating compiler in PIL. Then self hosting is done.&lt;br /&gt;&lt;br /&gt;  I propose to finish the first two steps. Note that the first step&lt;br /&gt;  seems contain a mixed-language file, but since the Perl 5 code only&lt;br /&gt;  appear in production rules and are marked with 'use v5,' it's still&lt;br /&gt;  valid Perl 6.&lt;br /&gt;&lt;br /&gt;  The most challenging parts of this project are:&lt;br /&gt;&lt;br /&gt;   1. The parsed grammar saved in Perl 5 hash-and-array tree-like data&lt;br /&gt;      structure is extremely complex and nearly unreadable. Since the&lt;br /&gt;      correctness has not been tested much, debugging modules using it&lt;br /&gt;      is a difficult job.&lt;br /&gt;&lt;br /&gt;   2. We don't know if the Perl 5 Rule parser is powerful and efficient&lt;br /&gt;      enough to handle the full grammar. Currently translating a&lt;br /&gt;      sample grammar file with five small rules takes one minute CPU&lt;br /&gt;      time on a Xeon 2.8GHz machine (may be unprecise due to HTT).&lt;br /&gt;&lt;br /&gt;   3. We don't know if Parsec is powerful enough to handle all&lt;br /&gt;      functionality provided by Perl 6 Rules. Hopefully, we should be&lt;br /&gt;      able to use only those which can be translated easily in the&lt;br /&gt;      first version of the full grammar of Perl 6. And since Parsec&lt;br /&gt;      code was copied into Pugs' source tree for the ease of modifying,&lt;br /&gt;      it's not that serious.&lt;br /&gt;&lt;br /&gt;  The project has it's own directory in the Pugs' subversion repository&lt;br /&gt;  now:&lt;br /&gt;    &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/"&gt;http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  And the second part will appear as&lt;br /&gt;    misc/pX/Common/Pugs-Compiler-Rule/lib/Pugs/Emitter/Rule/Parsec.pm&lt;br /&gt;&lt;br /&gt;  The whole project will be licensed under the same licenses of the&lt;br /&gt;  Pugs source tree, which are currently dual licensed under GPL-2 and&lt;br /&gt;  Artistic-2.0b5.&lt;br /&gt;&lt;br /&gt;Project Schedule&lt;br /&gt;  The following is the planned schedule:&lt;br /&gt;&lt;br /&gt;    May 31st -- Pugs::Grammar::MiniPerl6 has complete MiniPerl6 grammar&lt;br /&gt;                with correct production rules.&lt;br /&gt;    Jun 31st -- Pugs::Compiler::Rule be able to accept all syntax we&lt;br /&gt;                want to use in the full Perl 6 grammar.&lt;br /&gt;    Jul 1st -- Start organizing full Perl 6 grammar.&lt;br /&gt;    Jul 31st -- Pugs::Compiler::Emitter::Rule::Parsec can translate&lt;br /&gt;                most rule constructions.&lt;br /&gt;    Aug 1st -- Start rewriting exist parsing functions to Perl 6&lt;br /&gt;                rules.&lt;br /&gt;    Aug 20st -- Parser/*.hs can be replaced by the generated ones.&lt;br /&gt;    Sep 15th -- Parser.hs can be replaced by the generated one.&lt;br /&gt;&lt;br /&gt;Bio&lt;br /&gt;  I am a undergraduated student interested in pragramming language&lt;br /&gt;  field as well as one of the commiter of Pugs. I use Perl a lot in&lt;br /&gt;  daily works (data processing, crontab tasks, etc.), and with the PL&lt;br /&gt;  interest, I noticed and took a look at Perl 6 about two years ago.&lt;br /&gt;  I joint Pugs project and became a commiter right after one month of&lt;br /&gt;  the birth of it. I focused mainly on parser and added some language&lt;br /&gt;  constructions.&lt;br /&gt;&lt;br /&gt;  Some works listed:&lt;br /&gt;&lt;br /&gt;  Analysis of ?? :: (currently ?? !!) posted on mailing list:&lt;br /&gt;    &lt;a href="http://www.nntp.perl.org/group/perl.perl6.compiler/277"&gt;http://www.nntp.perl.org/group/perl.perl6.compiler/277&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  Some pugs blog entry mentioned my works&lt;br /&gt;  Array slicing &lt;a href="http://pugs.blogs.com/pugs/2005/03/day_36_many_thr.html"&gt;http://pugs.blogs.com/pugs/2005/03/day_36_many_thr.html&lt;/a&gt;&lt;br /&gt;  debian control files and :key(val)&lt;br /&gt;                &lt;a href="http://pugs.blogs.com/pugs/2005/03/day_56_leopold_.html"&gt;http://pugs.blogs.com/pugs/2005/03/day_56_leopold_.html&lt;/a&gt;&lt;br /&gt;  eval fix http://pugs.blogs.com/pugs/2005/03/day_54_yapctaip.html&lt;br /&gt;                &lt;a href="http://pugs.blogs.com/pugs/2005/03/day_50_pugscc_r.html"&gt;http://pugs.blogs.com/pugs/2005/03/day_50_pugscc_r.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Link to Further Information:&lt;br /&gt;&lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/README"&gt;http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/README&lt;/a&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114874369436921600?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114874369436921600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114874369436921600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114874369436921600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114874369436921600'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-24th-2006-google-summer-of-code.html' title='May 24th, 2006 -- Google Summer of Code!'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114839591078859942</id><published>2006-05-23T20:41:00.000+08:00</published><updated>2006-05-23T22:53:22.696+08:00</updated><title type='text'>May 23rd, 2006 -- Ratchet rocks</title><content type='html'>These days the Pugs repository was unusually silent, so did the channel which is full of joining and leaving messages.  The main reason might be the disappearance of Audrey: her last commit was on May 18th, five days ago.&lt;br /&gt;&lt;br /&gt;These days I spent most of development time on understanding and fixing ratchet.  The goal was to make it handle compile_p6grammar.pl correctly.  I achieved it several hours ago by properly handle match objects generated by quantified subrules.  The result is:&lt;blockquote&gt;&lt;pre&gt;$ time perl compile_p6grammar.pl MiniPerl6.grammar &gt; MiniPerl6.pm&lt;br /&gt;real    0m0.602s&lt;br /&gt;user    0m0.516s&lt;br /&gt;sys     0m0.027s&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;which took about two and half a minutes to complete, a two hundred times speed up.  Amazing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114839591078859942?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114839591078859942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114839591078859942' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114839591078859942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114839591078859942'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-23rd-2006-ratchet-rocks.html' title='May 23rd, 2006 -- Ratchet rocks'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114761813109018285</id><published>2006-05-14T22:32:00.000+08:00</published><updated>2006-05-14T22:48:51.110+08:00</updated><title type='text'>May 14th, 2006 -- Ratchet, don't backtrack</title><content type='html'>As I mentioned several days ago, the Pugs::Grammar::MiniPerl6 was almost finished so that I turned my attention to Pugs::Compiler::Rule.  fglock++ just committed the first version of ratchet parser which will not backtrack by default and will give an approximately 10x+ speedup by eliminating backtracking.&lt;br /&gt;&lt;br /&gt;Currently the ratchet support is far from complete.  5 of 24 test cases failed before yesterday.  I fixed one and found a serious bug on $pos resetting.  I added two test cases for it so that it now fails 6 of 26 test cases.&lt;br /&gt;&lt;br /&gt;fglock++ marked the failed tests as TODO and I found that I made a mistake on the meaning of "no backtracking," thanks to him and pmichaud++ correcting my understanding. I'll spend some time on the (?&amp;gt;) and section of backtracking of the perlre manual page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114761813109018285?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114761813109018285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114761813109018285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114761813109018285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114761813109018285'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-14th-2006-ratchet-dont-backtrack.html' title='May 14th, 2006 -- Ratchet, don&apos;t backtrack'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114727325363025141</id><published>2006-05-10T22:26:00.000+08:00</published><updated>2006-05-10T23:00:53.643+08:00</updated><title type='text'>May 10th, 2006 -- Variables! Tests!</title><content type='html'>As I mentioned&lt;a href="http://yaphb.blogspot.com/2006/05/may-9th-2006-grammar-and-module-formed.html"&gt;yesterday&lt;/a&gt;, Makefile.PL and a basic test file were added.  But there were still something missing.  I fixed the t/basic.t so that the test really passes.  And the last two tests are corrected by updating the compile_p6grammar.pl to the one I used which deal with backslashes correctly.&lt;br /&gt;&lt;br /&gt;On the another hand, I originally planned to support statements more than a single "return."  But I dropped the idea due to two reasons:&lt;ol&gt;&lt;br /&gt;&lt;li&gt;I was not familiar enough to rules to write the grammar.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Translating general statements to Haskell is not straight forward.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;But I implemented an alternative: temporary variables.&lt;br /&gt;&lt;br /&gt;Assignment is not provided so variables can be translated to a simple "let ... in ..." expression, pure lambda one.  The old yada example can now be written as &lt;blockquote&gt;&lt;pre&gt;rule yadaLiteral {&lt;br /&gt;   $&amp;lt;sym&amp;gt; := [ &amp;lt;'...'&amp;gt; | &amp;lt;'???'&amp;gt; | &amp;lt;'!!!'&amp;gt; ]&lt;br /&gt;   {  my $yada = doYada( $&amp;lt;sym&amp;gt; );&lt;br /&gt;      my $err = Val( VStr( $&amp;lt;sym&amp;gt; ~ " - not yet implemented") );&lt;br /&gt;      return App(&lt;br /&gt;       Var( $yada ),&lt;br /&gt;       Nothing,&lt;br /&gt;       [ $err ]&lt;br /&gt;     )&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;and translated into (the production rule part)&lt;blockquote&gt;&lt;pre&gt;let yada = (doYada sym) in&lt;br /&gt;let err = (Val (VStr (sym ++ " - not yet implemented"))) in&lt;br /&gt;return $ (App (Var yada) Nothing [err])&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Final notes:&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Now it takes nearly three minutes for compile_p6grammar.pl to translate the grammar to .pm file.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There are three kinds of variables now: named capture, numbered capture, and temporary.  Some renaming (prefix or suffix adding) may be performed to prevent conflict.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114727325363025141?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114727325363025141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114727325363025141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114727325363025141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114727325363025141'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-10th-2006-variables-tests.html' title='May 10th, 2006 -- Variables! Tests!'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114718928069578780</id><published>2006-05-09T23:10:00.000+08:00</published><updated>2006-05-10T10:40:04.383+08:00</updated><title type='text'>May 9th, 2006 -- Grammar and module formed</title><content type='html'>It was really a long weekend and Monday.  And a progressive Monday night and Tuesday.  However, I forgot to write the blog entry last night.  The numbered captures ($0, $1, ... ) are supported yesterday as well as escaped characters in string.  But it didn't work until I commited the part of code dealing with character classes in Pugs::Emitter::Rule::Perl5 several minutes before.  And the grammar now accept the array constructor "[1, 2, 3]".&lt;br /&gt;&lt;br /&gt;clkao++ added the Makefile.PL and test suit making Pugs::Grammar::MiniPerl6 more like a module instead of the sank box of my own.  I have to admit that I haven't written any perl module before and just studied the Makefile.PL in Pugs::Compiler::Rule.&lt;br /&gt;&lt;br /&gt;The building process includes an invokation of compile_p6grammar.pl to translate the grammar file to the .pm file.  I tried to use &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/lrep"&gt;lrep&lt;/a&gt; instead but found character classes are not supported (just as what happened in Pugs::Compiler::Rule).  But fglock++ stop me from switching to lrep and got offline right after that -- could you tell me why should I stay using compile_p6grammar.pl? :)&lt;br /&gt;&lt;br /&gt;Currently all language constructions I planned to support in MiniPerl6 are implemented (except the "(a, b)" one but it's not necessary).  I'll add more tests for it then move my concentration on Pugs::Compiler::Rule.&lt;br /&gt;&lt;br /&gt;Updated: fglock++ left an IRC message to me "lrep is under a rewrite - compile_p6grammar.pl has less features, but it is more up-to-date".  Ok, I'll use you script then :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114718928069578780?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114718928069578780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114718928069578780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114718928069578780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114718928069578780'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-9th-2006-grammar-and-module-formed.html' title='May 9th, 2006 -- Grammar and module formed'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114676321983518863</id><published>2006-05-05T00:36:00.000+08:00</published><updated>2006-05-05T02:39:39.020+08:00</updated><title type='text'>May 4th, 2006 -- A long silence, and function application</title><content type='html'>The last post was on midnight of Sunday, 4 days ago.  There were three in class midterms in 37 hours from Tuesday morning to noon of Wednesday.  They are "special topics on graph algorithms," PDE, and compiler.  Yes, I'm taking a compiler course this semester, which is a required course for junior.  The exam problem is quite cool: given a grammar of Java-like (or may it's really a snip of java spec) array-newing syntax, write a parser accepting it, 100 points.  No other constrains on algorithm.  And here comes the bonus: write another one, 50 points.  It took me some time to convince myself that write a parser in Perl 6 Rule will not count.&lt;br /&gt;&lt;br /&gt;Then I wrote the proposal of &lt;a href="http://code.google.com/soc/"&gt;summer of code&lt;/a&gt; and submitted it in evening.  There are some more detail thought about the new plan with not many new ideas.  But the may-faced challenging part is one of them:&lt;ol&gt;&lt;li&gt;The parsed grammar saved in Perl 5 hash-and-array tree-like data structure is extremely complex and nearly unreadable.  Since the correctness has not been tested much, debugging modules using it is a difficult job.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;We don't know if the Perl 5 Rule parser is powerful and efficient enough to handle the full grammar.  Currently translating a sample grammar file with five small rules takes one minute CPU time on a Xeon 2.8GHz machine (may be unprecise due to HTT).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;We don't know if Parsec is powerful enough to handle all functionality provided by Perl 6 Rules.  Hopefully, we should be able to use only those which can be translated easily in the first version of the full grammar of Perl 6.  And since Parsec code was copied into Pugs' source tree for the ease of modifying, it's not that serious.&lt;/li&gt;&lt;/ol&gt;clkao asked my plan on that if the second one really happened.&lt;blockquote&gt;clkao&amp;gt; scw: what are you going to do if perl5 based rule parser is too slow?&lt;br /&gt;scw&amp;gt; clkao: tune it :p&lt;br /&gt;* clkao grins&lt;/blockquote&gt;I love the idea.&lt;br /&gt;&lt;br /&gt;And some real-work reports.  I fixed the variable and function naming rule so that it doesn't consume too many things in the afternoon.  That makes function application as a operand of summation works.  Then a little rewrite of rules of function application with parameters makes it work, too.&lt;br /&gt;&lt;br /&gt;The performance problem seems affect my development more and more.  I now do changing only on the generated Perl 5 module and only when everything works I'll merge the change to the grammar file and run the translation script again to see if the result is still correct.  The reason is that I found the rule I used in the afternoon took one minutes and twelve seconds to translate and the one I committed several minutes before took nearly two minutes.  It seems time to hack into Pugs::Compiler::Rule.&lt;br /&gt;&lt;br /&gt;On the another hand, fglock++ revised the benchmark between P::C::R, inlined matching functions and Perl 5 regular expression.  The performance seem to be ten times better one by one from the last one (P5regex) to the first one (P::C::R).  Maybe I'll then write my own translation script in P5regex (a *lot* to do then) or inlined P::C::R structure instead of current one which uses P::C::R.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114676321983518863?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114676321983518863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114676321983518863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114676321983518863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114676321983518863'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/05/may-4th-2006-long-silence-and-function.html' title='May 4th, 2006 -- A long silence, and function application'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114641324186374925</id><published>2006-04-30T23:53:00.000+08:00</published><updated>2006-05-03T12:17:29.353+08:00</updated><title type='text'>April 30th, 2006 -- Small improvement</title><content type='html'>There is a course project deadline on midnight today (several minutes before).  It took I and my partner about 50+ hours each.  However, we've done it in time.&lt;br /&gt;&lt;br /&gt;Since the rule &lt;span style="font-style:italic;"&gt;ProductionRule&lt;/span&gt; consist of &lt;span style="font-style:italic;"&gt;Statements&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;Return&lt;/span&gt; goes into infinite loop (I'm not sure, but I don't want to wait any more), I currently restrict it to have only a return statement.  And I played with capture aliasing and quantified subpattern captures in Pugs::Compiler::Rule.  It basically works but seems to have some problem on deeper matching?&lt;br /&gt;&lt;br /&gt;I have a (self recursive) rule&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;rule AdditiveExpr {&lt;br /&gt;    &amp;lt;FunctionAppExpr&amp;gt; &amp;lt;ws&amp;gt;?&lt;br /&gt;    [ $&amp;lt;op&amp;gt; := (\+ | \- | ~) &amp;lt;ws&amp;gt;?&lt;br /&gt;      $&amp;lt;rhs&amp;gt; := (&amp;lt;AdditiveExpr&amp;gt;) &amp;lt;ws&amp;gt;? ]?&lt;br /&gt;    { use v5;&lt;br /&gt;      if($&amp;lt;op&amp;gt;[0]){&lt;br /&gt;          return "(" . $&amp;lt;FunctionAppExpr&amp;gt;() . " " . $&amp;lt;op&amp;gt;[0] . " " . $&amp;lt;rhs&amp;gt;[0] . ")";&lt;br /&gt;      }else{&lt;br /&gt;          return $&amp;lt;FunctionAppExpr&amp;gt;();&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;This works for matching "$&amp;lt;a&amp;gt; + t" there both terms can be matched by &lt;span style="font-style:italic;"&gt;FunctionAppExpr&lt;/span&gt;, but when I feed "$&amp;lt;a&amp;gt; + t + 3", the "+ 3" part disappeared.&lt;br /&gt;&lt;br /&gt;But some good news.  r10165 can translate "return $&amp;lt;a&amp;gt; + t" to "return $ (a + t)", which valid Haskell and is what I want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114641324186374925?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114641324186374925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114641324186374925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114641324186374925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114641324186374925'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/04/april-30th-2006-small-improvement.html' title='April 30th, 2006 -- Small improvement'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114624333684950945</id><published>2006-04-29T00:25:00.000+08:00</published><updated>2006-04-29T00:56:38.260+08:00</updated><title type='text'>April 28th, 2006 -- The Grammar</title><content type='html'>Came back from the future today, it's still April now, not May.  Thanks TimToday.&lt;br /&gt;&lt;br /&gt;I woke up really late today.  It was about noon and I went to the office for the $part_time_job in the afternoon.  But I can still spend some time on IRC.  At about five o'clock, I fed the rule I drafted for MiniPerl6 to Pugs::Compiler::Rule and found some compilation error.  Audrey pointed out that the comma may have to be escaped.  That worked and many other problems are resolved in the same way including the plus sign, minus sign, tilde (string concatenation operator) and semicolon.&lt;br /&gt;&lt;br /&gt;The draft of the grammar is now &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/lib/Pugs/Grammar/MiniPerl6.grammar"&gt;here&lt;/a&gt;. It's full of "&amp;lt;ws&amp;gt;?" since I do not yet know how to turn the word parsing mode on in P::C::Rule.  And the string matching part lacks escaping sequence matching because Pugs::Emit::Rule::Perl5 currently ignores character class rule and I met some problem handling backslashes.  I will spend some time to fix it.  Also, production rules are mostly omitted but, as the &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/parser.pl"&gt;sample parsing script&lt;/a&gt; demos, the written one works.&lt;br /&gt;&lt;br /&gt;You might find that there is currently no Pugs/Grammar/MiniPerl6.pm in the repository.  Yes, it's not there since it can be generated by feeding the &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/lib/Pugs/Grammar/MiniPerl6.grammar"&gt;grammar&lt;/a&gt; to the &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Compiler-Rule/compile_p6grammar.pl"&gt;script&lt;/a&gt; under Pugs-Compiler-Rule.  The automatic generating script will be added soon, maybe right after some kind of completion of the mini-grammar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114624333684950945?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114624333684950945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114624333684950945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114624333684950945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114624333684950945'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/04/april-28th-2006-grammar.html' title='April 28th, 2006 -- The Grammar'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114615206613024031</id><published>2006-04-27T22:56:00.000+08:00</published><updated>2006-04-28T14:09:13.503+08:00</updated><title type='text'>April 27th, 2006 -- The Plan</title><content type='html'>I tried to feed the yadaLiteral rule &lt;a href="http://yaphb.blogspot.com/2006/04/may-26th-2006-second-beginning.html"&gt;describe yesterday (this morning)&lt;/a&gt; to Pugs::Compiler::Rule and found it failed to parse.  The problem is that there is a &lt;i&gt;$&amp;lt;sym&amp;gt; ~ ' - not yet implemented'&lt;/i&gt; 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.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/README"&gt;here&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt; &lt;li&gt;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).&lt;br /&gt;&lt;br /&gt;The rule is used to translate a subset of perl 6, MiniPerl6,&lt;br /&gt;     to Haskell.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt; &lt;li&gt;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.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt; &lt;li&gt;When compiling Pugs, the .hs preprocessor will use&lt;br /&gt;    Pugs::Compiler::Emit::Parsec to accept the full perl 6 grammar&lt;br /&gt;    generating Parser.hs.  Then GHC will compile it to executable.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt; &lt;li&gt;The executable can now read the full perl 6 grammar again generating compiler in PIL.  Then self hosting is done.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;That's all about today.  There's a deadline this weekend so that there may not be any progress before Monday, sorry :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114615206613024031?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114615206613024031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114615206613024031' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114615206613024031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114615206613024031'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/04/april-27th-2006-plan.html' title='April 27th, 2006 -- The Plan'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114611356135006628</id><published>2006-04-27T12:15:00.000+08:00</published><updated>2006-04-28T14:08:56.800+08:00</updated><title type='text'>April 26th, 2006 -- The Second Beginning</title><content type='html'>I mainly focused on parser hacking in the development one year ago, so that this time when I asked Audrey, she remember that I've added the parsing function for :key(val) (an alternative pair constructing syntax) and "?? !!" ("?? ::" when I proposed it, in fact I didn't really added it.  I wrote an analysis and she added it).  Fortunately, she was refactoring Parser.hs preparing to replace it by a perl 6 rule file generated one.&lt;br /&gt;&lt;br /&gt;So that's my task.  I'm now writing a translator in perl 5 which accepts a perl 6 rule file (with some restrictions on the production rules).  Here's an example. (source code of pugs can be obtained from &lt;a href="http://svn.openfoundry.org/pugs/"&gt;http://svn.openfoundry.org/pugs/&lt;/a&gt;)&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;{- From src/Pugs/Parser/Literal.hs line 24 -}&lt;br /&gt;yadaLiteral :: RuleParser Exp&lt;br /&gt;yadaLiteral = expRule $ do&lt;br /&gt;    sym  &lt;- choice . map symbol $ words " ... ??? !!! "&lt;br /&gt;    return $ App (Var $ doYada sym) Nothing [Val $ VStr (sym ++ " - not yet implemented")]&lt;br /&gt;    where&lt;br /&gt;      doYada "..." = "&amp;fail_" -- XXX rename to fail() eventually&lt;br /&gt;      doYada "???" = "&amp;amp;warn"&lt;br /&gt;      doYada "!!!" = "&amp;die"&lt;br /&gt;      doYada _ = error "Bad yada symbol"&lt;/pre&gt;&lt;/blockquote&gt;Can be written as (perl 6 rule format)&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;rule yadaLiteral {&lt;br /&gt;   $&amp;lt;sym&amp;gt; := [ &lt;'...'&gt; | &lt;'???'&gt; | &lt;'!!!'&gt; ]&lt;br /&gt;   { return App(&lt;br /&gt;       Var( doYada( $&amp;lt;sym&amp;gt; ) ),&lt;br /&gt;       Nothing,&lt;br /&gt;       [ Val( VStr( $&amp;lt;sym&amp;gt; ~ ' - not yet implemented') ) ]&lt;br /&gt;     )&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;Now, there is already a perl 6 rule parser module written in perl 5: Pugs::Compiler::Rule.  Currently it emits recursive-descent perl 5 parsing code.  I'm going to add a Haskell backend for it.&lt;br /&gt;&lt;blockquote&gt;&amp;lt; autreyt&amp;gt; so, your task, should you choose to accept it, is to use whatever the most expedient way to produce a parser for such a language, and emit Haskell code for it&lt;br /&gt;&amp;lt; scw&amp;gt; in perl 5, but using three languages at once :D&lt;br /&gt;&amp;lt; audreyt&amp;gt; :D&lt;br /&gt;&amp;lt; scw&amp;gt; so what I could do is adding a backend for Pugs::Compiler::Rule&lt;br /&gt;&amp;lt; scw&amp;gt; which targets on Haskell&lt;/blockquote&gt;How is the progress?  Have you seen that it's April 27th now in +0800 time zone?  What does that mean?  Oh, nothing, just a joke.  The idea of creating a new blog for this didn't come up until this morning.  I finally understood how to use Pugs::Compiler::Rule last night, which was the goal I set for my self yesterday, then went back to the VFX ( Digital Visual Effects) project again.  So that's all.  I can now write a small peace of perl 5 code&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;use Pugs::Compiler::Rule;&lt;br /&gt;my $rule = Pugs::Compiler::Rule-&gt;compile("moose { return 23 }");&lt;br /&gt;print $rule-&gt;{perl5}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Which converts&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;rule foo{ moose { return 23 } }&lt;/pre&gt;&lt;/blockquote&gt;into&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;do {&lt;br /&gt;   package Pugs::Runtime::Rule;&lt;br /&gt;   my $matcher =&lt;br /&gt;      concat(&lt;br /&gt;          constant( q!m! )&lt;br /&gt;,         concat(&lt;br /&gt;            constant( q!o! )&lt;br /&gt;,           concat(&lt;br /&gt;              constant( q!o! )&lt;br /&gt;,             concat(&lt;br /&gt;                constant( q!s! )&lt;br /&gt;,               concat(&lt;br /&gt;                  constant( q!e! )&lt;br /&gt;,                   abort(&lt;br /&gt;                      sub {&lt;br /&gt;                          return { bool =&gt; 1, tail =&gt; $_[0], return =&gt; sub { return 23 } };&lt;br /&gt;                      }&lt;br /&gt;                  )&lt;br /&gt;              )&lt;br /&gt;            )&lt;br /&gt;          )&lt;br /&gt;        )&lt;br /&gt;      )&lt;br /&gt; ;&lt;br /&gt; sub {&lt;br /&gt;   my $grammar = shift;&lt;br /&gt;   my $tree;&lt;br /&gt;   rule_wrapper( $_[0],&lt;br /&gt;       $matcher-&gt;( $_[0], $_[1], $tree, $tree, $grammar, 0, $_[0], $_[2] )&lt;br /&gt;   );&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;Scary, isn't it?  However, my goal is&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;ruleFoo = do{ symbol "moose"; return $ VInt 23 }&lt;/pre&gt;&lt;/blockquote&gt;Much clearer now!  Hope I can, and see you next time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114611356135006628?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114611356135006628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114611356135006628' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114611356135006628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114611356135006628'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/04/april-26th-2006-second-beginning.html' title='April 26th, 2006 -- The Second Beginning'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-27075926.post-114611127926189243</id><published>2006-04-27T11:54:00.000+08:00</published><updated>2006-04-27T12:14:39.270+08:00</updated><title type='text'>Restart Hacking!</title><content type='html'>Hello, I'm Shu-Chun Weng, a.k.a. scw.  The commit bit was gained on March 1st, 2005 and I did some parser and builtin function hacks.  But all these stopped on Apral 18th, 2005 due to the National  University Sports Game hold on April 29th.  There were two extra commits after then but those are not really "hacking."&lt;br /&gt;&lt;br /&gt;However, after a whole year of stopping, I asked Autrey Tang if there's some thing I can help again, just as the first time I joint #perl6 and asked her (him, then).  So that I'm now hacking *again*.  *grin*&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/27075926-114611127926189243?l=yaphb.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaphb.blogspot.com/feeds/114611127926189243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=27075926&amp;postID=114611127926189243' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114611127926189243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/27075926/posts/default/114611127926189243'/><link rel='alternate' type='text/html' href='http://yaphb.blogspot.com/2006/04/restart-hacking.html' title='Restart Hacking!'/><author><name>Shu-Chun Weng</name><uri>http://www.blogger.com/profile/04862846201811012652</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11825683666681061718'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry></feed>