<?xml version="1.0"?>
<rss version="2.0.">
  <channel>
    <title>Advogato blog for chromatic</title>
    <link>http://www.advogato.org/person/chromatic/</link>
    <description>Advogato blog for chromatic</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Wed, 14 May 2008 03:21:51 GMT</pubDate>
    <item>
      <pubDate>Wed, 14 May 2008 03:13:14 GMT</pubDate>
      <title>Windows Patches Welcome; Windows Attitude Not</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=321</link>
      <guid>http://use.perl.org/~chromatic/journal/36411?from=rss</guid>
      <description>&lt;summary type="xhtml"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;I just &lt;em&gt;love&lt;/em&gt; hearing "&lt;a href="http://perlmonks.org/?node_id=686127" &gt;You're doing it wrong, and you're not doing enough because you don't care about exactly the same things I care about.  Also you have a bad attitude.&lt;/a&gt;"&lt;/p&gt;&lt;/div&gt;&lt;/summary&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 14 May 2008 03:13:14 GMT</pubDate>
      <title>Going Faster By Doing Less Work</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=320</link>
      <guid>http://use.perl.org/~chromatic/journal/36410?from=rss</guid>
      <description>&lt;summary type="xhtml"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;Today's Rakudo-building speedup is 27.79%.&lt;/p&gt;&lt;p&gt;(Okay, the other slow part of Rakudo builds 17.59% faster.  Still.)&lt;/p&gt;&lt;p&gt;The profile showed that string allocation was a hotspot in the benchmark.  In particular, the part of Parrot which allocates memory out of arenas spent a lot of time performing garbage collection.  Every time you can avoid either allocating unnecessary memory or running a full garbage collection, you can improve performance.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.parrotvm.org/svn/parrot/revision?rev=27484" &gt;Parrot r27484&lt;/a&gt; adds one line of code (and one line of comment).&lt;/p&gt;&lt;p&gt;Every time &lt;code&gt;mem_allocate()&lt;/code&gt; successfully allocates a new block, it increments a counter.  Whenever the garbage collector performs a full run, it resets that counter to zero.&lt;/p&gt;&lt;p&gt;This patch performs a garbage collection run from &lt;code&gt;mem_allocate()&lt;/code&gt; only if that counter is non-zero.  That is, if the garbage collector has already run, it's already found as much free arena memory as possible.  (This is not memory for PMCs or STRING headers; this is buffer memory.)  Running the GC again won't find any more free buffer memory.  In that case, skipping the GC run and allocating more memory from the OS gives the performance improvement.&lt;/p&gt;&lt;p&gt;I should note that my comments about avoiding memory allocation apply in the general case.  Parrot's current GC has some limitations.  The biggest is that it stops the world to mark and sweep everything.  The new GC Andrew Whitworth will implement as part of the Google Summer of Code will fix that.  As well, we have some ideas to improve the implementation such that the GC will become even less expensive now.  Then we'll see algorithmic improvements that make even this 27.79% optimization seem small.&lt;/p&gt;&lt;/div&gt;&lt;/summary&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 10 May 2008 08:11:13 GMT</pubDate>
      <title>Doing Nothing Better in Perl 5</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=319</link>
      <guid>http://use.perl.org/~chromatic/journal/36374?from=rss</guid>
      <description>&lt;p&gt;Perl 6 has three code placeholder operators, known affectionately as the "yada, yada, yada" operator (see &lt;a href="http://dev.perl.org/perl6/doc/design/syn/S03.html#List_prefix_precedence" &gt;List Prefix Precedence in Synopsis 3&lt;/a&gt;).  It's a matter of (very sarcastic) public record how much I &lt;em&gt;love&lt;/em&gt; writing, maintaining, and patching parsers, so I've just sent a very preliminary five-line patch to p5p to add support for&lt;nobr&gt; &lt;wbr&gt;&lt;/nobr&gt;&lt;code&gt;...&lt;/code&gt; to Perl 5.&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt; &lt;div&gt;&lt;tt&gt;--- perly.y~&amp;nbsp; &amp;nbsp; 2008-05-09 17:47:35.000000000 -0700&lt;br&gt;+++ perly.y&amp;nbsp; &amp;nbsp; 2008-05-09 17:47:41.000000000 -0700&lt;br&gt;@@ -1227,6 +1227,11 @@&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; WORD&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; listop&lt;br&gt;+&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; DOTDOT&lt;br&gt;+&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br&gt;+&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $$ = newUNOP(OP_DIE, 0,&lt;br&gt;+&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")))&lt;br&gt;+&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;;&lt;br&gt; &lt;br&gt;&lt;nobr&gt; &lt;wbr&gt;&lt;/nobr&gt;/* "my" declarations, with optional attributes */&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;Apply this to recentish bleadperl sources, run &lt;code&gt;perl regen_perly.pl&lt;/code&gt;, rebuild, and now you can run programs such as:&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt; &lt;div&gt;&lt;tt&gt;sub foo {&lt;nobr&gt; &lt;wbr&gt;&lt;/nobr&gt;... }&lt;br&gt;foo();&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;And get an "Unimplemented at &lt;em&gt;file&lt;/em&gt; line &lt;em&gt;line&lt;/em&gt;." error message.&lt;/p&gt;

&lt;p&gt;(Now everyone who complains that I don't code enough to match my talk, please punch yourself in the face.)&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Fri, 9 May 2008 03:13:19 GMT</pubDate>
      <title>Perl 6 Design Minutes for 07 May 2008</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=318</link>
      <guid>http://use.perl.org/~chromatic/journal/36363?from=rss</guid>
      <description>&lt;summary type="xhtml"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;The Perl 6 design team met by phone on 07 May 2008.  Larry, Allison,
Patrick, Will, Jerry, Nicholas, Jesse, and chromatic attended.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Allison:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;spent my time this week slicing and dicing the exceptions implementation&lt;/li&gt;&lt;li&gt;replaced the old internals with the new system&lt;/li&gt;&lt;li&gt;checked that in yesterday&lt;/li&gt;&lt;li&gt;still a few failing tests in edge cases on the branch&lt;/li&gt;&lt;li&gt;did more work on the Parrot Foundation&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;c:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I own an acre of Mars, we could incorporate there&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Allison:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;don't you own a cow in the Philippines?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;c:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;yes, but that doesn't give me any governmental powers&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;isn't that worth a lot?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;c:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;the peso &lt;em&gt;is&lt;/em&gt; improving against the dollar&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;moving on...&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Larry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;clear bill of health from my medical reports&lt;/li&gt;&lt;li&gt;hacking a lot against the standard grammar in my STD5 implementation&lt;/li&gt;&lt;li&gt;lots of refactoring&lt;/li&gt;&lt;li&gt;all of the various parameters that used to go through separately now go through as part of the Match object&lt;/li&gt;&lt;li&gt;including the "fate" and whether we're peeking at the longest token set&lt;/li&gt;&lt;li&gt;the longest token matcher works now&lt;/li&gt;&lt;li&gt;I threw out my old mechanism for gathering Match objects&lt;/li&gt;&lt;li&gt;it now creates the more-or-less correctly&lt;/li&gt;&lt;li&gt;lots of grammar tweaks, as suggested by Mitchell Charity&lt;/li&gt;&lt;li&gt;lots of refactoring of how logging works so that it doesn't always spew enormous quantities of information to the screen&lt;/li&gt;&lt;li&gt;I can actually run the parser quite quickly now, for some definition of quickly that approximates 2000 characters per second&lt;/li&gt;&lt;li&gt;matches symbols directly, rather than calling a rule, which is faster&lt;/li&gt;&lt;li&gt;does the backoff now on longest token matching&lt;/li&gt;&lt;li&gt;started refactoring the grammar on the assumption that I cna trust the longest token matcher&lt;/li&gt;&lt;li&gt;no longer any &lt;code&gt;nofat&lt;/code&gt; rule&lt;/li&gt;&lt;li&gt;the longest token should match the fat arrow, if there is one&lt;/li&gt;&lt;li&gt;started refactoring the quoting rules to parse as if they were sublanguages&lt;/li&gt;&lt;li&gt;getting rid of extra rigamarole to recreate the other mechanism we already use for other languages&lt;/li&gt;&lt;li&gt;working out the linkage for switching in and out of sublanguages&lt;/li&gt;&lt;li&gt;how to get to the outer language from the inner language&lt;/li&gt;&lt;li&gt;calling into pure Perl from closures in a regex&lt;/li&gt;&lt;li&gt;or the host language if you're calling the regex from another language&lt;/li&gt;&lt;li&gt;nailed down the available methods for Match objects in the specs&lt;/li&gt;&lt;li&gt;giving a talk in Seattle on Friday at SPU&lt;/li&gt;&lt;li&gt;flying to Japan on Saturday&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;spent a lot of time teaching this past week&lt;/li&gt;&lt;li&gt;cleared up now&lt;/li&gt;&lt;li&gt;mostly I've answered questions on mailing lists and IRC&lt;/li&gt;&lt;li&gt;I'm not always sure that I'm helpful, but I'm there&lt;/li&gt;&lt;li&gt;yesterday I worked on trying to get a bunch of little small things here and there&lt;/li&gt;&lt;li&gt;fixed up a few things in PCT internals&lt;/li&gt;&lt;li&gt;today I'm bringing PGE up to date with some of the latest changes in S05&lt;/li&gt;&lt;li&gt;these all help Rakudo and other languages in small ways&lt;/li&gt;&lt;li&gt;trying to clean out my backlog and clean up a bunch of RT tickets&lt;/li&gt;&lt;li&gt;I'll continue over the next couple of days&lt;/li&gt;&lt;li&gt;and blogging about it as I go&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jerry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;things are busy, mostly non-Parrot related stuff&lt;/li&gt;&lt;li&gt;submitted a ticket that I hope Patrick can close today&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;many languages depend on the old behavior, including Plumhead&lt;/li&gt;&lt;li&gt;I'm not certain about some of them&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jerry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;mostly otherwise answering questions on #parrot&lt;/li&gt;&lt;li&gt;making sure that things are set up for the real work phase of GSoC&lt;/li&gt;&lt;li&gt;making sure that students have their CLAs, if not commit bits&lt;/li&gt;&lt;li&gt;astonished to see how much work Jonathan is getting done in just two funded days&lt;/li&gt;&lt;li&gt;it's amazing to see how much a motivator money can be&lt;/li&gt;&lt;li&gt;I'd like to see more of it, &lt;em&gt;hint hint&lt;/em&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;c:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;working on closing as many open Parrot bugs as possible&lt;/li&gt;&lt;li&gt;applying as many open patches as possible&lt;/li&gt;&lt;li&gt;should be able to help on the concurrency branch soon&lt;/li&gt;&lt;li&gt;otherwise preparing for the release&lt;/li&gt;&lt;li&gt;going to check on received CLAs this week&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Nicholas:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;found it curious that Perl 5.10 has the best &lt;code&gt;state&lt;/code&gt; implementation of any language&lt;/li&gt;&lt;li&gt;wanted to steal tests from another implementation&lt;/li&gt;&lt;li&gt;had a discussion with Leon about SMOP&lt;/li&gt;&lt;li&gt;there's no real description of how all of these implementations fit together&lt;/li&gt;&lt;li&gt;Rakudo plus Parrot is a complete implementation&lt;/li&gt;&lt;li&gt;SMOP and kp6 fit together nicely&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I started a wiki page on the Perl 6 wiki at Perl_6_Implementations&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I don't know that it says how things fit together&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I tried to encourage other people to contribute stuff&lt;/li&gt;&lt;li&gt;didn't get much uptake&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Nicholas:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;should we suggest to Daniel that he should help explain things?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;that's more likely to get people contributing to it&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Will:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;there's definitely some confusion about it within the Grants Committee&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jerry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;SMOP has the highest documentation-to-line-of-code ratio of any implementation&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;it needs a good overview though&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Nicholas:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I'll ask Daniel to explain more&lt;/li&gt;&lt;li&gt;especially its relationship to Parrot and Rakudo&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jerry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;it sounds like it could be an alternate runcore for Perl 5 as well&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;tried a few different things&lt;/li&gt;&lt;li&gt;decided to write a test for Rakudo&lt;/li&gt;&lt;li&gt;tried a simple arithmetic test pulled from Pugs&lt;/li&gt;&lt;li&gt;found that Rakudo didn't implement a function specified in the S29 draft&lt;/li&gt;&lt;li&gt;Patrick helped me write a couple of lines of code to implement it&lt;/li&gt;&lt;li&gt;then discovered that fudge didn't support try blocks in a specific way&lt;/li&gt;&lt;li&gt;Larry patched that&lt;/li&gt;&lt;li&gt;then found that incrementing an undefined value didn't work in Rakudo&lt;/li&gt;&lt;li&gt;that was the end of my day&lt;/li&gt;&lt;li&gt;I still need to write up my findings&lt;/li&gt;&lt;li&gt;how easy is it for someone without experience in Rakudo and its internals to pick things up and contribute something?&lt;/li&gt;&lt;li&gt;more difficult than I thought it might be, but it's getting more doable&lt;/li&gt;&lt;li&gt;it's important to understand how it might fail before trying to get people to do it&lt;/li&gt;&lt;li&gt;then I started trying to play with MAD on the weekend&lt;/li&gt;&lt;li&gt;found and fixed a bug in its XML&lt;/li&gt;&lt;li&gt;refactored it such that you can run MAD's tests in the core if you add a copy of XML::Parser to the core&lt;/li&gt;&lt;li&gt;it's not far enough yet, but it's a start&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Nicholas:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;is it going to be difficult to restructure the Parrot foundation from 501(c)(3) to 501(c)(6)?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Allison:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;you can do pretty much the same thing&lt;/li&gt;&lt;li&gt;sponsors are on the board in a c6&lt;/li&gt;&lt;li&gt;they're only advisory in a c3&lt;/li&gt;&lt;li&gt;the sponsors we've talked to are mostly only interested in getting regular status reports and the like&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;is there any jumping around to transfer copyright to the new foundation?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Allison:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;we'll do a copyright assignment from the Perl Foundation to the Parrot Foundation&lt;/li&gt;&lt;li&gt;all of the CLAs that went into the code up to the point of signover will be fine&lt;/li&gt;&lt;li&gt;but we'll essentially copy the Perl Foundation CLA to a Parrot Foundation CLA&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Will:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;do we need to contact committers who haven't signed a CLA?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;where does Rakudo fall?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Allison:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;still under the Perl Foundation&lt;/li&gt;&lt;li&gt;it doesn't move at all&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Will:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;do we want to split up the repository at that point?&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Allison:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;eventually, we'll want to do so anyway&lt;/li&gt;&lt;li&gt;it's not an urgent thing&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jerry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;what would it take to version a Perl6Regex frontend to PGE?&lt;/li&gt;&lt;li&gt;let grammars specify a version of the grammar&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I did that before by having a separate compiler&lt;/li&gt;&lt;li&gt;you're talking about something a bit finer grained&lt;/li&gt;&lt;li&gt;I don't want to do that&lt;/li&gt;&lt;li&gt;as we get closer to 1.0, that'd be fine&lt;/li&gt;&lt;li&gt;I already have enough to do keeping up with the latest versions&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Will:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I don't think we want to keep up old versions&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I don't mind sticking to our deprecation cycle&lt;/li&gt;&lt;li&gt;I hadn't put the change from today into the deprecation list yet&lt;/li&gt;&lt;li&gt;we'll get to it in a couple of weeks&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jerry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;just trying to figure out how to push forward with changes to PGE without having to update every language in the repository&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;freeze S05?&lt;/li&gt;&lt;li&gt;not a great solution&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Larry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I heard that&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Patrick:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;the last few changes have been great&lt;/li&gt;&lt;li&gt;I'm not really serious about that&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Larry:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;some of them you even asked for&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;c:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;it's an advantage to have these languages in the repository&lt;/li&gt;&lt;li&gt;we can update them&lt;/li&gt;&lt;li&gt;but only if we can run the tests before and after and know that they pass&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Will:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;we might consider removing languages with failing tests and no recent updates&lt;/li&gt;&lt;li&gt;there are 17 grant proposals, some of them Perl 6-related&lt;/li&gt;&lt;li&gt;please comment on the TPF blog&lt;/li&gt;&lt;li&gt;it'll help&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;strong&gt;Jesse:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;blog.perlfoundation.org&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/summary&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 7 May 2008 06:09:33 GMT</pubDate>
      <title>Good Error Messages are Important</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=317</link>
      <guid>http://use.perl.org/~chromatic/journal/36346?from=rss</guid>
      <description>&lt;p&gt; &lt;a href="http://www.parrotvm.org/svn/parrot/revision?rev=27355" &gt;Parrot r27355&lt;/a&gt; was fun to write.&lt;/p&gt;

&lt;p&gt;One of the persistent error messages Parrot emits for compiler writers is
&lt;code&gt;Null PMC access in invoke()&lt;/code&gt;.  If you've had your hands deep in the
guts of Parrot, you know what that means -- you tried to call a Sub PMC when
you don't have a Sub PMC, you have no PMC.  (If you don't know what that means,
this entry is for you.)&lt;/p&gt;

&lt;p&gt;Sometimes this means that there's a problem in Parrot.  We've fixed almost
all of those problems though, so the error usually comes from elsewhere.  If
you're writing a compiler, or running a compiler built on Parrot, the error
usually means "You tried to call a function that doesn't exist."&lt;/p&gt;

&lt;p&gt;Parrot's optimizer does something interesting at the end of compilation time.  You've probably heard that Parrot's compiler, IMCC, translates PIR into PBC.  That is, it turns source code into bytecode, which Parrot can either serialize t to disk or execute immediately.  That bytecode is just a chunk of linear data in memory.  It's not really a data structure.  (Okay, it's a C array, but that doesn't make it a data structure.)&lt;/p&gt;

&lt;p&gt;After IMCC has finished building a standalone chunk of bytecode, it performs
a constant fixup phase.  The notable part of this phase is that it edits the
bytecode in place to replace all named invocations of functions known at fixup
time with offset invocations.&lt;/p&gt;

&lt;p&gt;The previous code looks something like:&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt; &lt;div&gt;&lt;tt&gt;invoke known_function&lt;br&gt;null&amp;nbsp; &amp;nbsp; # padding&lt;br&gt;null&amp;nbsp; &amp;nbsp; # padding&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;If IMCC has already seen &lt;code&gt;known_function&lt;/code&gt; by this time, the
direct invocation of &lt;code&gt;known_function&lt;/code&gt; can continue.  There's no
runtime lookup necessary; all functions already compiled and ready are
available in the bytecode.&lt;/p&gt;

&lt;p&gt;If IMCC &lt;em&gt;hasn't&lt;/em&gt; seen that function, runtime lookup is necessary, and
so this function replaces the bytecode earlier with the equivalent of:&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt;&lt;div&gt;&lt;nobr&gt; &lt;wbr&gt;&lt;/nobr&gt;&lt;tt&gt;.local pmc func&lt;br&gt;func = find_name 'unknown_function'&lt;br&gt;invoke func&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;(I've simplified what actually happens slightly, because the concepts are
more important than the details.  Hopefully you see why the padding is
necessary.  If not, just imagine trying to splice additional opcodes into what
may presumably be a lengthy C array -- like I said, barely a data
structure.)&lt;/p&gt;

&lt;p&gt;The problem with this second form occurs when &lt;code&gt;find_name&lt;/code&gt; returns
a NULL PMC, which it can legitimately do.  In that case, the
&lt;code&gt;invoke&lt;/code&gt; opcode tries to invoke a NULL PMC and fails, and Parrot
throws an exception saying "There's nothing here to invoke."  There's the error
message.&lt;/p&gt;

&lt;p&gt;It's clear &lt;em&gt;why&lt;/em&gt; that happens, but it's not useful.  It would be more
useful to see the &lt;em&gt;name&lt;/em&gt; of the function you tried to invoke in the
error message.  Unfortunately, by the time Parrot calls the &lt;code&gt;invoke&lt;/code&gt;
op, that name is long gone.&lt;/p&gt;

&lt;p&gt;My first idea was to rewrite the dynamic lookup form into something
resembling:&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt;&lt;div&gt;&lt;nobr&gt; &lt;wbr&gt;&lt;/nobr&gt;&lt;tt&gt;.local pmc func&lt;br&gt;func = find_name 'unknown_function'&lt;br&gt;if defined func goto call_it&lt;br&gt;die "Can't invoke 'unknown_function'"&lt;br&gt; &lt;br&gt;call_it:&lt;br&gt;invoke func&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;Unfortunately, I didn't have the space in the bytecode stream to insert that
many ops, and I had no desire to move chunks of memory around in that C array.
I could have added more padding after an invocation, but to be fair I'm only
mostly sure that it exists there in the first place.&lt;/p&gt;

&lt;p&gt;I had room for one op with a destination PMC and a string constant argument.
I added an experimental op called &lt;code&gt;find_sub_not_null&lt;/code&gt; which does the
same thing as &lt;code&gt;find_name&lt;/code&gt; but throws an exception &lt;em&gt;which includes
the requested name&lt;/em&gt; if Parrot can't find a PMC of that name.&lt;/p&gt;

&lt;p&gt;This isn't entirely an ideal situation.  It's a special case op, and I
prefer to remove ops where possible.  It's also nearly code duplication, though
it's effectively three lines of code in an op, which isn't awful.  I still want
to be able to perform these kinds of transformations in PBC itself, but we need
a different way to generate PBC and perform op-level transformations in PIR
before we can do this effectively.&lt;/p&gt;

&lt;p&gt;There are always tradeoffs, though.  Doing this check in C is slightly
faster than doing it in PIR.  The standard Perl 5 rule of optimization applies
even in Parrot -- the fewer ops, the mostly faster you can go.  As well, I was
able to improve the warning message today, rather than at some point in the
future when we have better PBC optimization possibilities.&lt;/p&gt;

&lt;p&gt;After all, I can always remove this op in the future.&lt;/p&gt;</description>
    </item>
    <item>
      <pubDate>Sun, 4 May 2008 01:09:33 GMT</pubDate>
      <title>What are You Going to Do, SMS at Me?</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=316</link>
      <guid>http://use.perl.org/~chromatic/journal/36322?from=rss</guid>
      <description>&lt;summary type="xhtml"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;For years, I've thought that the only thing sillier than complaining about disaffection and how the world really &lt;em&gt;should&lt;/em&gt; work differently in IRC was to sign silly Internet petitions about it.  Now I realize that &lt;a href="http://thebutterroom.com/post/33341802" &gt;people who feel compelled to register their righteous indignation in 141 characters of chatspeak matter least&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Here's a quarter, kid.  Go buy a postcard.&lt;/p&gt;&lt;/div&gt;&lt;/summary&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 28 Apr 2008 08:12:11 GMT</pubDate>
      <title>What a GC Bug Looks Like in Parrot</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=315</link>
      <guid>http://use.perl.org/~chromatic/journal/36257?from=rss</guid>
      <description>&lt;summary type="xhtml"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;Every so often someone reports weird behavior in &lt;a href="http://www.irc.perl.org/channels.mhtml" &gt;#parrot&lt;/a&gt;, and someone says "Hey, that looks like a GC bug!"&lt;/p&gt;&lt;p&gt;Most of them aren't.  (Most of them lately seem to be that we're changing the way bytecode works, and we don't have all of the dependencies for all of the generated PBC files correct, so you have to run &lt;code&gt;make realclean&lt;/code&gt; and rebuild.)&lt;/p&gt;&lt;p&gt;While adding the vtable override cache the other day, I did create a
forehead-slapper of GC bug, but I caught it before I checked in the code.  How
did I know it was a GC bug?  Easy.&lt;/p&gt;&lt;p&gt;The Class PMC itself contains pointers to several other PMCs and GC
entities, including the name of the class and its corresponding namespace.  I
added a pointer to a Hash PMC which maps the names of vtable overrides to Sub
PMCs.&lt;/p&gt;&lt;p&gt;I remember thinking at the time "Hey, it's just a cache.  I don't have to
mark it during the mark phase explicitly.  All of the Subs it refers to will
stay alive as long as their namespaces live.  That's easy."&lt;/p&gt;&lt;p&gt;When I ran the tests, I saw a weird error about not being able to perform a
keyed index PMC lookup on a Key PMC.  I set a breakpoint on the
&lt;code&gt;real_exception&lt;/code&gt; function (which reports these kinds of errors) in
the debugger, and the backtrace showed that the cause of the call was my cache
lookup function.&lt;/p&gt;&lt;p&gt;"That's weird," I thought.  Then I realized what I had done.&lt;/p&gt;&lt;p&gt;My line of thinking was correct in that I don't have to mark all of the PMCs
contained in the cache PMC.  They're already reachable from the rootset through
the namespace.  The GC won't collect them.&lt;/p&gt;&lt;p&gt;The problem is that the cache itself -- the Hash PMC -- is only reachable
through the Class PMC.  Unless it gets marked as live, the GC will reclaim its
header and put it on the free list again.&lt;/p&gt;&lt;p&gt;The Class PMC still has a pointer to that header, but the next PMC allocated
from the GC which uses that header will overwrite the PMC's information,
effectively morphing my lovely cache into something else.  In this case, my
Hash PMC turned into a Key PMC.&lt;/p&gt;&lt;p&gt;Usually they're not this obvious, but I've gone through all of the PMCs in
Parrot to make sure they mark their contained GCable entities
appropriately.&lt;/p&gt;&lt;/div&gt;&lt;/summary&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 24 Apr 2008 21:17:45 GMT</pubDate>
      <title>Perl 6 Design Minutes for 23 April 2008</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=314</link>
      <guid>http://use.perl.org/~chromatic/journal/36241?from=rss</guid>
      <description>&lt;p&gt;The Perl 6 design team met by phone on 23 April 2008.  Larry, Allison, Patrick, Jerry, Will, Jesse, Nicholas, and chromatic attended.&lt;/p&gt;

&lt;p&gt; &lt;strong&gt;Jerry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we're in a period where everyone's trying to break Parrot&lt;/li&gt;
&lt;li&gt;they're adding new features and accidentally breaking thing&lt;/li&gt;
&lt;li&gt;but they're fixing it&lt;/li&gt;
&lt;li&gt;it's a good part of the cycle&lt;/li&gt;
&lt;li&gt;people fix it&lt;/li&gt;
&lt;li&gt;we don't have a build farm, so we can't test everywhere before
committing to trunk&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I thought that was the point of the release cycle&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jerry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;some people have suggested that we always keep trunk building and passing tests&lt;/li&gt;
&lt;li&gt;but we don't have the means to do that&lt;/li&gt;
&lt;li&gt;especially when we're playing with config&lt;/li&gt;
&lt;li&gt;moving on, the big news is that TPF has six slots in Google's Summer of Code&lt;/li&gt;
&lt;li&gt;one of them is fleshing out the Perl 6 test suite&lt;/li&gt;
&lt;li&gt;we've needed someone to spearhead that&lt;/li&gt;
&lt;li&gt;having a funded new contributor is wonderful&lt;/li&gt;
&lt;li&gt;two Parrot-related projects&lt;/li&gt;
&lt;li&gt;one is generating NCI stubs&lt;/li&gt;
&lt;li&gt;Kevin Tew, a long-time contributor&lt;/li&gt;
&lt;li&gt;the other is the incremental GC specified in the PDD&lt;/li&gt;
&lt;li&gt;that's Andrew Whitworth&lt;/li&gt;
&lt;li&gt;there's also an ASF project for integrating the GC from Apache Harmony into Parrot&lt;/li&gt;
&lt;li&gt;they've wanted to release it as a standalone library&lt;/li&gt;
&lt;li&gt;Parrot's the first test of a standalone system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Nicholas:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;nice that it doesn't count against TPF's slot list&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jesse:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;and it's nice visibility for Parrot from another group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jerry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I finally have six weeks of no plans to travel&lt;/li&gt;
&lt;li&gt;should be able to devote more time to Parrot and Rakudo&lt;/li&gt;
&lt;li&gt;looking forward to that&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Larry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;getting some hacking in on my two pet bugaboos, the longest token matcher and match object generator&lt;/li&gt;
&lt;li&gt;I refactored the matcher&lt;/li&gt;
&lt;li&gt;it still uses TGE&lt;/li&gt;
&lt;li&gt;instead of lumping all of the expect term possible tokens (that is, all of them) into one bucket it separates them into buckets based on their first letter&lt;/li&gt;
&lt;li&gt;it's a one-level tree&lt;/li&gt;
&lt;li&gt;we can build a much smaller DFA for the regexes that start with that letter&lt;/li&gt;
&lt;li&gt;it caches that, of course&lt;/li&gt;
&lt;li&gt;can get an instant reject if the next token can't possibly start with that letter&lt;/li&gt;
&lt;li&gt;also flattened out all of the rules such that the list of tokens is easy to read&lt;/li&gt;
&lt;li&gt;if the first probe with the DFA engine fails, I can take that small set of tokens that start with the same letter, run all of those rules, and sort from longest to shortest&lt;/li&gt;
&lt;li&gt;preserves the token matching order without building huge DFA structures&lt;/li&gt;
&lt;li&gt;as a backoff strategy, that will scale pretty well&lt;/li&gt;
&lt;li&gt;refactored the parameter passing on the matcher side (STD 5)&lt;/li&gt;
&lt;li&gt;instead of passing an initial array of random things, I have parameters&lt;/li&gt;
&lt;li&gt;constructs match objects more correctly&lt;/li&gt;
&lt;li&gt;in the sense that it gets all the information it's supposed to have&lt;/li&gt;
&lt;li&gt;also has some attachments where it shouldn't have&lt;/li&gt;
&lt;li&gt;I'm cleaning that up&lt;/li&gt;
&lt;li&gt;that should scale pretty well&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jerry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;is there a drop in memory usage?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Larry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I haven't measured&lt;/li&gt;
&lt;li&gt;I'm sure that not feeding 800 regexes to TRE at once will make it allocate 17 megabytes on the stack&lt;/li&gt;
&lt;li&gt;it might still be allocating too much for some of the larger things&lt;/li&gt;
&lt;li&gt;I'm still aiming for correct, as opposed to fast&lt;/li&gt;
&lt;li&gt;just trying to bear fast in mind&lt;/li&gt;
&lt;li&gt;the longest token matcher now returns a linked list of states&lt;/li&gt;
&lt;li&gt;not a string&lt;/li&gt;
&lt;li&gt;should be a lot faster; easier to cache&lt;/li&gt;
&lt;li&gt;functionally it's the same as before&lt;/li&gt;
&lt;li&gt;one of those things you don't even have to measure to know it'll be faster&lt;/li&gt;
&lt;li&gt;trying to avoid the bugaboo of premature optimization by doing what I know will be efficient to begin with&lt;/li&gt;
&lt;li&gt;all the while trying to make the thing work&lt;/li&gt;
&lt;li&gt;it has a good chance of being pretty speedy&lt;/li&gt;
&lt;li&gt;my talk in Tokyo will be about all of the places where the current grammar allows extensibility&lt;/li&gt;
&lt;li&gt;it'd be nice to be able to demonstrate some of that&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;getting work done again&lt;/li&gt;
&lt;li&gt;launched the Strings PDD&lt;/li&gt;
&lt;li&gt;list of tasks for concurrency that I'm breaking down into smaller pieces&lt;/li&gt;
&lt;li&gt;may post what I have now, and leave other people to break them down&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;are they parallelizable?&lt;nobr&gt; &lt;wbr&gt;&lt;/nobr&gt;:)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;many of them are&lt;/li&gt;
&lt;li&gt;there are some bigger things, like switching the exception system over to the event handler&lt;/li&gt;
&lt;li&gt;otherwise, just life stuff&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;had paying work come up this past week, so not a lot of actual coding&lt;/li&gt;
&lt;li&gt;need to type the milestones document&lt;/li&gt;
&lt;li&gt;it's all in my head&lt;/li&gt;
&lt;li&gt;managed to remove a lot of unused code thanks to chromatic's post about possible optimizations&lt;/li&gt;
&lt;li&gt;mostly just cleanup&lt;/li&gt;
&lt;li&gt;but helped me figure out things which will feed into my redesign of PGE for longest token matching&lt;/li&gt;
&lt;li&gt;should be able to return to direct Rakduo hacking later this week&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Will:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;various Parrot cleanups&lt;/li&gt;
&lt;li&gt;TPF quarterly grant proposals are due at the end of the month&lt;/li&gt;
&lt;li&gt;haven't seen anything come in yet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;they're queued in an RT queue&lt;/li&gt;
&lt;li&gt;I don't know if grant members have access to that queue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Will:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we do&lt;/li&gt;
&lt;li&gt;please, get your proposal in now, sooner than later&lt;/li&gt;
&lt;li&gt;that goes for you on the call as well as people reading the minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mostly spent the past week optimizing Parrot and Rakudo&lt;/li&gt;
&lt;li&gt;looks like it's the building speed is twice as fast as when I started&lt;/li&gt;
&lt;li&gt;runtime is faster too, but the optimization is compilation time&lt;/li&gt;
&lt;li&gt;found some infelicities that need more design thought&lt;/li&gt;
&lt;li&gt;but I'm happy to put these improvements in now and take them out later when the design improves around them&lt;/li&gt;
&lt;li&gt;hope to start adding new features again soon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;most of the test execution time is in compilation&lt;/li&gt;
&lt;li&gt;how useful would it be to compile Rakudo to standalone PIR?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I'd find it useful&lt;/li&gt;
&lt;li&gt;but I'd find about ten things useful with all I work on&lt;/li&gt;
&lt;li&gt;so not a blocker at the moment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jesse:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how far will that get you toward native executables?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the existing trick for building &lt;em&gt;perl6&lt;/em&gt; would work&lt;/li&gt;
&lt;li&gt;but it's not the same&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if it takes an hour or two, it would help me with debugging and profiling&lt;/li&gt;
&lt;li&gt;if it takes more time, it's not that important&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we have to figure out runtime deployment issues for the Perl 6 runtime library&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Will:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;we could add the requirement to run from &lt;em&gt;languages/perl6/&lt;/em&gt; right now&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;that's fine by me for now&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;that's an afternoon job, not too bad&lt;/li&gt;
&lt;li&gt;what do we need to do to get the Perl 6 and Parrot pages up to date?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Will:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I'll work on that&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Nicholas:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;why is C99 useful to Parrot and the compiler tools?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;front-end parsing for C header files to build NCI declarations automatically&lt;/li&gt;
&lt;li&gt;the backend is pretty easy, that's thunk generation&lt;/li&gt;
&lt;li&gt;the front-end keeps people from having to write boilerplate code by hand&lt;/li&gt;
&lt;li&gt;generate the front-end once, where you have the headers, and then you can run the generated code anywhere even if you don't have the headers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jesse:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how does that compare to Python's ctypes?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;as I understand it, they have the nice backend stuff&lt;/li&gt;
&lt;li&gt;not so sure about the front-end&lt;/li&gt;
&lt;li&gt;my P5NCI is nicer, if incomplete&lt;/li&gt;
&lt;li&gt;just haven't had time to work on it...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jesse:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if you put in for a TPF grant, that would be very useful&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;get me a clone first, and you have a deal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jerry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allison, we talked about implementing &lt;code&gt;return&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;that requires tying in exceptions to the concurrency scheduler?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yes&lt;/li&gt;
&lt;li&gt;just not implemented yet&lt;/li&gt;
&lt;li&gt;when we did exceptions, we didn't have concurrency&lt;/li&gt;
&lt;li&gt;so it's on the top of my list to tie them together&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Will:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tcl's already using exceptions to handle &lt;code&gt;return&lt;/code&gt;, &lt;code&gt;break&lt;/code&gt;, and &lt;code&gt;continue&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;right now, you can't have an exception handler which is a full subroutine&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I'm not sure we need one for that feature&lt;/li&gt;
&lt;li&gt;every subroutine block decorated as such in PAST puts an exception handler in the block&lt;/li&gt;
&lt;li&gt;if any nested block throws a &lt;code&gt;return&lt;/code&gt; type exception, it grabs the arguments, does what it has to, and then does a Parrot return&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if that's what you need, go ahead and do it&lt;/li&gt;
&lt;li&gt;I thought there are some features you didn't have yet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I thought there might be some opcodes I needed, like &lt;code&gt;handled&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;but we can do something now&lt;/li&gt;
&lt;li&gt;might not be completely optimal&lt;/li&gt;
&lt;li&gt;but it's just packaging things up now&lt;/li&gt;
&lt;li&gt;I have something I think will work&lt;/li&gt;
&lt;li&gt;it's not trivial, but I'm 80% confident&lt;/li&gt;
&lt;li&gt;just a matter of sitting down and doing it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the concurrency stuff will be there before the next release&lt;/li&gt;
&lt;li&gt;might not want to roll it in before the release&lt;/li&gt;
&lt;li&gt;but it'll be there soon&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Patrick:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I want to get &lt;code&gt;return&lt;/code&gt; in for the April 15 milestone we're behind on&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Jerry:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;have you put in tickets for the breakdown of specific tasks?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I've never done tickets for that&lt;/li&gt;
&lt;li&gt;just sent mail to the list of the tasks&lt;/li&gt;
&lt;li&gt;handed them out to people as they volunteered&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;c:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;can you put them on a wiki page?&lt;/li&gt;
&lt;li&gt;some of the other committers wanted that&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt; &lt;strong&gt;Allison:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I can do that&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <pubDate>Tue, 22 Apr 2008 07:12:34 GMT</pubDate>
      <title>Refcounting Isn't All Bad</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=313</link>
      <guid>http://use.perl.org/~chromatic/journal/36212?from=rss</guid>
      <description>&lt;summary type="xhtml"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;A lot of people complain about reference counting as a memory management strategy in Perl 5, and they have a point.  Unless you're very careful, reference counting spreads its tendrils throughout your system.  Unless you're very disciplined, you'll forget to increase a reference count somewhere, and you'll end up collecting things in the wrong places.&lt;/p&gt;&lt;p&gt;The paper &lt;a href="http://portal.acm.org/citation.cfm?id=1035292.1028982" &gt;A
Unified Theory of Garbage Collection&lt;/a&gt; discusses the most popular modern GC
strategies to demonstrate how reference counting and tracing garbage collection
are roughly equivalent, especially as concerns about performance, correctness,
and conservativeness increase.&lt;/p&gt;&lt;p&gt;I explain this because I added reference counting to a small part of Parrot
today as an optimization -- 11.73% on my Rakudo-building benchmark.&lt;/p&gt;&lt;p&gt;Parrot has an internal data structure called a stack.  This represents a
particular environment within the call graph.  If you think of a normal program
flow, where function A calls function B calls function C which returns to B and
returns to A, you'll have a sense of a normal call stack.  Parrot's stack is
similar, except that we use continuation passing style (CPS), where it's not a
stack, it's a graph, and control flow doesn't have to be that linear.&lt;/p&gt;&lt;p&gt;There's plenty of literature on CPS (including Luke Palmer's &lt;a href="http://groups.google.com/group/perl.perl6.language/msg/b0cfa757f0ce1cfd" &gt;how
to get a free sandwich with continuations&lt;/a&gt;, but the important idea is that
function A sets a bookmark inside and passes that bookmark along to function B.
B does the same thing when it calls C.  At any point, you can look up any
bookmark you happen to have and magically teleport (okay, it's just a jump
instruction in your processor -- someday I'll explain how very low level
languages have &lt;code&gt;eval&lt;/code&gt; and very high level languages have
&lt;code&gt;eval&lt;/code&gt; and it's just the poor jerks in the middle who can't do
anything useful without feeding the world's pointiest programming language into
their AbstractFactoryFactoryFactories) to the point of that bookmark.&lt;/p&gt;&lt;p&gt;Ranty story short, our stack is a mostly-acyclic graph represented as a
linked list, and stack entries -- or chunks -- are garbage collectable
entities.&lt;/p&gt;&lt;p&gt;If you've even sat next to one of my "Let's Make Parrot Go Faster!" entries
on a bus somewhere, or heard it playing softly in an elevator, you know that
one good way to make Parrot go faster is to use fewer garbage collectable
entities.  One way to make an O(2n) algorithm faster is to make it an O(log n)
algorithm.  Another way is to make &lt;em&gt;n&lt;/em&gt; smaller, and that's easier for
now, especially because all I have to do is watch over Andrew Whitworth who's
going to write a nice new garbage collector and keep track of Senaka Fernando,
who's going to connect the nice garbage collector from Apache Harmony into
Parrot.&lt;/p&gt;&lt;p&gt;One nice feature of reference counting (ah, now you see the connection!) is
that you can recycle dead objects as soon as you know they're dead.  One sad
misfeature of a conservative garbage collector is that dead bodies stack up for
a while until you can mulch them.  One horrible thing about a stop-the-world
full mark-and-sweep garbage collector (and try to guess what Parrot has at the
moment) is that if you're out of memory in &lt;em&gt;one&lt;/em&gt; of the arenas you care
about, you have to mark all of the living GCable entities in your system and
sweep all of the pools in all of the arenas to find everything that's alive and
to recycle everything that isn't.&lt;/p&gt;&lt;p&gt;If you want to go fast, you want to avoid this until it's absolutely
necessary.&lt;/p&gt;&lt;p&gt;Here's the interesting thing about stack chunks: Parrot stores them in one
place in one function (&lt;code&gt;stack_push&lt;/code&gt;) and unstores them in one place
in one function (&lt;code&gt;stack_pop&lt;/code&gt;).  Again, the names are really bad
because it's a graph and not a stack, but you get the point.&lt;/p&gt;&lt;p&gt;I noticed this when I profiled the Rakudo-building benchmark again and saw
that &lt;code&gt;stack_push&lt;/code&gt; was one of the most expensive inclusive calls,
apart from the garbage collector.  It calls a function which calls a function
which calls a function which asks for a new stack chunk from the GC.  When
there are no more free stack chunks, the GC runs again, and that eats up
precious cycles.&lt;/p&gt;&lt;p&gt;After a few minutes of thinking, I realized that the
&lt;code&gt;stack_push&lt;/code&gt;/&lt;code&gt;stack_pop&lt;/code&gt; pair formed a boundary around a
stack chunk's lifespan.  Popping a chunk off of the stack meant that nothing
else needed it.  That chunk is immediately identifiably a dead object, suitable
for recycling.&lt;/p&gt;&lt;p&gt;Rather than waiting for a full GC run to find every live object in the
system and then run across this dead object and recycle it, I added a couple of
lines of code to recycle it automatically then and there.&lt;/p&gt;&lt;p&gt;There was my immediate 11.73% speedup.&lt;/p&gt;&lt;p&gt;There was also a problem in the Continuation PMC tests; I noticed this only
after I patted myself on the back for moving the bottleneck in my benchmark
elsewhere.  I'm sure you'll see it if you think for a moment, especially about
how I kept writing that the stack isn't a stack, it's a graph implemented as a
linked list.&lt;/p&gt;&lt;p&gt;The problem is that there's not a single linked list.  If you take a
continuation at various points in the call graph, you can have several linked
lists that all share the same tail.  If you exhaust one of those call chains,
you may pop a stack chunk that's part of another call graph elsewhere.  Your
reference to it goes away, but it's still live elsewhere, so if you recycle it
then and there, you may end up reusing the chunk and storing inappropriate data
in it while something else expects it to stay pristine.&lt;/p&gt;&lt;p&gt;If you're very clever, you've figured out the solution.&lt;/p&gt;&lt;p&gt;I added a reference count to the stack chunk structure, incremented it on
&lt;code&gt;stack_push&lt;/code&gt;, decremented it on &lt;code&gt;stack_pop&lt;/code&gt;, and recycled
the chunk in the latter function only if the refcount is zero.&lt;/p&gt;&lt;p&gt;Is this a long-term solution?  Probably not; I posted my initial
investigation to the parrot-porters list, and we had a nice discussion on
alternate techniques.  We'll have to refactor the code more heavily once we
find a better approach, but for now, I'll live with this optimization.&lt;/p&gt;&lt;p&gt;(Seneca Cunningham found what appears to be a crash related to this, but I
think I've found the culprit and fixed it by adding another reference count
pair to the Continuation PMC.  See?  I told you reference counting made itself
pervasive.)&lt;/p&gt;&lt;/div&gt;&lt;/summary&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 21 Apr 2008 07:14:18 GMT</pubDate>
      <title>It's Cheaper at Compile Time</title>
      <link>http://www.advogato.org/person/chromatic/diary.html?start=312</link>
      <guid>http://use.perl.org/~chromatic/journal/36202?from=rss</guid>
      <description>&lt;p&gt;I've long used part of the Rakudo-building process as my benchmark for
Parrot optimizations.  It doesn't exercise all of Parrot by any means, but it
pushes the garbage collector, the string system, and the object system pretty
hard.  It's also the longest part of the build process anywhere, so improving
performance there has a dramatic effect on productivity.&lt;/p&gt;

&lt;p&gt;I've long known that it appends to and concatenates strings very frequently.
The corresponding Parrot functions always show up near the top of the cost list
from Callgrind.  I've spent a few hours here and there trying to speed them up,
but short of rethinking them entirely, I've never found a good solution.&lt;/p&gt;

&lt;p&gt;We don't (yet) have a PIR-level profiler like Callgrind (but I'm working on
it).  Sometimes I can read through the code and see things that might be
expensive, knowing what eventually gets called and where.  On a whim, I browsed
through the generated code for Rakudo to find concatenation.  One idiom jumped
out at me:&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt; &lt;div&gt;&lt;tt&gt;$S0 = concat "PIR", ':"'&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;This line of code catenates two constant strings into one, and assigns the result to the virtual string register &lt;code&gt;$S0&lt;/code&gt;.  It's not terribly inefficient; the two constant strings are in the constant table in the bytecode, so they don't get recreated on execution.  However, the result is always going to be a constant string.&lt;/p&gt;

&lt;p&gt;There's no reason the optimizer couldn't rewrite that line of code into:&lt;/p&gt; &lt;p&gt;&lt;blockquote&gt; &lt;div&gt;&lt;tt&gt;$S0 = 'PIR:"'&lt;/tt&gt;&lt;/div&gt; &lt;/blockquote&gt;  &lt;p&gt;It didn't.  Now it does.&lt;/p&gt;

&lt;p&gt;The optimizer already knew how to optimize away constant addition,
subtraction, and other math operations.  All I had to do was tell the opcode
generator not to generate the &lt;code&gt;concat_s_sc_sc&lt;/code&gt; op (concatenate two
string constants and put the results in a string register -- the destination
register always comes first in the argument list for an opcode), add the
&lt;code&gt;concat&lt;/code&gt; operator to the list of rewritable three-register opcodes,
and add a case to the rewriter where the destination register is a string
register.&lt;/p&gt;

&lt;p&gt;The result is a modest 5.5% speedup in my benchmark.  Part of the gain is
avoiding run-time concatenation, but part of it is also using fewer GCable
entities.  The less garbage you create, the less garbage you have to collect
and the less frequently you have to collect it.  5.5% isn't a huge gain, but
it's a step in the right direction.  Every second we shave off of the
hack-compile-test cycle is an improvement, and these optimizations help all
Parrot programs as well.&lt;/p&gt;

&lt;p&gt;(Are these entries interesting?  I seem to get more feedback when I complain about various Technology Distortion Fields.)&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
