Day 106: Apache::RequestRec for Pugs!

autrijus on 2005-05-17T23:41:13

Thanks to the jhorwitz's hard work, this now works with mod_parrot:

module PugsHandler;

sub _handler($r) {
    $r.puts("Hello world!");
    return 0;
}

Here $r is a Apache::RequestRec object; the entire handler is compiled to Parrot bytecode, loaded and executed in memory by mod_parrot, exactly like what mod_perl does. This means we will see something like this very soon:

SetHandler parrot-code
ParrotLanguage Pugs
ParrotResponseHandler ModPugs::Registry 
Options +ExecCGI 

clkao added tests for symbolic operators, and I implemented them within 24 hours. To wit:

sub prefix:<Σ> (@x) { [+] *@x }
sub postfix:<!> ($x) { [*] 1..$x }
say Σ [1..5!] # 7260

Note the use of the reduce metaoperator [...] above: [+] means sum, and [*] means product.

I finally finished reading Why's poignant guide to Ruby today. I'm grateful to Why's kind words in his Autrijus Raising Perl6 as a Real Puppy Should blog entry; I posted a comment there to look for a champion for the Cardinal (Ruby on Parrot) project, as I'd love to see it joining the ongoing collaboration among Pyrate(Python), ParTcl(Tcl), Pugs(Perl6), Ponie(Perl5) and other Parrot languages -- lately irc.perl.org #parrot has become a quite happening place!

The quickref project is building up steam from Juerd, kolibre and iblech: we have quickref/data, quickref/oo, quickref/op and quickref/var now.

With adehohum's helpful debugging, named subrule capturing now works correctly in Pugs/PGE:

rule fishy { (.*)shark };
"whaleshark" ~~ m//;
say $[0];    # "whale"

Stevan has been reading a lot about Smalltalk and metaclass theories; he applied them to Perl::MetaModel, delivering many magical results with small amounts of code. After all, what's a magician but a practicing theorist? :-)

Darren added full tests for Locale::KeyedText, but noted that the lack of class methods, compile-time import with use lib '/path', $obj.meta and is constant is holding the tests from passing. I'll see what I can do for them in the 6.2.4 release...

luqui pointed out that we should use Manhattan distance (sum of inheritance deltas), instead of leftmost tiebreaking, to dispatch MMD; it's now implemented. However, I'm very surprised to learn that there can be multiple levels of invocants: multi sub foo ($x: $y: $z: $w) {}; now a nontrivial amount of Pugs internals needs to change for this underdocumented specification. This issue is raised on p6l, along with some type coercion issues.

scook0 changed Haddock to use the more manageable {- ... -} block inline style, then added more function signature declarations.

Corion, iblech, putter, mugwump and masak performed more helpful gnoming on various unit tests and documentations.

luqui hacked Makefile.PL a bit to allow user-specified hsc2hs executable via $ENV{'HSC2HS'}.

nothingmuch checked in his helpful util/smoke_loop.sh script, a complete smoke test loop to automatically build parrot, p6bible, haddock and pugs itself. He also updated the smoke graph to use inline CSS, which requires the latest version of Test::TAP::HTMLMatrix.

iblech added a splash screen to the Pugs/Parrot live CD, hacked in »~« support, and added a test for the bug that prevents bare blocks from containing $_.

See you tomorrow!


fixed link to live cd

mapopa on 2005-05-18T13:15:20

http://svn.openfoundry.org/pugs/util/livecd/splashscreen.txt

Re:fixed link to live cd

autrijus on 2005-05-18T13:37:45

Thanks, fixed.

Thank you for the ruby guide

mapopa on 2005-05-19T14:47:45

it's very funny "At my local Barnes and Noble, there is a huge wall of Java books just waiting to tip over and crush me one day. And one day it will." ROFL - Add C# to the Java books wall - New Cobols are ready