IlyaM's Friends' Journals http://use.perl.org/~IlyaM/journal/friends/ IlyaM's Friends' use Perl Journals en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:09:04+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 IlyaM's Friends' Journals http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~IlyaM/journal/friends/ Finally, some Test::Builder2 examples! http://use.perl.org/~schwern/journal/40528?from=rss <p>For my PDX.pm presentation tonight on <a href="http://github.com/schwern/test-more/tree/Test-Builder2">Test::Builder2</a> I threw together some quick examples of some of its killer features, in particular demonstrating changing how Test::Builder2 behaves using method modifiers and applying object roles.</p><p>First, demonstrating end-of-assert actions, there's <a href="http://github.com/schwern/test-more/blob/Test-Builder2/examples/TB2/lib/TB2/DieOnFail.pm">die on fail</a> but even cooler is <a href="http://github.com/schwern/test-more/blob/Test-Builder2/examples/TB2/lib/TB2/DebugOnFail.pm">DEBUG on fail</a>! That's right, run your test in the debugger and have it automatically set a breakpoint on a failure. How cool is that?</p><p>I'm sure somebody with better debugger foo than I can make it even cooler and stop at the top of the assert stack rather than inside DebugOnFail.</p><p>The second is reimplementing <a href="http://search.cpan.org/perldoc?Test::NoWarnings">Test::NoWarnings</a> safely. <a href="http://github.com/schwern/test-more/blob/Test-Builder2/examples/TB2/lib/TB2/NoWarnings.pm">TB2::NoWarnings</a> demonstrates hooking into the start and end of the test as well as safely altering the number of tests planned by trapping the call to set_plan.</p><p>You can safely use them all together, though its a crap shoot if DebugOnFail or DieOnFail will trigger first.</p><p>While roles and method modifiers are relatively new to the Perl community, using them in lieu of designing my own event system for TB2 has two great advantages. First, I didn't have to design and debug my own event system.<nobr> <wbr></nobr>:) Second, rather than having to learn the quirks of a one-off system, you learn the quirks of Mo[uo]se and then can apply that knowledge all over the place.</p><p>There's <a href="http://github.com/schwern/test-more/issues/labels/Test-Builder2">a pile of stuff to be done in TB2</a>, a lot of them are fairly small and self contained. Have a look. Patches welcome.</p> schwern 2010-09-09T08:33:42+00:00 journal Test::Builder2 at 10k Feet http://use.perl.org/~schwern/journal/40527?from=rss <p>Here's a diagram of the "flow" of assert results through Test::Builder version 1.</p><blockquote><div><p> <tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.-------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| foo.t |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp;.-------------.&nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp;.----------------.<br>&nbsp; &nbsp; &nbsp;| Test::More&nbsp; |&lt;---------&gt;| Test::Whatever |<br>&nbsp; &nbsp; &nbsp;'-------------'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'----------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp;.---------------.&nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '----&gt;| Test::Builder |&lt;----'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '---------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.-----.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| TAP |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-----'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.---------------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Test::Harness |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '---------------'</tt></p></div> </blockquote><p>You write foo.t using Test::More and Test::Whatever. These both<br>use the same Test::Builder object. It spits out TAP which<br>Test::Harness converts into something human readable.</p><p>The big problem there is Test::Builder is monolithic. There's no<br>further breakdown of responsibilities. It only spits out TAP, and<br>only one version of TAP.</p><p>Here's what Test::Builder2 looks like:</p><blockquote><div><p> <tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.-------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.----------------| foo.t |-------------------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '-------'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.------------.&nbsp; &nbsp; &nbsp;.----------------.&nbsp; &nbsp; &nbsp;.------------------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Test::More |&nbsp; &nbsp; &nbsp;| Test::Whatever |&nbsp; &nbsp; &nbsp;| Test::NotUpdated |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '------------'&nbsp; &nbsp; &nbsp;'----------------'&nbsp; &nbsp; &nbsp;'------------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.----------------.&nbsp; &nbsp; &nbsp; &nbsp;.---------------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'----------&gt;| Test::Builder2 |&lt;------| Test::Builder |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'----------------'&nbsp; &nbsp; &nbsp; &nbsp;'---------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.--------------.&nbsp; &nbsp;<nobr> <wbr></nobr>.-------------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| TB2::History |&lt;---| TB2::Result |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'--------------'&nbsp; &nbsp; '-------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp;<nobr> <wbr></nobr>.--------------------------.&nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp;.---------------------.<br>&nbsp; &nbsp; | TB2::Formatter::TAP::v13 |&lt;-----'------&gt;| TB2::Formatter::GUI |<br>&nbsp; &nbsp; '--------------------------'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '---------------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp;<nobr> <wbr></nobr>.-------------------------------.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; | TB2::Formatter::Streamer::TAP |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; '-------------------------------'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.-----.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| TAP |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-----'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.---------------.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.-----------------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Test::Harness |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| Pretty Pictures |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '---------------'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-----------------'</tt></p></div> </blockquote><p>It starts out the same, foo.t uses a bunch of test modules<br>including Test::More and Test::Whatever using the same Test::Builder2<br>object, but it also uses Test::NotUpdated which is still using<br>Test::Builder. That's ok because Test::Builder has been rewritten in<br>terms of Test::Builder2 (more on that below).</p><p>Test::Builder2, rather than being a monolith, produces a<br>Test::Builder2::Result object for each assert run. This gets stored<br>in a Test::Builder2::History object for possible later use. It also<br>gets handed to a Test::Builder2::Formatter object, the default is<br>Test::Builder2::TAP::v13 which produces TAP version 13. This is fed<br>to a Streamer that prints it to STDOUT and STDERR which is read by<br>Test::Harness and made human readable.</p><p>Because Test::Builder2 is not monolithic, you can swap out parts. For<br>example, instead of outputting TAP it could instead hand results to a<br>formatter that produced a simple GUI representation, maybe a green<br>bar, or something that hooks into a larger GUI. Or maybe one that<br>produces JUnit XML.</p><p>Here's how Test::Builder and Test::Builder2 Relate.</p><blockquote><div><p> <tt>&nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.-----.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.-----.<br>&nbsp; &nbsp; &nbsp; &nbsp; | TB2 |&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| TB1 |<br>&nbsp; &nbsp; &nbsp; &nbsp; '-----'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-----'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v<br>&nbsp; &nbsp;<nobr> <wbr></nobr>.-------------.&nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.--------------.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.-------------.<br>&nbsp; &nbsp; | TB2::Result |-------&gt;| TB2::History |&lt;--------| TB2::Result |<br>&nbsp; &nbsp; '-------------'&nbsp; &nbsp; &nbsp; &nbsp; '--------------'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.----------------.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'-------------&gt;| TB2::Formatter |&lt;--------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '----------------'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<nobr> <wbr></nobr>.--------.<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Output |<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '--------'</tt></p></div> </blockquote><p>Test::Builder and Test::Builder2 coordinate their actions by sharing<br>the same History and Formatter objects. If you call TB1-&gt;ok() it<br>produces a Result object which it hands to the History singleton and<br>the Formatter singleton. If you call TB2-&gt;ok() it produces a Result<br>object which it hands to the same History and Formatter objects.</p><p>This allows most of the Test::Builder code to remain the same while<br>still coordinating with Test::Builder2. It also allows radically<br>different builders to be made without Test::Builder2 dictating how<br>they're to work.</p><p>The downside is that roles applied to Test::Builder2 will not effect<br>Test::Builder. Because of this, Test::Builder may become more closely<br>coupled with Test::Builder2 in the future.</p><p>Diagrams by <a href="http://search.cpan.org/dist/App-Asciio">App::Asciio</a>.</p> schwern 2010-09-09T08:15:22+00:00 journal A month of Test::Builder2 http://use.perl.org/~schwern/journal/40517?from=rss <p>I've had <a href="http://www.perlfoundation.org/test_builder_2">a grant open for Test::Builder2</a> for, oh god over two years now. Since I started it, Perl 6 has had a release! I think its the second oldest running dev grant.</p><p>I've cleared the decks of other responsibilities and can dedicate September to, if not finishing, then at least releasing something people can poke at. First alpha release was supposed to be "two weeks after the start" ha ha ha! oh god. The design has evolved and simplified greatly in the intervening two years, but its time to get something the hell out the door. At least a <a href="http://github.com/schwern/test-more/tree/Test-Builder2">Test::Builder2</a> Star if you will.</p><p>There's critical components missing. There's no diagnostics, YAML or otherwise. The issues with nested asserts are still congealing. Plans are not enforced. Result objects are in the middle of being remodeled... again. But Test::Builder is using what parts of Test::Builder2 are usable. Multiple output formats and streams work. Asserts can be nested in the common, simple cases without having to fiddle with $Level. And you can hook into various events.</p><p>Step one is I'm going to seal up what's there, write docs where they're missing, and release something.</p><p>A release before October or the grant dies.</p> schwern 2010-08-28T04:08:39+00:00 journal Alien::SVN - new release, new management http://use.perl.org/~schwern/journal/40503?from=rss <p>Those of you still stuck using Subversion will be happy to find <a href="http://search.cpan.org/~mlanier/Alien-SVN-1.6.12.0/">a new release of Alien::SVN</a>. It drags it forward to 1.6.12, doesn't do much else.</p><p>Also, Alien::SVN has finally found a new manager! From out of the blue comes <a href="http://search.cpan.org/~mlanier/">Matthew Lanier</a> with a patch and the will and a PAUSE ID. He'll be taking care of things from now on. Its his first CPAN module, be gentle. Godspeed, Matthew.</p> schwern 2010-08-18T22:33:29+00:00 journal Test::Builder2::Design http://use.perl.org/~schwern/journal/40487?from=rss <p>In an effort to shed some light on what Test::Builder2 is about, I took a few hours and performed a brain dump about its goals and design. You can see the result in the new <a href="http://github.com/schwern/test-more/blob/Test-Builder2/lib/Test/Builder2/Design.pod">Test::Builder2::Design</a> document.</p><p>The key design goals are 1) that it has to work, 2) that it has to work everywhere and 3) that it has to test everything. This throws out a lot of 98% solutions.</p> schwern 2010-08-10T02:31:05+00:00 journal Method::Signatures returns! 5.12, func() and fast! http://use.perl.org/~schwern/journal/40474?from=rss <p>Chip submitted a minor performance patch to Method::Signatures today. That drove me to push out <a href="http://github.com/schwern/method-signatures/blob/v20100730/Changes">a new release</a> making it friendly to 5.12 and adding func() for non methods!</p><p> &nbsp; &nbsp; &nbsp; &nbsp; func hello(:$greeting = "Hello",<nobr> <wbr></nobr>:$place = "World") {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print "$greeting, $place!\n";<br> &nbsp; &nbsp; &nbsp; &nbsp; }</p><p> &nbsp; &nbsp; &nbsp; &nbsp; hello( place =&gt; "Earth" );</p><p>For those who don't know, one of the neato features of <a href="http://search.cpan.org/perldoc?Method::Signatures">Method::Signatures</a> is that it can <a href="http://search.cpan.org/~mschwern/Method-Signatures-20090620/lib/Method/Signatures.pm#Aliased_references">alias references</a> to make working with references less of a trial:</p><p> &nbsp; &nbsp; &nbsp; &nbsp; func popn(\@array, $howmany) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return splice @array, -$howmany;<br> &nbsp; &nbsp; &nbsp; &nbsp; }</p><p> &nbsp; &nbsp; &nbsp; &nbsp; my @stuff = (1,2,3,4,5);<br> &nbsp; &nbsp; &nbsp; &nbsp; my @last_three = popn(\@stuff, 3); # 3,4,5<br> &nbsp; &nbsp; &nbsp; &nbsp; print @last_three;</p><p>It does this with the amazing <a href="http://search.cpan.org/perldoc?Data::Alias">Data::Alias</a> module. Unfortunately, 5.12 broke its black magic and its non-trivial to fix. Method::Signatures now makes Devel::Alias an optional dependency. If its available, it'll use it. Otherwise, no aliasing for you.</p><p>But that's ok, because perl5i makes working with references enjoyable. And while perl5i is adding its own simple signatures, they're forward compatible with Method::Signatures! They play together, so if you want perl5i and the full power of Method::Signatures you can have them.</p><p> &nbsp; &nbsp; &nbsp; &nbsp; use perl5i::2;<br> &nbsp; &nbsp; &nbsp; &nbsp; use Method::Signatures;</p><p> &nbsp; &nbsp; &nbsp; &nbsp; func echo($message is ro) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; say $message;<br> &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>Just make sure you load MS after perl5i. The last one loaded wins.</p><p>Finally, I was comparing Method::Signatures with MooseX::Method::Signatures and made a disturbing discovery. I always new MooseX::Method::Signatures would have a performance penalty, it does more checks than Method::Signatures, I just didn't realize how bad it was.</p><p>Here's comparing an empty signature: <code>method foo() {}</code>.</p><blockquote><div><p> <tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rate&nbsp; &nbsp; MMS&nbsp; &nbsp; &nbsp;MS&nbsp; &nbsp; Std<br>MMS&nbsp; &nbsp; 3207/s&nbsp; &nbsp; &nbsp;--&nbsp; -100%&nbsp; -100%<br>MS&nbsp; 1498875/s 46644%&nbsp; &nbsp; &nbsp;--&nbsp; &nbsp; -1%<br>Std 1508351/s 46940%&nbsp; &nbsp; &nbsp;1%&nbsp; &nbsp; &nbsp;--</tt></p></div> </blockquote><p>That's showing MooseX::Method::Signatures is 450x slower than either Method::Signatures or a normal method call creaking out a mere 3500 method calls per second as compared to the 1.5 million it should be doing. And that's for a method with an empty signature!</p><p>To be clear, that's the speed of calling a method, not compiling them.</p><p>Here's one comparing a simple signature that requires a check, so MS can't optimize it away: <code>method foo($arg!) { return $arg + 1 }</code> That's a required positional argument.</p><blockquote><div><p> <tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rate&nbsp; &nbsp; MMS&nbsp; &nbsp; &nbsp;MS&nbsp; &nbsp; Std<br>MMS&nbsp; &nbsp; 2928/s&nbsp; &nbsp; &nbsp;--&nbsp; -100%&nbsp; -100%<br>MS&nbsp; &nbsp;983127/s 33481%&nbsp; &nbsp; &nbsp;--&nbsp; &nbsp; -2%<br>Std 1005357/s 34240%&nbsp; &nbsp; &nbsp;2%&nbsp; &nbsp; &nbsp;--</tt></p></div> </blockquote><p>3000 method calls instead of a million.</p><p>Now I'm the first to counter arguments bemoaning method call overhead. Usually it doesn't matter. Usually the extra cost of calling a method and checking arguments is insignificant compared to what that method actually does. And MooseX::Method::Signatures has features Method::Signatures does not, most significantly type checking. But my god! Three orders of magnitude of performance lost! And its not even using the extra MMS features. That's just too much.</p> schwern 2010-07-31T00:49:55+00:00 journal Perl 6 Is The Language Your Language Could Smell Like http://use.perl.org/~schwern/journal/40472?from=rss <p><a href="http://www.youtube.com/watch?v=owGykVbfgUE">Hello programmers</a>. Look at your code, now at Perl 6, now back at your code, now back at Perl 6! Sadly, your code is not written in Perl 6. But if you use <a href="http://rakudo.org/announce/rakudo-star/2010.07">Rakudo Star</a> then Perl 6 is the language your code could be written in!</p><p><a href="http://github.com/rakudo/star/downloads">Now Microsoft scented!</a></p> schwern 2010-07-29T19:24:09+00:00 journal "def" or "func"? http://use.perl.org/~schwern/journal/40444?from=rss <p>perl5i 2.3.0_01 now has <a href="http://twitter.com/perl5i/status/18391811333">basic methods and subroutine signatures</a> with code basically lifted straight from <a href="http://search.cpan.org/dist/Method-Signatures-Simple">Method::Signatures::Simple</a>. <a href="http://search.cpan.org/dist/MooseX-Declare">MooseX::Declare</a> got me addicted, now I want them everywhere.</p><blockquote><div><p> <tt>use perl5i::2;<br> &nbsp; <br>def add($this, $that) {<br>&nbsp; &nbsp; return $this + $that;<br>}<br> &nbsp; <br>method new($class: %args) {<br>&nbsp; &nbsp; return bless \%args, $class;<br>}<br> &nbsp; <br>my $echo = def($arg) { return $arg };</tt></p></div> </blockquote><p>Its alpha for two reasons. First, I don't have time right now to really thoroughly test it, but I really want it.</p><p>Second, overriding "sub" is hard. <a href="http://search.cpan.org/dist/signatures">Its been done</a> but its a bit twitchy. Defining a new keyword is easy(er). So what should that keyword be? I've come up with two that have good arguments. "def" and "func". Both are short. "def" has the benefit of being used by other programming languages a Perl programmer is likely to encounter and not hate (Python, Ruby, Scala, Groovy). "func" is nice because it pretty clearly means "function" whereas "define" is a bit ambiguous.</p><p>perl5i currently does both. Only one will survive in version 3 (the other will be deprecated). Before you comment on which is your favorite, try it for a little bit. I found a difference between what I thought I like and what I actually use.</p> schwern 2010-07-13T00:06:57+00:00 journal Perl 6 Design Minutes for 30 June 2010 http://use.perl.org/~chromatic/journal/40433?from=rss <p>The Perl 6 design team met by phone on 30 June 2010. Allison, Patrick, and chromatic attended.</p><p> <strong>Allison:</strong> </p><ul> <li>working on Parrot packages for Debian experimental</li><li>seems like a good idea to do that before the 2.6 supported release</li><li>there was also a request for Rakudo packages</li><li>not sure if I'm the best person to do it</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>I'm sure we should package Rakudo Star</li></ul><p> <strong>Allison:</strong> </p><ul> <li>Debian had a packager for those, but I haven't looked at the packages</li><li>this'd be an early run of what we'll do with Rakudo Star</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>we're not quite ready for packaging that yet</li><li>maybe a couple of weeks</li><li>finished the <code>List</code> and <code>Iterator</code> types for the #30 release</li><li>adjusted Rakudo's <code>Associative</code> and <code>Positional</code> roles</li><li>much cleaner implementation now</li><li>that'll require a few small spec changes</li><li>redid Rakudo's container types</li><li>more robust</li><li>preparing for autovivification of hashes and arrays</li><li>expect to finish those in the next couple of days</li><li>there was no container model previously; the code was consequently crufty</li><li>lots of cleanup of incorrect assumptions</li><li>Rakudo lists are now properly lazy</li><li>comment syntax fixed</li><li>ROADMAP updated</li><li>fixed the meaning of <code>Nil</code>; it's defined, not undefined</li><li>added the sink prefix (?)</li><li>fixed setting of <code>$!</code> </li><li>started fixing bugs and closing tickets on Monday, did 15 or 20</li><li>mostly already fixed in the previous couple of weeks</li><li>looking at the implementation of the series operator</li><li>spec is self-contradictory or ambiguous or both</li><li>waiting for Larry's clarification</li><li>fixed a bug in <code>$*ARGFILES</code> </li><li>had a nice contribution of that implementation last week</li><li>that behavior works on any set of files, not just those on the command line</li><li>working on autoviv</li><li>have some regex backtracking bugs to fix</li><li>will work on closures after that</li><li>put together three new YAPC presentations</li><li>the Rakudo Star presentation will become a video cast or a blog post or both</li></ul><p> <strong>c:</strong> </p><ul> <li>worked on a slew of Parrot optimizations for Rakudo</li><li>have a few more to go</li><li>might have to create a Rakudo branch temporarily</li><li>will try to help merge the new GC</li><li>working on a metamodel for Parrot objects, informed by Perl 6 and Moose</li></ul> chromatic 2010-07-03T08:13:30+00:00 journal Modern Perl: The (Draft) Book http://use.perl.org/~chromatic/journal/40423?from=rss <p>This took longer than I expected, but <a href="http://www.modernperlbooks.com/mt/2010/06/modern-perl-the-book-the-draft.html">the draft of the Modern Perl book is available for review</a>. I'm especially interested in hearing from people who don't consider themselves expert Perl 5 programmers. The goal of the book is to explain how Perl 5 works (and how to write Perl 5 effectively) to help novices become adepts.</p> chromatic 2010-06-28T23:43:33+00:00 journal Where The Hell Is Test::Builder2? http://use.perl.org/~schwern/journal/40421?from=rss <p>My progress and communication about the Test::Builder2 grant has been nothing short of appalling. There is a sort of herky-jerky progress where I figure out a design problem, push the code forward, then remember a use-case that throws a wrench in the whole design and the whole thing comes to a screeching halt again.</p><p>At the QA hackathon we elegantly solved the problem of things like <a href="ahref=">die-on-fail and Test::NoWarnings</a> but then ran afoul of things like Test::Warn and Test::Exception which runs tests inside of tests but those aren't actually part of the test stack.</p><p>Confused? I'll post more about it another time. Point is, TB2 continues to move forward, its just that there's long periods of rumination between sprints of development. And I get distracted by other projects. At this rate I'll be collecting Social Security before I collect the second half of the grant. I really want TB2 to happen, but something decisive has to be done. I work best with hard deadlines, so the plan is to clear a month for working mostly on TB2. A lot of the wibbling is trying to come up with the most elegant solution, but I usually have a less than elegant way to solve it and move forward. If its between an elegant TB2 that doesn't exist and a less elegant TB2 that does, well, go with the one that exists. With the way my schedule is looking, that will probably be mid-August to mid-September. If that doesn't produce an alpha, then I'll kill the grant.</p><p>That doesn't mean TPF gets nothing for your money. Chunks of TB2 can be harvested to improve TB1. Specifically, the TB2 formatting and history objects. The TB2 formatter makes the guts of TB1 cleaner, and it also allows it to produce something other than TAP. Used together, history and formatter allows non-Test::Builder based test frameworks to work together with Test::Builder providing even more flexibility. This is <a href="http://github.com/schwern/test-more/blob/Test-Builder2/lib/Test/Builder.pm">already done in the TB2 branch</a>.</p><p>Looking at the grant deliverables, most of it is done:</p><blockquote><div><p> <tt>* Split up global shared Test resources into individual objects<br>&nbsp; &nbsp; * The test counter<br>&nbsp; &nbsp; * The output filehandles<br>&nbsp; &nbsp; * The plan<br> &nbsp; <br>* Allow hooks for global beginning and end of test functions.<br>&nbsp; &nbsp; * Ensure multiple hooks "stack"<br>&nbsp; &nbsp; * die on fail<br>&nbsp; &nbsp; * debug on fail<br> &nbsp; <br>* Hooks for global beginning and end of test actions<br>&nbsp; &nbsp; * Example: A safer Test::NoWarnings<br>&nbsp; &nbsp; * Example: Don't cleanup temp files on failure so they can be debugged<br> &nbsp; <br>* Allow for test output other than TAP<br> &nbsp; <br>* Allow another Test::Builder-like module to work in the same process<br>&nbsp; as Test::Builder (for example, sharing the counter).<br> &nbsp; <br>* Rewrite Test::Builder in terms of Test::Builder2.</tt></p></div> </blockquote><p>Here's what's not complete:</p><blockquote><div><p> <tt>* Split up localizable behaviors into objects<br> &nbsp; <br>* Allow individual test modules to locally override Test::Builder2 behaviors<br> &nbsp; <br>* Allow test modules to globally override Test::Builder2 behaviors<br>&nbsp; &nbsp; * How the plan works</tt></p></div> </blockquote><p>Since I'm not writing to the letter of the law, <a href="http://github.com/schwern/test-more/issues/labels/Test-Builder2">there's more than that to be done before release</a>, but the project does move.</p> schwern 2010-06-27T19:16:09+00:00 journal The Post-YAPC Plan http://use.perl.org/~schwern/journal/40420?from=rss <p>I spent most of YAPC::NA mildly sick, sleep deprived and writing talks. Each of those things alone isn't so bad, but put all together meant I had time and energy enough to do my talks, discuss with people after, and that's about it. As a result, I was kind of dead in the head most of the time and didn't do a whole lot of interaction with people. I didn't feel like I got the most out of the one opportunity a year I get to hang out with huge gobs of Perl folk.</p><p>One of the things which I wanted to do at YAPC was get <a href="http://gitpan.integra.net/">gitpan</a> restarted. It can run right now, but the code is a mess and needs to be babied. It needs a rewrite. That rewrite was supposed to happen at YAPC but see above. I'm doing that now, using MooseX::Declare, perl5i and Path::Class just to mess around with them seriously. Also log4perl, which I'm finally learning a decade late. Its fun, far more pleasant than knocking it together without, once you learn to cope with Moose's idiosyncrasies. Better to learn the quirks of one complete system than nine incomplete ones.</p><p>That's what's absorbing my time right now. After that I want to add subroutine signatures to perl5i and the <a href="http://piratepad.net/ULub7Vjsgn">&#252;ber file and directory objects</a>. They were supposed to be in, at least as a prototype, by YAPC but that didn't work out. Using MooseX::Declare, Path::Class and perl5i together has me drooling for them.</p><p>Will Coleda, representing the TPF, found me at YAPC and mercifully did not break my legs. We hashed out a plan to make a last stab at Test::Builder2 before calling the grant done. That's not going to happen until August, I'll post about that later.</p><p>Oh, and I have a talk to do at OSCON about how <a href="http://www.oscon.com/oscon2010/public/schedule/detail/14113">the world is going to end in 2038</a> assuming <a href="http://www.youtube.com/watch?v=ZW2qxFkcLM0">2012 doesn't claim the prize first</a>. And a two part <a href="http://opensourcebridge.org/proposals/420">Git tutorial for Drupal programmers</a> that I'm developing into a commercial class. And two paid clients to keep happy.</p><p>One thing I *don't* have to worry about is MakeMaker. Gird your loins, MakeMaker has provisionally been handed off to Matt Trout. Maybe I need to worry about it more...</p> schwern 2010-06-27T18:34:30+00:00 journal Perl 6 Design Minutes for 16 June 2010 http://use.perl.org/~chromatic/journal/40419?from=rss <p>The Perl 6 design team met by phone on 16 June 2010. Larry, Allison, Patrick, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>documented <code>TOP</code> (again), and explained how parsing is initiated and how it actually works</li><li>series operator (<code>...</code>) now picks a monotonic function when using single characters as endpoints</li><li>STD can now catch duplicates involving <code>proto</code>s as well as <code>only</code>s</li><li>STD no longer advises removal of parens on spaceless <code>sub()</code> declaration</li><li>mostly advised sorear and pmichaud</li><li>Stefan is finishing the boostrap of the STD parser</li><li>also working on adding a parallel NFA and DFA engine</li><li>no, he doesn't want to generate all the states in advance</li><li>it works faster lazily</li></ul><p> <strong>Allison:</strong> </p><ul> <li>working on chroot environments with something more secure than chroot</li><li>relevant to building Parrot packages</li><li>looking at some bugs for Will</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>Rakudo developers decided not to make extra special effort to make a June release of Rakudo Star</li><li>the calendar works against us</li><li>the new date for the release is July 29</li><li>we're I comfortable with hitting that target</li><li>we won't be happy with the results of moving heaven and earth to release in June</li><li>there are lots of advantages</li><li>one disadvantage is not having Rakudo Star at YAPC::NA</li><li>one big advantage is using the supported Parrot 2.6 release as the basis</li><li>I'll write a post outlining the plan in the next couple of days</li><li>otherwise working on lists and interators in Perl 6 and Rakudo</li><li>after deciding to make iterators immutable, Larry and I realized that solves many problems</li><li>everything works out as plain as day after that</li><li>very happy with that design</li><li>the incorrect assumptions of the old model were pervasive</li><li>replacing the old pieces is taking a while, which is no surprise</li><li>this approach feels right though</li><li>the new branch does things no previous version could do</li><li>slices work much better, for example</li><li>metaoperators work properly</li><li>map is lazy</li><li>slurpy arguments in lists are lazy by default</li><li>no weird binding or action at a distance problems</li><li>plenty of changes to <code>Associative</code> and <code>Positional</code> roles</li><li>those are now super clean and may be lazy</li><li>more features work</li><li>~30 failing tests (not test files, just tests) now, ~500 last night</li><li>most of the current failures are minor</li><li>will try to merge the branch before the release</li><li>replacing lots of ugly code with fewer lines of elegant code</li><li>Jonathan and others have worked on lots of other pieces</li><li>adding plenty of new features</li><li>looking forward to tomorrow's release</li></ul><p> <strong>c:</strong> </p><ul> <li>editing the Rakudo book</li><li>moving the Rakudo release date may let us have a printed book available about the same time</li><li>depends on how much there is left to write</li></ul> chromatic 2010-06-26T17:07:30+00:00 journal Perl 6 Design Minutes for 09 June 2010 http://use.perl.org/~chromatic/journal/40415?from=rss <p>The Perl 6 design team met by phone on 09 June 2010. Larry, Allison, Patrick, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>not much spec change this week</li><li>figured out a syntax for a regex block to return more than one cursor</li><li>based on <code>gather</code>/<code>take</code> </li><li>in STD hacking, continued to assist Stefan O'Rear in getting STD bootstrapped via viv</li><li>now that it's bootstrapped, we're refactoring things that make sense now</li><li>we're now starting to move bits of Cursor code from Perl 5 into Perl 6</li><li>refactoring the grammar for sanity of design</li><li>started upgrading STD to normal Perl 6 syntax where it previously catered to <code>gimme5</code>'s limitations</li><li>for example, switched STD's old<nobr> <wbr></nobr><code>.&lt;_from&gt;</code> and<nobr> <wbr></nobr><code>.&lt;_pos&gt;</code> hash lookups to using<nobr> <wbr></nobr><code>.from</code> and<nobr> <wbr></nobr><code>.pos</code> accessors</li><li>started the prep work for moving <code>EXPR</code> out of <code>STD</code> to make it generally available to any grammar wanting operator precedence</li><li>in STD parsing, made Perl 5 <code>$&lt;</code> detection have a longer token to avoid confusion with match variables</li><li>STD no longer attempts two-terms detection on <code>infix_circumfix_meta_operator</code> </li><li>STD now parses <code>&gt;&gt;R~&lt;&lt;</code> correctly, or at least dwimmily</li><li>STD doesn't complain about P5isms in <code>printf</code> formats like <code>"%{$count}s"</code> </li><li>STD was parsing<nobr> <wbr></nobr><code>/m</code> and<nobr> <wbr></nobr><code>/s</code> with the opposite semantics</li><li> <code>termish</code> now localizes <code>$*MULTINESS</code> in its scope so that inner declarations aren't accidentally multified</li><li>STD now carps about <code>package Foo;</code> as a Perl 5 construct</li></ul><p> <strong>Allison:</strong> </p><ul> <li>talked to Chris Shiflett, a PHP developer, on someone from the PHP community to sit on the Parrot board</li><li>will be in the US for a few weeks</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>working on list simplification</li><li>had a couple of breakthrough ideas on Monday</li><li>working on the implementation now</li><li>worked out inversion lists for character class matching in regexes</li><li>will make them faster, especially with long ranges of character classes</li><li>fixed a half-dozen tickets in RT</li><li>fixed Rakudo hash constructors</li><li>fixed an intermittent bug with colon-pair signatures</li><li>two possible parses exist in STD, but we removed an unneeded one in Rakudo</li><li>fixed a bug with Parrot's <code>exit</code> opcode</li><li>NQP and PAST needed an update not to cheat with PASM constants</li><li>I fixed that too</li><li>Vasily added multisub and multimethod support to NQP, that was a big plus</li><li>fixed the <code>**</code> quantifier in regexes to understand surrounding whitespace</li><li>regex engine tried to match beyond the end of a string, so I added guards for that</li><li>will work on lists furiously before the next release</li><li>I don't think it'll take long</li><li>closures are next, hope to have those in place by the weekend</li></ul><p> <strong>c:</strong> </p><ul> <li>released a new version of Pod::PseudoPod::LaTeX to support the various books in progress</li></ul> chromatic 2010-06-24T12:24:33+00:00 journal Perl 6 Design Minutes for 02 June 2010 http://use.perl.org/~chromatic/journal/40410?from=rss <p>The Perl 6 design team met by phone on 02 June 2010. Larry, Allison, Patrick, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>mostly, I supported sorear in bootstrapping STD to use <code>viv</code> instead of <code>gimme5</code> </li><li>his stage 2 and stage 3 now output identical Perl 5 versions of STD</li><li>produces a huge amount of warnings</li><li>appears to require Perl 5.12 at the moment</li><li>working on both of those</li><li>S03 refines hyper dwimminess to be more like APL, with modular semantics</li><li>S02 refines <code>Blob</code>s to simply be immutable <code>Buf</code>s, with similar generic characteristics</li><li>S02 now describes native <code>blob</code> types</li><li>implemented post-declaration checks for <code>BEGIN</code> and <code>use</code>, since those can't wait for end of file</li><li>STD no longer loses existing bindings when we go to a sublanguage</li><li>STD now uses <code>$*GOAL</code> variable only as informative, never as a "stopper"</li><li>instead, we create a <code>&lt;stopper&gt;</code> rule for <code>$*GOAL</code> if necessary</li><li>can check for that only, instead of that or <code>$*GOAL</code> </li><li>answering lots of questions on how STD and <code>viv</code> work besides that</li></ul><p> <strong>Allison:</strong> </p><ul> <li>did a lot of research on graph color algorithms for register usage algorithms</li><li>will finish my finals on Monday</li></ul><p> <strong>Will:</strong> </p><ul> <li>trying to herd the discussion of dynop libraries</li><li>a recent branch to close an old ticket broke a lot of assumptions</li><li>some bugs have become more visible because of these changes</li><li>hope to get that cleaned up this week</li></ul><p> <strong>Allison:</strong> </p><ul> <li>I liked your suggestion of bringing back the <code>getstderr</code> and related opcodes</li></ul><p> <strong>Will:</strong> </p><ul> <li>trying to resurrect Partcl</li><li>stuck on a TT #389 closing issue</li><li>not sure how to fix that, the way things are now</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>working on the iterator and list design</li><li>brainstorming the implementation</li><li>will implement somethine one way or another this week</li><li>people keep implementing workarounds for the current system</li><li>they'll bite us eventually</li><li>Moritz and I worked on making the regex engine returning real Perl 6 objects</li><li>that mostly works</li><li>exposes some places where lists don't work exactly right</li><li>the workarounds there made me replan the list and iterator implementation</li><li>answered some questions online</li><li>Jonathan added a better backtrace algorithm for Rakudo</li><li>reports Perl 6 source lines instead of PIR lines</li><li>I'll review his code</li><li>think I can borrow it for NQP for all HLLs</li><li>Jonathan reports that it was a lot easier in NQP than PIR</li></ul><p> <strong>c:</strong> </p><ul> <li>trying to answer a few Parrot design questions</li><li>looking at the continuation of design from Perl 1 - 4 to Perl 5 and Perl 6</li><li>hope to have coding time soon</li></ul> chromatic 2010-06-22T01:12:29+00:00 journal Perl 6 Design Minutes for 26 May 2010 http://use.perl.org/~chromatic/journal/40408?from=rss <p>The Perl 6 design team met by phone on 26 May 2010. Larry, Allison, Patrick, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li><nobr> <wbr></nobr><code>:()</code> syntax is now always signature</li><li>we now use <code>foofix:[...]</code> as the general op form instead of <code>foofix:(...)</code> </li><li>refactored the sematics of<nobr> <wbr></nobr><code>:nth</code> and<nobr> <wbr></nobr><code>:x</code> </li><li><nobr> <wbr></nobr><code>:nth()</code> now only ever takes a monotonically increasing list</li><li>S03 now explains how "not-raising" works on <code>!=</code> and <code>ne</code> </li><li>it now basically matches the intuitions of an English speaker via HOP definition of negate metaop</li><li>STD sometimes didn't require semi between statements</li><li>statement modifiers are expression terminators but not valid statement terminators</li><li>an unexpected statement modifier word like <code>if</code> could terminate one statement and start another</li><li>fixed up backslashes in character classes to allow <code>\s</code> etc and reject <code>\u</code> etc</li><li>STD was accidentally using the same lexpad for different multis</li><li>Cursor now treats<nobr> <wbr></nobr><code>:()</code> on name extension as a signature always, never as a categorical</li><li>we shouldn't introduce the stopper for circumfix until we're in the circumfix, or we can't use the same char on both ends</li><li>placeholder messages error messages are now much more informative and correct</li><li>we now disallow use of placeholder after same variable has been used as a non-placeholder, even for an outer reference</li><li>renamed add_macro (which it doesn't) to add_categorical (which it does)</li><li>participating frequently in discussions on semantics both on irc and p6l</li><li>working closely with sorear++ as he brings viv closer to bootstrapping, yay!</li><li>soon can bootstrap past gimme5</li></ul><p> <strong>Allison:</strong> </p><ul> <li>worked on Pynie this week in my limited spare time</li><li>one goal is to generate the parser directly from the Python grammar</li><li>wrote a small, lightweight PEG parser which generates a match tree from the Python 3 grammar</li><li>can generate a lexer directly</li><li>right now it creates a parse tree</li><li>looks similar to the match nodes of NQP-rx</li><li>dumps out a tree to the PIR parser</li><li>working on PaFo elections for next year, but trying to delegate those</li><li>will have more time after June 7</li></ul><p> <strong>Will:</strong> </p><ul> <li>working on Perl 6 advent tests</li><li>many more people are doing more work than me</li><li>liasing with Rakudo folks for any important Parrot bugs before the Rakudo Star release</li><li>my current direction there is "don't break anything"</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>sorear added hash flattening to NQP</li><li>lots of work on closures in PAST and NQP</li><li>they properly clone</li><li>fixes some lexical problems</li><li>need to get that to work in Rakudo</li><li>that's tougher; Rakudo has to wrap Parrot subs</li><li>wrapper object needs cloning as well, along with its attributes</li><li>we'll add a new PAST node type to help</li><li>that node understands contexts</li><li>essentially a way to add void context optimizations to your AST</li><li>that solves many problems in Rakudo beyond closures</li><li>added a setting into NQP along with its test suite</li><li>not automatically loaded, but available</li><li>contains standard hash and array methods</li><li>Parrot's ops2c project uses those</li><li>other people can update and enhance that setting as necessary</li><li>NQP also has the ability to parse type names</li><li>NQP doesn't do anything with them yet</li><li>eventually they'll allow the use of multis</li><li>cleaning up some NQP bugs regarding lexicals and package storage of subs</li><li>Bruce Keeler enabled variable interpolations in regexes</li><li>working on some refactorings to simplify that approach</li><li>works in NQP and Rakudo now</li><li>that's a feature we've never had before</li><li>Rakudo's REPL now works better, thanks to sorear</li><li>HLLCompiler now written more in NQP as part of that</li><li>NQP now can do <code>eval</code> </li><li>NQP remembers lexicals in interactive mode now</li><li>adding that to Rakudo is more complex</li><li>working on that</li><li>pleased with the progress on #perl6</li></ul><p> <strong>c:</strong> </p><ul> <li>reviewing long term plans for GC and Lorito</li><li>should have more time free soon</li></ul> chromatic 2010-06-20T19:40:02+00:00 journal Perl 6 Design Minutes for 19 May 2010 http://use.perl.org/~chromatic/journal/40401?from=rss <p>The Perl 6 design team met by phone on 19 May 2010. Larry, Will, and chromatic attended. Patrick added his notes later.</p><p> <strong>Larry:</strong> </p><ul> <li>S03 makes more explicit that doctrine that <code>~~</code> topicalizes, and removes smartmatch table fossils that automatically fall out from that</li><li>S05 renames 'accent' to 'mark' for better Unicode conformance</li><li><nobr> <wbr></nobr><code>:a</code> and<nobr> <wbr></nobr><code>:aa</code> changed to<nobr> <wbr></nobr><code>:m</code> and<nobr> <wbr></nobr><code>:mm</code> </li><li>S05 disrequires retroactive semantics on<nobr> <wbr></nobr><code>:samecase</code> and<nobr> <wbr></nobr><code>:samemark</code> </li><li>the method form must now explicitly add case or mark modifiers to the pattern</li><li>regularized <code>mm//</code> to <code>ms//</code> to avoid confusion with new<nobr> <wbr></nobr><code>:m</code> ignoremark option</li><li>STD now does a bit better at diagnosing bogus <code>??!!</code> constructs of various sorts</li><li>STD now correctly adds operators to symbol tables as subs</li><li> <code>CORE.setting</code> now has protos of all the operators so they can be recognized as subs too</li><li>Cursor now canonicalize operator names in the symbol table</li><li>btw, not quite like specced</li><li>STD now reads user's mind on '<code>Str $toto</code>' to intuit missing declarator</li><li>STD now properly diagnoses a typename between routine declarator and sub name</li></ul><p> <strong>Will:</strong> </p><ul> <li>working on code for Carl Masak, trying to get his poker code example running on Rakudo</li><li>both fun and frustrating</li><li>some stuff doesn't quite work yet</li><li>going through the Advent examples</li><li>adding them to spectests</li><li>make sure we won't regress on such public examples</li><li>other people are helping with that now</li></ul><p> <strong>c:</strong> </p><ul> <li>will get back to editing the Rakudo book soon</li><li>hope to have it in print by YAPC, but no guarantee</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>fixed closures in NQP, as a precursor for fixing them in Rakudo</li><li>worked with sorear on REPL in Rakudo and PCT in general</li><li>ported the NQP "standard library" done by japhb++, bacek++, and many others into the nqp-rx repository and made it part of the standard build sequence for nqp and Parrot</li><li>decided we need a new "context sensitive" node type in PAST, will be used to create proper closures and to handle sink context</li><li>worked with bacek on adding better multimethod support to PAST and nqp-rx</li><li>discovered a problem with lexical subs in NQP being automatically entered into the package namespace (and some existing code relying on this behavior)</li><li>did some initial fixes to at least get things entered properly, but a complete fix may require a deprecation cycle</li><li>plan to review others' patches this week</li><li>plan to fix REPL, closures, and sink context in Rakudo (since those are currently large pain points)</li><li>plan to work on loops and iterators after that</li></ul> chromatic 2010-06-16T21:38:09+00:00 journal Perl 6 Design Minutes for 12 May 2010 http://use.perl.org/~chromatic/journal/40400?from=rss <p>The Perl 6 design team met by phone on 12 May 2010. Larry, Allison, Patrick, and Will attended.</p><p> <strong>Larry:</strong> </p><ul> <li>clarified usage of brackets around infixes</li><li>added various 128-bit types to the spec; we might make them arbitrarily extensible via role</li><li>at least LLVM could support this, even to non-powers-of-two sizes</li><li>modernized the paleolithic grammatical category description in S02</li><li>STD now uses double-quote rules for interpolating <code>@foo[]</code> into regex</li><li>STD now gives better message on <code>1__3</code> </li><li>added the specced 128-bit types to CORE.setting</li><li>added <code>minmax</code> function to CORE.setting</li><li>implemented <code>circumfix:&#171;X Y&#187;</code> as grammar derivation</li><li>currently only allows a <code> &gt;&gt; inside</code></li><li>now also recognizes <code>foofix:("\x[face]")</code> and <code>foofix:("\c[YOUR CHARACTER HERE]")</code> without actually evaluating</li><li>playing with factoring <code>yaml</code> out of <code>gimme5</code>, since <code>viv</code> is not likely to go that route.</li><li>mostly just answered a lot of questions on irc</li><li>egged people on about concurrency issues</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>thought on handling closures properly</li><li>have a solution, just need some time to implement</li><li>discussion on changes to CodeString</li><li>work on compiler toolkit to avoid CodeString, using StringBuilder instead where possible, in PCT, NQP, and rakudo. Pretty easy, no downstream projects block on a deprecation issue</li><li>after that, lists</li><li>also been answering questions on interactive mode (REPL) for rakudo et al. (the issue with losing lexicals)</li></ul><p> <strong>Allison:</strong> </p><ul> <li>resolved the git conversation pretty well (for Parrot's repo migration)</li><li>worked on a pure PEG parser (following the paper), straight PIR, single day; now self-parsing. Interesting project, is lightweight. currently has memoization, but that might not be right for us because of backtracking. With some more effort, could probably handle EBNF form (useful for python)</li><li>could be setup for developer status for Debian which will improve our packaging status for Debian and Ubuntu</li></ul><p> <strong>Will:</strong> </p><ul> <li>Parrot CodeString performance improvements</li><li>we're definitely faster in branch, but some feedback from pmichaud should help us clean up the API a bit as well, look for those to hit trunk in the next few days</li><li>Parrot makefile deps cleanup</li></ul> chromatic 2010-06-16T01:47:02+00:00 journal Perl 6 Design Minutes for 05 May 2010 http://use.perl.org/~chromatic/journal/40351?from=rss <p>The Perl 6 design team met by phone on 05 May 2010. Larry, Allison, Patrick, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>various spec updates, some major</li><li>removed <code>p5=&gt;</code> description because it's not supported in core</li><li>deleted <code>self:sort</code> construct because self isn't a real syntactic category</li><li>explained Perl patterns in terms of PEGs, and spec'ed tiebreaking rules explicitly</li><li>last but not least, finally purveyed the long-threatened revamp of proto to keep routine and method semantics similar</li><li>they all now work much more like the multiple dispatch semantics currently used by STD, where we always call the proto first</li><li>the proto is then always in charge of the actual multiple dispatch; it can of course delegate that</li><li>and the default for a null body corresponds closely to current semantics</li><li>in hacking news, the lexer generator mislaid any alternative that was a bare<nobr> <wbr></nobr><code>.</code> pattern, so cursor_fate never called its alternative, oops</li><li>took me a long time to run that one down, because it resulted in a horrendous backtrack causing mysterious misplaced errors</li><li>revamped character class parsing to be more helpful and correct</li><li>STD now check a normal regex bracket's innards for old-school character class, and warns if found</li><li>added a<nobr> <wbr></nobr><code>.looks_like_cclass</code> method to Cursor to detect most accidental uses of P5 ranges</li><li>some valid P6 brackets will complain, but the workarounds are easy</li><li>just put whitespace on both ends is one way</li><li>removed a few of these old-school-ish character classes from STD</li><li>changed<nobr> <wbr></nobr><code>:tr</code> language to<nobr> <wbr></nobr><code>:cc</code> language since character classes share it</li><li>(translation pays more attention to ordering, but the language is the same)</li><li>turned out parsing character classes discovered issues in STD; various character classes needed to backslash <code>#</code> that would otherwise be a comment</li><li>to that end, we now allow <code>\#</code> in character classes instead of misparsing as unspace</li><li>if we find an invalid <code>-</code> in a regex, we now presume we're in an old-school character class and fail with a sorry instead of a panic to give the character class code a shot at it</li><li>STD now uses <code>~</code> syntax for regex brackets to set <code>$*GOAL</code> correctly</li><li>cleaned up recursive panic detection; it was possible to get both false positives and negatives before</li><li>STD shouldn't use 'note' to emit a panic inside a suppose because that leaks the message that should be trapped</li><li>STD now suppresses duplicate <code>sorry</code> messages more correctly</li><li> <code>sorry</code> no longer uses <code>panic</code> in a supposition, but dies directly to throw the exception to the suppose's try block</li><li>STD now allows subscripts on regex variables so <code>$x[0]</code> isn't taken as a character class; still needs speccing</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>can we make them consistent?</li></ul><p> <strong>Larry:</strong> </p><ul> <li>historically S05 has allowed bare arrays to mean interpolation</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>we've never had a working implementation of that</li></ul><p> <strong>Larry:</strong> </p><ul> <li>a bare <code>@</code> would be illegal</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>it's currently illegal</li></ul><p> <strong>Larry:</strong> </p><ul> <li>you'd have to backslash it to match part of an email address</li><li>it's not like the <code>@</code> alternations are a big deal one way or another</li><li>that'd be a little more consistent</li><li>I forced it to think of the sigil as <code>$</code> than what it really is</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>after seeing how Jonathan et all did interpolation for quoted strings, I thought we should do the same thing in regexes</li></ul><p> <strong>Larry:</strong> </p><ul> <li>STD now has a partial fix to prevent leakage of<nobr> <wbr></nobr><code>::T</code> from role signatures</li><li>unfortunately, the current fix will lose signatures of file-scoped generic roles</li><li>this probably has to do with not knowing whether we're really going to want a new pad; unfortunately we'd have to look ahead to know that currently</li><li>various other minor tweaks and bug fixes in STD and Cursor</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>mostly responding to messages and reports</li><li>should be able to get back to coding full-time and online for the next week</li><li>plan to resolve the list and closure issues with NQP and Rakudo</li><li>will answer other questions and try to keep other people productive</li><li>planning for the Rakudo Star release on June</li></ul><p> <strong>Allison:</strong> </p><ul> <li>busy with the last week of classes</li><li>spent most of it writing a little language with PCT</li><li>it was easy to use and easy to swap the stages of PCT</li><li>I remembered what Patrick did with LOLCODE</li><li>also had a discussion of source code control systems</li><li>next week should be more productive</li><li>need to work more closely with Debian packagers to get packages into Debian</li></ul><p> <strong>Will:</strong> </p><ul> <li>cleaning out as many deprecations in Parrot as possible</li><li>trying to improve the speed of CodeString after the immutable STRINGs merge</li><li>bundling lots of little concats helps</li><li>hope to merge in an optimization branch for that by the weekend</li><li>want to make that faster or less memory intensive</li><li>may require the use of a new StringBuilder for Parrot</li><li>hopefully will result in a faster Rakudo build</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>I've never seen CodeString take a long time</li><li>unless you run into memory problems</li><li><p> * discussion of the StringBuilder PMC *</p></li> </ul><p> <strong>c:</strong> </p><ul> <li>still working on optimizations, particularly CodeString</li><li>looking at more PBC and PBC-building optimizations</li><li>PBC size went down dramatically and startup improved for Rakudo</li><li>should have that much faster for the 2.4 release</li><li>will poke at GC tasks starting next week</li></ul> chromatic 2010-05-10T06:07:34+00:00 journal Object::ID - A unique object identifier for any object http://use.perl.org/~schwern/journal/40340?from=rss <p>Something Perl's OO has been missing has been a reliable way to identify an object. Is $this the same as $that? Not asking if it contains the same information, but is it a referent to the same object? Have we seen it before? When I alter $this will I also be changing $that?</p><blockquote><div><p> <tt>package Foo;<br> &nbsp; <br>use Object::ID;<br> &nbsp; <br>...write the class however you want...</tt></p></div> </blockquote><p>Really, HOWEVER YOU WANT! Inside out, outside in, code refs, regexes, globs, Moose, Mouse... Call the constructor whatever you like, add in a DESTROY method. Doesn't matter, it'll work.</p><blockquote><div><p> <tt>my $id&nbsp; &nbsp;= $obj-&gt;object_id;<br>my $uuid = $obj-&gt;object_uuid;</tt></p></div> </blockquote><p> <code>object_id()</code> is a cheap, process-specific identifier. <code>object_uuid()</code> is a bit more expensive on first call (it has to generate the <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Uuid">UUID</a>, about 30% slower) but it should be universally unique across machines and processes.</p><p>That's great for YOUR objects, but what about everyone else? You can either inject the Object::ID role one class at a time...</p><blockquote><div><p> <tt>package DateTime;<br>use Object::ID;<br> &nbsp; <br>my $date = DateTime-&gt;now;<br>say $date-&gt;object_id;</tt></p></div> </blockquote><p>or you can load UNIVERSAL::Object::ID and every object has it. EVERY OBJECT! Even things you don't realize are objects.</p><blockquote><div><p> <tt>use UNIVERSAL::Object::ID;<br> &nbsp; <br># Regexes are objects<br>say qr/foo/-&gt;object_id;<br> &nbsp; <br># Loading IO::Handle turns all filehandles into objects<br>use IO::Handle;<br>open my $fh, "foo/bar";<br>say $fh-&gt;object_id;</tt></p></div> </blockquote><p>But OH GOD UNIVERSAL! Well, use at your own risk. Its handy to use in your own programs and private libraries. Or you can use <a href="http://search.cpan.org/dist/Method-Lexical">Method::Lexical</a> and apply it lexically.</p><p>Why not just use the object's reference address? Well, as people implementing inside-out objects discovered, they're not unique. They're not thread safe, and worse they're not even unique for the life of the process. Perl will reuse the reference of a destroyed object. Observe:</p><blockquote><div><p> <tt>{<br>&nbsp; &nbsp; package Foo;<br> &nbsp; <br>&nbsp; &nbsp; sub new {<br>&nbsp; &nbsp; &nbsp; &nbsp; my $class = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; return bless {}, $class;<br>&nbsp; &nbsp; }<br>}<br> &nbsp; <br>for(1..3) {<br>&nbsp; &nbsp; my $obj = Foo-&gt;new;<br>&nbsp; &nbsp; print "Object's reference is $obj\n";<br>}</tt></p></div> </blockquote><p>Run that and you should get the same reference, three times, for three different objects.</p><p>And then there's the problem of string overloaded objects. You have to be careful to always use Scalar::Util::refaddr or overload::StrVal.</p><p>It turns out inside-out objects have nearly the same problem, and 5.10.0 introduced field hashes to solve that. rjbs explains the pain of all this at slide 120 in his excellent <a href="http://www.slideshare.net/rjbs/perl-510-for-people-who-arent-totally-insane">5.10 For People Who Aren't Totally Insane</a>. You can read the <a href="http://search.cpan.org/dist/Hash-Util-FieldHash">gory details of field hashes</a> but it comes down to this: in 5.10 you can A) get a process unique, thread safe identifier for an object and B) you can store it in hash such that it gets destroyed when the object is destroyed. Perfect!</p><p>Because of this, if you look inside Object::ID you'll see there's not a lot to it. It makes a field hash to store the IDs in, a state variable to hold an ID counter, and then just accesses the field hash.</p><blockquote><div><p> <tt>use Hash::Util::FieldHash qw(fieldhash);<br>fieldhash(my %IDs);<br> &nbsp; <br>sub object_id {<br>&nbsp; &nbsp; my $self = shift;<br> &nbsp; <br>&nbsp; &nbsp; state $last_id = "a";<br> &nbsp; <br>&nbsp; &nbsp; return $IDs{$self}<nobr> <wbr></nobr>//= ++$last_id;<br>}</tt></p></div> </blockquote><p>No scary black magic (beyond what's inside fieldhash). Its so simple, which is why it works with everything.</p><p>Now, I didn't come up with this implementation. I just laid out the requirements and <a href="http://profvince.com/">Vincent Pit</a> filled in the blanks. I was only vaguely aware of field hashes, Vincent made the connection. Thank you VPIT!</p><p>Practical applications? Honestly, I'm not sure. I needed it as a shortcut for expensive object equality checks in perl5i. Maybe some of the OO theorists out there can fill this part in. Let me know what you might use it for.</p><p>Possible extensions? Well... with some tweaking Object::ID can be used as a universal object registry. Not only can you ask "does the object associated with this ID still exist" but field hashes provide the ability to get the object associated with an ID. It would only work on objects that have had their ID asked of them, and thus registered with the field hash, but how else would you have the ID? Is this useful? Is this a security hole? I dunno, but it would be easy.</p> schwern 2010-05-02T17:17:01+00:00 journal Perl 6 Design Minutes for 28 April 2010 http://use.perl.org/~chromatic/journal/40338?from=rss <p>The Perl 6 design team met by phone on 28 April 2010. Larry, Allison, Jerry, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>caught up on a week's worth of backlog</li><li>made a few spec tweaks</li><li>discussed them with other people</li><li>trying to make error messages more awesome in STD</li><li>working on the ability to parse the insides of character classes</li><li>STD doesn't like parsing itself recursively there</li><li>need to iron out a few things</li><li>enum names can now be variables</li></ul><p> <strong>Allison:</strong> </p><ul> <li>Debian packages ready to ship to Debian sponsors</li><li>putting together a list of GC tasks</li><li>cleaned out the existing page, have the big things listed</li><li>trying to decide which tasks to do first</li><li>doing a lot of reading and research</li><li>my little language project is due on Monday</li><li>HLLCompiler was enormously useful</li><li>will start working on the GC stuff next week</li><li>should also start a fresh pass through the ticket queue</li><li>added a workaround for the final remaining TT #389 bug</li><li>Jonathan had a test case</li></ul><p> <strong>Will:</strong> </p><ul> <li>tried to focus on getting Rakudo blockers removed</li></ul><p> <strong>c:</strong> </p><ul> <li>spent some time getting Rakudo to work with trunk</li><li>will need a Rakudo guts hacker for the last part</li><li>worked on the compact_string revamp branch with Vasily</li><li>merged now</li><li>that makes trunk about 12% faster than the 2.3.0 release</li><li>will work on a few Rakudo profiles once it works with trunk again</li><li>expect at least a 5% performance improvement there</li><li>have some other ideas, but won't do them without profiling first</li><li>came up with a scheme to reduce PBC size by coalescing strings</li><li>Peter Lobsinger is exploring that</li></ul> chromatic 2010-05-02T00:27:42+00:00 journal Perl 6 Design Minutes for 21 April 2010 http://use.perl.org/~chromatic/journal/40332?from=rss <p>The Perl 6 design team met by phone on 21 April 2010. Larry, Allison, Patrick, Will, Jerry, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>been under the weather, so didn't get much done other than keeping up with questions</li><li>S05 now allows negative quantifier ranges on reversible patterns</li><li>S02 now defines the term <code>now</code> to return the current instant</li><li>like <code>rand</code> and <code>self</code>, it does not parse as a function, since it never takes arguments</li><li>we now specify what kinds of math are allowed on instants and durations</li><li>improved error message on attempt to use old-school backreferences in regexes</li><li>STD now implements the <code>now</code> term and several other time-related names</li><li>we now allow enum names to be "constant variables" so that a class enum can declare an accessor</li><li>thinking alot about a better unification of the semantics of protos</li><li>this may also solve the current ambiguity in the meaning of postfix parens</li><li>in any case, this is for post Rakudo *</li></ul><p> <strong>Allison:</strong> </p><ul> <li>mainly worked on packaging for Debian and Ubuntu before the release</li><li>closed TT #389, no methods in namespaces</li><li>collecting thoughts on what we need next from the GC</li><li>we've done a lot of small cleanups</li><li>now we need to solve some persistent problems</li><li>might need to make some fundamental changes, like reducing copying</li><li>coming up on my final week of classes, so lots of work there coming up</li></ul><p> <strong>Will:</strong> </p><ul> <li>updated a spectest</li><li>minor ticket wrangling in Rakudo's RT queue</li></ul><p> <strong>Jerry:</strong> </p><ul> <li>GSoC will make its acceptance announcements soon</li><li>expect TPF will get 10 slots</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>reviewing Rakudo's current state</li><li>made a couple of minor NQP patches</li><li>reviewing patches, especially from Moritz and Bruce Keeler</li><li>should check them in, probably with some refactorings</li><li>hope to work on the <code>List</code> implementation, especially laziness and context</li></ul><p> <strong>c:</strong> </p><ul> <li>fixed as much of line numbering as I found broken</li><li>working on branch merges</li><li>still looking at optimizations</li><li>will focus most energy this month on the sweep-free GC</li><li>hope to encourage other people to work on identified optimizations</li><li>will review Solomon Foster's Mandlebrot example, especially with regard to performance</li></ul> chromatic 2010-04-28T22:20:35+00:00 journal Perl 6 Design Minutes for 14 April 2010 http://use.perl.org/~chromatic/journal/40318?from=rss <p>The Perl 6 design team met by phone on 14 April 2010. Larry, Allison, Patrick, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>on p6l, did a bit of bikeshed paint removal with regard to hyphens vs underscores</li><li>S02 now explicitly disallows both whitespace and unspace in top level of an interpolation</li><li>per spec change, when STD is parsing an interpolation inside quotes and looking for a possible postfix, we now presume that a backslash belongs to the quotes and is not an unspace</li><li>in the src/perl6 directory, renamed all Perl 6<nobr> <wbr></nobr><code>.pm</code> files to<nobr> <wbr></nobr><code>.pm6</code> to avoid confusion</li><li>this was necessary because the implementation of STD translates Perl 6 back to the corresponding Perl 5</li><li>the ambiguity was causing problems with tools such as <code>NYTProf</code> </li><li> <code>Cursor.pmc</code> now prefers<nobr> <wbr></nobr><code>.pm6</code> over<nobr> <wbr></nobr><code>.pm</code> in any particular directory when searching for Perl 6 code</li><li>as usual lately, most of my hacking work was in improving the human interface of the parser</li><li>STD now distinguishes two final messages: "<code>Parse failed</code>" vs "<code>Check failed</code>"</li><li>STD now warns on attempts to smartmatch with <code>True</code> or <code>False</code> </li><li>STD now distinguishes continuable-but-fatal "sorry" messages from immediately fatal "panic" messages</li><li>sorry messages will eventually fail at check time</li><li>changed many of STD's semantic errors to use sorry messages when the parse state is not affected</li><li>modified moritz++'s conflict marker patch to be more like the Clang compiler's behavior</li><li>conflict markers now emit a "sorry" message and continues parsing one side of the conflict</li><li>also fixed a buglet that prevented it from processing the conflict marker if first thing in the file</li><li>while fixing the vws (vertical white space) rule for that, also changed it so that extra lines are now eaten with <code>\V*\v</code> for consistency</li><li>it had be using <code>\N*\v</code> </li><li>gimme5 now supports pointing to both ends of missing goal message</li><li>STD's "<code>Couldn't find final<nobr> <wbr></nobr>...</code>" messages now use that capability to point to both ends of the error</li><li>standard quotes now also use the ~ compositor to set the goal and get that behavior</li><li>STD will now dwim <code>&lt;&lt;op&gt;&gt;</code> ("Texas hypers") better even if <code>op</code> contains angles</li><li>suppressed confusing backtracking on <code>~&lt;&lt;</code> that produced a misleading quotewords error</li><li>some other patches</li><li>CORE.setting now recognizes the '<code>note</code>' function</li><li>gimme5 now translates <code>note</code> to <code>print STDERR</code> </li><li>cleaned up some unneeded locmesses</li><li>Actions.pm now handles prefix metaops without spewing spurious yaml dumps</li></ul><p> <strong>Allison:</strong> </p><ul> <li>worked on TT #389</li><li>the actual fix was about two lines</li><li>spent a lot of time fixing tests around it</li><li>didn't like the original two-line fix</li><li>fixed it in IMCC by passing along the<nobr> <wbr></nobr><code>:nsentry</code> flag</li><li>NQP-rx still depends on that feature</li><li>I understood from Patrick that NQP-rx doesn't need that feature</li><li>don't want to launch that before the 2.3 release</li><li>worked on a lot of smaller issues</li><li>worked on the Parrot Developer Virtual Summit</li><li>will talk about some process changes more, as there are details to work out</li><li>will work on GC as the next priority</li><li>useful for Rakudo in general and Parrot concurrency</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>catching up on mail and tickets</li><li>should get back to coding in the next couple of days</li></ul><p> <strong>c:</strong> </p><ul> <li>worked on the immutable strings branch</li><li>need a couple of changes in the Rakudo binder</li><li>now it's time to convince everyone else it's a worthwhile design change</li><li>going to work on bugfixes</li><li>will try to land the constant string cache</li><li>otherwise, added some optimizations</li></ul><p> <strong>Will:</strong> </p><ul> <li>worked on Partcl</li><li>fixed a Parrot bug that broke Rakudo</li><li>does Rakudo need TT #389 in 2.3?</li></ul> chromatic 2010-04-21T04:09:26+00:00 journal Perl 6 Design Minutes for 07 April 2010 http://use.perl.org/~chromatic/journal/40306?from=rss <p>The Perl 6 design team met by phone on 07 April 2010. Larry, Allison, Patrick, Jerry, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>clarified that object identity from <code>WHICH</code> may not be a mundane value type</li><li>instead object id's are of type <code>ObjAt</code> to avoid type name collisions.</li><li>rewrote misleading description of "thunk"</li><li>made some clarifications of the desired semantics of buffers</li><li>Buf is primarily a role for dealing compact, unsigned integer arrays in a stringy way</li><li>but a Buf may be instantiated with other numeric types as well.</li><li>removed bogus mentions of Buf8, Buf16, Buf32; only the native buf types are sized that way</li><li>STD now actually parses the insides of <code>tr///</code> and carps about malformed ranges</li><li>labels are now stored symbolically as constants rather than types</li><li>so no coercion routine is added for the name, so it doesn't collide with the function namespace</li><li>labels are now constants with a unique label type to prevent confusion with ordinary constants</li><li>module subcompilation now reports the name of the file it's compiling</li><li>improved various error messages regarding <code>foreach</code>, <code>!!op</code>, <code>$!{}</code>, <code>EOF</code>, and missing punctuation after blocks</li></ul><p> <strong>Allison:</strong> </p><ul> <li>worked on line number reporting in HLLs</li><li>no ticket to go on, no good examples</li><li>didn't make much progress, but didn't have much time</li><li>sounds like Christoph and chromatic are working on it</li><li>might look at TT #389</li></ul><p> <strong>c:</strong> </p><ul> <li>you're welcome to it!</li><li>let me know if you have questions; it's close</li></ul><p> <strong>Allison:</strong> </p><ul> <li>no travel plans for the next couple of months</li><li>should have a lot more Parrot time</li><li>probably time to consider another big project</li><li>probably GC related</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>updated the progress graph last night</li><li>up to date as of yesterday</li><li>Rakudo's passing over 30,000 tests, which is great</li></ul><p> <strong>Jerry:</strong> </p><ul> <li>we have 27 mentors signed up for GSoC</li><li>a dozen student proposals have come in</li><li>the admission period ends Friday, so I expect at least a handful more</li><li>looks like a good year for proposals</li><li>trying to keep on track of Rakudo development</li><li>trying to be a go-between for Rakudo and Parrot</li><li>seems like it's helping Rakudo as Parrot addresses issues that come up</li></ul><p> <strong>c:</strong> </p><ul> <li>Vasily and I fixed the Rakudo performance regression</li><li>we're going to experiment with immutable strings in a branch</li><li>expect some notable performance improvements there</li><li>also worked on the plan to fix line number reporting</li><li>need a test harness to help identify problems and avoid regressions</li><li>learned my lesson last time I worked on that....</li></ul><p> <strong>Larry:</strong> </p><ul> <li>I cringe every time I hear "line numbers"</li><li>I like what Clang does about highlighting the arguments to functions</li><li>it'd be nice if we can do similar</li></ul><p> <strong>c:</strong> </p><ul> <li>that'd require more changes to Parrot, but it's doable</li></ul><p> <strong>Larry:</strong> </p><ul> <li>I just want people to bear it in mind</li></ul><p> <strong>Allison:</strong> </p><ul> <li>there's no reason we can't have richer annotations</li><li>our first step is making sure the information we provide them (or they ask for) is accurate</li><li>is it time to have another big development meeting for Parrot?</li><li>the release is coming up</li></ul><p> <strong>Jerry:</strong> </p><ul> <li>sounds good</li></ul> chromatic 2010-04-09T22:07:25+00:00 journal Perl 6 Design Minutes for 31 March 2010 http://use.perl.org/~chromatic/journal/40296?from=rss <p>The Perl 6 design team met by phone on 31 March 2010. Larry, Allison, Patrick, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>in SpecLand, made it clear that the brackets in pairs are not related to subscripts, but follow the corresponding fatarrow semantics</li><li>in particular, name extenders are just strings or list of strings, properly indicated by : or<nobr> <wbr></nobr>:() in most cases (this includes all operator names).</li><li>we now forbid name extension using the<nobr> <wbr></nobr><code>:{}</code> keyless adverbial syntax</li><li>we don't need that because name extensions are really only supposed to use values, not closures</li><li>if we really, really, need to supply a closure as part of a name extension, we can put it in parens, as in<nobr> <wbr></nobr><code>:({})</code>.</li><li>we can use that notation for supplying a closure as a first argument to a method without requiring a space between the colon and the curly, as in<nobr> <wbr></nobr><code>.map:{...}</code> </li><li>people keep writing that and expecting it to work, so I thought it would be good to make it work</li><li>the colon is still require before the curlies, or it's a hash subscript</li><li>we now capitalize the <code>Junction</code> type again because I couldn't get people to stop capitalizing it</li><li>also, the native aspect of junctions is not their most salient difference from normal types</li><li>conjectured an <code>Each</code> type that autothreads lists like junctions, but is serial and lazy, and is used for its values in list context, not boolean context</li><li>in S05, did much cleanup of cursor semantics to reflect what STD and Rakudo actually do these days</li><li>retargeted the <code>&lt;&amp;foo&gt;</code> regex assertion form to explicitly call a routine, just like <code>&lt;.foo&gt;</code> always calls a method</li><li>a bare <code>&lt;foo&gt;</code> assertion now prefers to call a lexical function if visible, or calls as a method in current grammar if not</li><li>this is a compile-time distinction, not a fallback at run time</li><li>in code hacking, continued debugging of the backtracking transactions I added last week</li><li> <code>gimme5</code> now sets the correct xact on <code>||</code> alternations</li><li>deleted more of the transactions that are no longer needed when building match results that are no longer hypothetical</li><li>a <code>LazyMap</code> now always passes through the first result regardless of its associated commit transaction state</li><li>that's because the first cursor in a lazy list always represents the current match hypothesis, not a future hypothesis that needs pruning</li><li>STD now parses to the new specs regarding name extensions not including<nobr> <wbr></nobr><code>:{}</code> </li><li>now allow colon form of method arguments to omit the space if the next char is a left curly, which is what people seem to expect anyway</li><li>note that this makes the closure the first argument, not the only argument</li><li>STD now gives more useful error messages when user says things like 'if' as a function call (<code>if(...) {...}</code>), or a statement control like 'given' where one isn't expected (<code>$x = given {...}</code>)</li><li>STD now properly objects to unrecognized internal regex modifiers such as<nobr> <wbr></nobr><code>:has</code> </li><li>improved the message on adverbs with empty angles (<code>:foo&lt;&gt;</code>) to list some better options</li><li>the problem arises when people think that the angles produce a null string, when in fact they produce a <code>Nil</code> list</li><li>other malformed pairs are also better diagnosed, such as<nobr> <wbr></nobr><code>:!</code> not followed by an identifier, or pairs with duplicate arguments</li><li>added a new rule that traps all warnings and errors</li><li>STD now uses <code>suppose</code> in place of custom try blocks in diagnosing such things as two terms in a row, or unexpected infixes</li><li>also uses <code>suppose</code> to soften the warning about backtick-less embedded comments by not complaining if the supposed comment eats the whole line anyway</li><li>put in some code to de-dup identical warnings</li><li>STD now includes the signature's return type (after <code>--&gt;</code>) in the check for redundant '<code>of</code>' types</li><li>did various tiny speed tweaks, fossil removals</li><li>started playing with how to mark sink context and pure operations</li><li>split out <code>Actions.pm</code> from <code>viv</code> so that it can be used by other STD-based AST builders</li><li>this is in preparation for propagating attributes up and down the AST such as sink context and purity</li><li>eventually this will result in "Useless use of" messages where appropriate, not to mention the ability to do constant folding</li></ul><p> <strong>Allison:</strong> </p><ul> <li>worked on the <code>compact_pool()</code> function</li><li>split it into a series of smaller functions</li><li>it could use more work, but it's an improvement</li><li>found one possible bug</li><li>worked on some documentation, especially for PMC attributes</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>reviewed some patches to add variable handling in regexes</li><li>they need some changes, but the overall concept is good</li><li>reviewed a few other messages</li><li>most of my time is going toward my family</li><li>hope to get more time to be more active in the next couple of days, but I can't promise that yet</li></ul><p> <strong>Will:</strong> </p><ul> <li>talked to Jonathan about Rakudo Star priorities</li><li>he's very pleased with the memory fixes</li><li>the next thing on his list is getting good line numbers in reported errors</li><li>closing tickets</li><li>working to get rid of the last recursive Makefile</li><li>may wait until after the new release, when we remove a lot of deprecated things</li><li>practicing my NQP skills by working on Tcl again</li></ul><p> <strong>c:</strong> </p><ul> <li>worked on the Rakudo memory problems</li><li>Vasily and I fixed the big memory use problem</li><li>still some performance tuning to do there</li><li>wrote up tasklists for two other important performance pieces</li><li>will work on line numbers after we get performance back</li></ul> chromatic 2010-04-05T04:42:21+00:00 journal OMG UNICORNIFY::URL!!! &lt;3 http://use.perl.org/~schwern/journal/40289?from=rss <p><a href="http://unicornify.appspot.com/avatar/e55e0ec3c00f834d78fbdddeaa36e308?s=128">OMG! A UNICORN PONY FOR MEEEE!!!</a></p><p>You can get 1 2 wth <a href="http://github.com/schwern/gravatar-url/blob/master/lib/Unicornify/URL.pm">Unicornify::URL</a>!! Here's a program to do it at the command line.</p><blockquote><div><p> <tt>use Acme::Pony;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bUf<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fybuf<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FyBuFFYbU<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FfyBUFfYbUff<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; YBuffybuFfyBuF<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fYbUffYBUfFYbUff<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; YbUFfYBuffYBuFFYBu<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FFybUffYBUffYBUfFYb<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UffYbUFfyBUffYBuFfyB<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UFFybUfFYBuffYbUFF<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ybUfFyBuFfyBufFy<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BuffYBufFyBUfFYB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uffY<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bUffybuffyBUFfyBuf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FYBuFfy<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BuFFybUFFyBUffyBuFFYbuffybUf&nbsp; &nbsp;fYbUfFYBu<br>&nbsp; &nbsp; fFYB&nbsp; &nbsp;uFFyBufFyBUfFYbufFYbUFFYbUFfyBufFYBufFYBu<br>&nbsp; &nbsp;FFyBufFyBUffYBufFYbUffYBUFfYBUFFyBuFfYbUFFybUffYBU<br> &nbsp; ffyBU fFYbuffYbUffybuffYbuFfYbuFFyBuFFyBUfFybufFYbUf<br>fYbUF&nbsp; &nbsp; &nbsp;fybUFfYBuffybuFfyBuFFYBuffYBUFFybuffybUffYBu<br>&nbsp; fFYBuf&nbsp; &nbsp; fyBuFFyBufFyBUffYBufFYbufFyBUFfybUFfYbuffyb<br>&nbsp; &nbsp;uFfyB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UffYBUfFybUfFYbuFfYBUFfYbUffYBuffybuFf<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;yBuFFY&nbsp; &nbsp; &nbsp;BuffYBUFFybuffybUffYbufFYb<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ufFyb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UFfybufFYBuffybufFyb<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UffYb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UffybUFfY buffybuF<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fybUf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fyBuffy BUFfYbuF<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FYbUF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fyBuffYbuFFyBUFf<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ybUf&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Fybu&nbsp; ffYb UffybuF<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fYbu&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ffYB&nbsp; UFFy&nbsp; BuFFYB<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UfFy&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BuF&nbsp; &nbsp;fybU&nbsp; &nbsp;ffYB<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Uff&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Ybu<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fFyb&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uFf<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; YBUF<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; F<br> &nbsp; <br>yBuFFYBUfFy</tt></p></div> </blockquote><p>&lt;3 k thx bye!!1!11!!!</p> schwern 2010-04-01T22:51:34+00:00 journal Perl 6 Design Minutes for 24 March 2010 http://use.perl.org/~chromatic/journal/40284?from=rss <p>The Perl 6 design team met by phone on 24 March 2010. Larry, Allison, Patrick, Jerry, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>clarified that nearly all normal operators autothread, including <code>===</code> and <code>eqv</code> </li><li>specced the <code>\|</code> parcel parameter syntax</li><li>documented that <code>R</code> metaoperator does not change associativity</li><li>clarified that <code>trusts</code> traits do not extend to child classes, and moritz++ specced it</li><li>in STD, we now suppress spurious errors from badinfix lookahead (and react more accurately to bogus terms)</li><li>now put the error location pointer before a bad infix, not after</li><li>we no longer assume missing block punctuation is always semi or comma, but keep them as a suggestion</li><li>missing punctuation message now points before any whitespace</li><li>awesomified error message about no unspace in regexes to explain how to quote space or <code>#</code> </li><li>pass single coeff to <code>radcalc</code> to make<nobr> <wbr></nobr><code>:16&lt;.BABEFACE&gt;</code> easier to allow</li><li>gives better message on missing <code>**</code> part of radix literals</li><li>worked around fact that<nobr> <wbr></nobr><code>::</code> doesn't correctly suppress relexing of multi tokens</li><li>scrapped the workaround and did a complete refactor of commit point transactions; no longer uses exceptions to commit</li><li>instead, it walks the current commit chain to the proper commit target to disable choosers that should not choose any more options</li><li>commit chain aliasing and forking to make a cactus stack is now managed by cursors, mostly transparently</li><li>weighed in on the subject of stability domains (or lack thereof) in Rakudo *</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>still working on personal issues, but hope to have some resolution by Saturday</li><li>haven't had much time to work on Rakudo, but show up on #perl6 to give advice sometimes</li><li>read Larry's email to the list; it was very helpful</li></ul><p> <strong>Allison:</strong> </p><ul> <li>met some interesting people at SxSW doing open source education technology</li><li>reviewing the roadmap</li><li>the GC sounds like the most important thing to work on next</li><li>trying to catch up from having spotty network access lately</li></ul><p> <strong>Jerry:</strong> </p><ul> <li>the other Rakudo developers have started weekly planning meetings</li><li>Jonathan has taken the lead</li><li>plenty of contributors are in the meeting and offered to take on new tasks</li><li>Rakudo Star may have a smaller scope, but it'll still come out in Q2</li><li>it's nice to see that the Rakudo community continues even as Patrick has an extended absence</li><li>still some Parrot issues affecting Rakudo</li><li>PaFo hopes to have its 501(c)3 application done by summer</li></ul><p> <strong>c:</strong> </p><ul> <li>bugfixes</li><li>minor optimizations</li><li>helped merge the PCC refactor branch</li><li>working on Rakudo memory issues (long analysis follows, partly Parrot GC and partly NQP behavior)</li></ul> chromatic 2010-03-31T21:20:11+00:00 journal Perl 6 Design Minutes for 17 March 2010 http://use.perl.org/~chromatic/journal/40283?from=rss <p>The Perl 6 design team met by phone on 17 March 2010. Larry, Allison, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>documented which ops don't autoclose with <code>*</code>, including assignment</li><li>conjectured a generalization of the closure-calling context (value-only lists) that subscripts enforce</li><li>this generalization might allow the autoclosing of some of the current exceptions such as <code>1..*</code> </li><li>added <code>Z</code> to go with <code>X</code> metaop; documented that <code>X</code> and <code>Z</code> desugar to higher-order methods, <code>crosswith</code> and <code>zipwith</code> </li><li>speculate about how to <code>zip</code>/<code>cross</code> dwimmily with non-identical ops; possibly creating a real use case for surreal precedence</li><li>however, for now sticking with conservative approach of requiring parens on differing list infixes</li><li>hacking on <code>viv</code> again</li><li>trying to get that bootstrapped, so I don't have to use <code>gimme5</code> </li><li>unbitrotted <code>viv --p6</code> so it exactly reproduces STD.pm again</li><li>various developments with <code>viv --p5</code> toward replacing <code>gimme5</code> </li><li>should make it easier to emit other parsers eventually</li><li>may emit Rakudo code someday</li><li>it's a race to see whether STD can do that before the current Rakudo parser resyncs with STD</li><li>anyone who wants to bootstrap on some other VM might want to use that</li><li>mostly tired of writing in the subset of Perl 6 that <code>gimme5</code> understands</li><li>mostly hacking on better error messages, as always</li><li>catches use of non-<code>$</code> hard reference</li><li>STD now read minds of people who forget that "<code>.meth</code> I" is a two-terms-in-a-row error</li><li>now produces good messages on attempts to use <code>y///</code> or <code>tr/a-z/A-Z/</code> syntax</li><li>now reports "previous line missing its semicolon" in the unexpected block checker</li><li>ambiguous use of<nobr> <wbr></nobr><code>.</code> probably indicates p5-think, not missing method parens</li><li>STD now has in a <code>q</code>-like sublanguage for <code>tr///</code> string parsing</li><li>implements the <code>MONKEY_TYPING</code> constraint on <code>augment</code> and <code>supersede</code> declarators</li><li>various random cleanups and bugfixes</li><li>added <code>Z</code> metaoperator</li><li>lots of works on regex flags to unify them into a single <code>%*RX</code> structure at parse time</li><li>makes it easier to do all of the lexical scoping in parallel</li><li>can now remap run-time's <code>$?FOO</code> variables to parser's <code>$*FOO</code> dynamic variables</li><li>otherwise, bugfixes, spec cleanup, and test cleanup</li></ul><p> <strong>Allison:</strong> </p><ul> <li>working on tickets</li><li>updating the Parrot roadmap to match our Rakudo Star support plan</li><li>working on the mini-language in NQP for a class assignment</li><li>found a new Pynie developer who saw my talk at Pycon</li><li>may be doing a Summer of Code project in it</li><li>answering lots of questions on IRC and helping out with ideas</li></ul><p> <strong>c:</strong> </p><ul> <li>working on lots of little bugs for Parrot</li><li>should have the method namespace bug fixed, with help from Andrew</li><li>exploring some optimization possibilities</li><li>should be able to merge the PCC refactor shortly</li><li>Allison, see TT #1511</li></ul><p> <strong>Allison:</strong> </p><ul> <li>we need to add a new opcode, something like <code>set_want</code> </li><li>call it to update the CallContext with expected return information</li></ul><p> <strong>c:</strong> </p><ul> <li>works a bit like Perl 5 there</li><li>we could use that information for MMD, that'd be interesting</li></ul> chromatic 2010-03-31T21:17:44+00:00 journal Some Facts About Schwern http://use.perl.org/~schwern/journal/40271?from=rss <p><a href="http://opensourcebridge.org/">Open Source Bridge</a> requested that I improve <a href="http://opensourcebridge.org/users/111">my bio</a>, so I decided to share some facts about myself...</p><blockquote><div><p>Schwern has a copy of Perl 6, he lets Larry Wall borrow it and take notes.</p><p>Schwern once sneezed into a microphone and the text-to-speech conversion was a regex that turns crap into gold.</p><p>Damian Conway and Schwern once had an arm wrestling contest. The superposition still hasn&#8217;t collapsed.</p><p>Schwern was the keynote speaker at the first YAPC::Mars.</p><p>When Schwern runs a smoke test, the fire department is notified.</p><p>Dan Brown analyzed a JAPH Schwern wrote and discovered it contained the Bible.</p><p>Schwern writes Perl code that writes Makefiles that write shell scripts on VMS.</p><p>Schwern does not commit to master, master commits to Schwern.</p><p>SETI broadcast some of Schwern&#8217;s Perl code into space. 8 years later they got a reply thanking them for the improved hyper drive plans.</p><p>Schwern once accidentally typed &#8220;git pull &#8212;hard&#8221; and dragged Github&#8217;s server room 10 miles.</p><p>There are no free namespaces on CPAN, there are just modules Schwern has not written yet.</p><p>Perl's threads are implemented with a single strand of Schwern's hair.</p><p>"Schwern" cmp "Chuck Norris" will cause Perl to segfault rather than try to compare them.</p><p>Schwern&#8217;s tears are said to cure cancer, unfortunately his Perl code gives it right back.</p></div></blockquote> schwern 2010-03-26T03:45:05+00:00 journal Perl 6 Design Minutes for 10 March 2010 http://use.perl.org/~chromatic/journal/40261?from=rss <p>The Perl 6 design team met by phone on 10 March 2010. Larry, Allison, Patrick, Jerry, Will, and chromatic attended.</p><p> <strong>Larry:</strong> </p><ul> <li>scrapped @array[%100_000] modular subscript notation in favor of a more general mapping closure</li><li>put back<nobr> <wbr></nobr><code>:s</code> file test, removed<nobr> <wbr></nobr><code>:z</code>,<nobr> <wbr></nobr><code>:T</code>,<nobr> <wbr></nobr><code>:B</code>,<nobr> <wbr></nobr><code>:M</code>,<nobr> <wbr></nobr><code>:A</code>,<nobr> <wbr></nobr><code>:C</code> </li><li>clarified that these are defined on IO, not on strings</li><li>deprecated the <code>{*}</code> and <code>#=</code> reduction stub notations in grammars</li><li>attributive parameters now default to <code>is copy</code> binding; but easy for an attribute to override this with <code>is ref</code> </li><li>tried to move operator definitions to CORE; found one approach that doesn't work and abandoned it</li><li>STD now allows <code>_</code> in numeric variable names like <code>$10_000</code>.</li><li>factored out curlycheck so we can use it on any trailing curly</li><li> <code>postcircumfix:&lt;{ }&gt;</code> now uses curlycheck for consistency</li><li>STD now speculates missing semicolon when two terms in a row are separated by at least one newline</li><li>removed mention of <code>*.notdef</code> in favor of<nobr> <wbr></nobr><code>:!defined</code> </li><li>still need to remove it from the spec though</li><li>ambiguously rebound outer lexicals now detected even if ambiguity propagates from an inner scope </li><li>reports more pertinent information in that case so the difficulty can be understood by the user</li><li>various random debugger refactorings</li><li>properly scope dynamic package names for block-oriented packages to include name declaration</li><li>package_def of<nobr> <wbr></nobr><code>;</code> packages now eats statementlist itself to stay inside proper scope</li><li>much work on package qualified names</li><li>correctly parse <code>&lt;$x&gt;</code> part of <code>FOO::&lt;$x&gt;</code> as part of variable name</li><li>correctly follow symbolically indirected <code>OUTER::</code> links</li><li> <code>find_top_pkg</code> no longer cares if name ends in<nobr> <wbr></nobr><code>::</code> </li><li>STD now figures out whether initial components lead to package or lexical scope</li><li>no longer scans outer scopes on qualified names</li><li>now handles <code>FOO::&lt;$x&gt;</code> form in <code>check_variable</code> </li><li>no longer checks for <code>@/%</code> mistakes on qualified names</li></ul><p> <strong>Patrick:</strong> </p><ul> <li>haven't had much hacking time lately due to personal demands</li><li>should be able to hack again later today and the rest of the week</li></ul><p> <strong>Allison:</strong> </p><ul> <li>worked on the PCC refactor</li><li>that went well; the hackathon was good</li><li>it didn't pull in a lot of people, but me dedicating the weekend to it was helpful</li><li>also pulled in a few other people willing to try things out</li><li>we made good progress</li><li>our initial task is over</li><li>we're in the nebulous stage of debugging</li><li>need to review a change in optional return values</li><li>also worked on Ubuntu and Debian packaging</li><li>Parrot 2.0 is in both</li><li>it'll be in April's Lucid Lynx Ubuntu</li></ul><p> <strong>Jerry:</strong> </p><ul> <li>Google Summer of Code is starting</li><li>TPF and PaFo are teaming up this year</li><li>we're working on the organization application</li><li>Jonathan Leto is leading things and I'm backing him up</li><li>we're looking for mentors and ideas; see the <a href="http://www.perlfoundation.org/perl5/index.cgi?gsoc">TPF GSoC wiki page</a> </li></ul><p> <strong>Will:</strong> </p><ul> <li>started going through Rakudo's RT queue</li><li>did more Parrot building and cleanup work</li><li>no longer invoking Perl to invoke the C compiler for each build file</li><li>shaved some time off the build</li><li>eliminated one recursive make, leaving two</li><li>then I can remove more things from config</li></ul><p> <strong>c:</strong> </p><ul> <li>worked on a bunch of branches</li><li>fixed a couple of bugs</li><li>hope to get more bug fixing time in</li></ul> chromatic 2010-03-23T01:37:49+00:00 journal