<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Martin Berends</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/martin_berends/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/martin_berends/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/martin_berends//30</id>
    <updated>2012-06-16T10:33:09Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>Rakudo Perl 6 on Android ICS 4.0.3</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/martin_berends/2012/06/rakudo-perl-6-on-android-ics-403.html" />
    <id>tag:blogs.perl.org,2012:/users/martin_berends//30.3398</id>

    <published>2012-06-16T07:00:41Z</published>
    <updated>2012-06-16T10:33:09Z</updated>

    <summary>The Asus Transformer Prime (TF201) is an outstanding Android tablet and with keyboard it is a very good netbook replacement. Using Linux Installer aided by some tweaks you can make it build and run current (June 2012) Parrot and Rakudo....</summary>
    <author>
        <name>Martin Berends</name>
        
    </author>
    
        <category term="Perl 6" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Perl6" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Rakudo" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="rakudoperl6android" label="rakudo perl6 android" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/martin_berends/">
        <![CDATA[<p>The Asus Transformer Prime (TF201) is an outstanding Android tablet and with keyboard it is a very good netbook replacement.  Using <a href="https://play.google.com/store/apps/details?id=com.galoula.LinuxInstall">Linux Installer</a> aided by some <a href="http://autoexec.wikispaces.com/page/edit/LinuxOnAsusTransformerPrimeTF201">tweaks</a> you can make it build and run current (June 2012) Parrot and Rakudo.  On a Debian Stable (6.0 Squeeze) installation, you need only use apt-get to install the git-core, gcc and make packages (optionally libicu-dev) and do a standard <a href="http://rakudo.org/how-to-get-rakudo/">Rakudo build</a>.</p>

<p>Some numbers: Total file system usage for Debian, Parrot, Rakudo and spectests is 883MB.  The --gen-parrot step takes 25 minutes.  Building perl6 takes 33 minutes, or 27 with 'make --jobs=4'.  Resident memory exceeds 786MB when compiling the Setting (Android has no swap).  An idle perl6 REPL uses under 24MB of memory.  It takes a little over 2 hours to run 'make spectest' normally or 66 minutes if you do 'export TEST_JOBS=4' first.  A perl6 process running a typical spectest has around 70MB resident in memory.</p>

<p>Hopefully this information will encourage some people to try hacking Perl 6 on Android.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Niecza almost took part in the Perl 6 Coding Contest</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/martin_berends/2011/04/niecza-almost-took-part-in-the-perl-6-coding-contest.html" />
    <id>tag:blogs.perl.org,2011:/users/martin_berends//30.1669</id>

    <published>2011-04-19T18:47:27Z</published>
    <updated>2011-04-19T21:22:06Z</updated>

    <summary>The community at #perl6 on freenode derived much pleasure from studying and discussing the entries to Masak&apos;s Perl 6 Coding Contest 2010. Five problems, five contestants, 26 entries (go figure) all used Rakudo. Since Niecza is the new Perl 6...</summary>
    <author>
        <name>Martin Berends</name>
        
    </author>
    
        <category term="Perl 6" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="niecza" label="Niecza" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/martin_berends/">
        <![CDATA[<p>The community at #perl6 on freenode derived much pleasure from studying and discussing the entries to <a href="http://strangelyconsistent.org/blog/masaks-perl-6-coding-contest">Masak's Perl 6 Coding Contest 2010</a>.  Five problems, five contestants, 26 entries (go figure) all used Rakudo.  Since <a href="https://github.com/sorear/niecza">Niecza</a> is the new Perl 6 kid on the block, it seemed an interesting idea to try it out on <a href="http://strangelyconsistent.org/p6cc2010/">the submissions</a>.</p>

<p>Alas, it was very disappointing to see error after error from Niecza. The results are included below for closer analysis.  During testing it began to look as if Niecza would not run any entries, but fortunately it managed with p3-fox and p3-matthias. (They produced wrong answers, but hey, running code!)</p>

<p>The scripts that died with "Parse failed" never ran - the parser considered the source code to be not Perl 6 STD grammar compliant.  There are lessons here - maybe Rakudo is too lenient in places, or maybe STD needs to be tweaked.  It is also possible that the scripts could be patched to comply with STD, masak++ has already suggested a project to investigate.</p>

<p>The errors that mention exceptions occurred at run time - this is where Niecza most likely needs enhancement.  Many of those jobs are major work, but a keen hacker may find some Low Hanging Fruit amongst them.  This was an expected outcome of the experiment - to identify bits missing in Niecza that Perl 6 power users want.</p>

<p>The ones that ran, but wrongly - they will probably provide hours of debugging fun to Niecza newbies.  Or the contestants, who have some explaining to do.</p>

<p>Statistically one can prove anything, and on those grounds the strong correlation between two percentages must be very significant.  Niecza passes 1663 Perl 6 spectests at the time of writing, which is just a bit under 10% of what Rakudo manages.  And Niecza ran a bit under 10% of the Coding Contest entries that Rakudo ran.  The significance is just beginning to sink in...</p>

<p>The conclusion is that the clouds over these results do have silver linings.  Niecza deserves admiration for what it can do, and more contributors to fix what it cannot do yet.</p>

<p><strong>Results</strong></p>

<ul>

<p><li><strong>p1-colomon</strong><br />
export tags NYI at line 5<br />
Traits, postconstraints, and shapes on variable declarators NYI at line 22<br />
Missing block (apparently gobbled by undeclared routine?) at line 35<br />
Undeclared name: 'Int' used at line 32<br />
Parse failed</li></p>

<p><li><strong>p1-fox</strong><br />
Undeclared routine: 'max' used at line 15<br />
Unhandled exception: Check failed</li></p>

<p><li><strong>p1-matthias</strong><br />
Unhandled exception: Unable to resolve method Numeric in class Sub at line 4</li></p>

<p><li><strong>p1-moritz</strong><br />
In parameter declaration, typename 'Int' must be predeclared (or marked as declarative with :: prefix) at line 45<br />
Parse failed</li></p>

<p><li><strong>p1-util</strong><br />
Unhandled exception: System.Exception: Unable to find lexical &hyperunary</li></p>

<p><li><strong>p2-colomon</strong><br />
In parameter declaration, typename 'Complex' must be predeclared (or marked as declarative with :: prefix) at line 64<br />
Parse failed</li></p>

<p><li><strong>p2-fox</strong><br />
Unable to find lexical &infix:<xor></li></p>

<p><li><strong>p2-matthias</strong><br />
Unhandled exception: Series op NYI</li></p>

<p><li><strong>p2-moritz</strong><br />
Unable to resolve method ast in class Any</li></p>

<p><li><strong>p2-util</strong><br />
Action method trait_mod:of not yet implemented at line 18</li></p>

<p><li><strong>p3-colomon</strong><br />
In parameter declaration, typename 'Int' must be predeclared (or marked as declarative with :: prefix) at line 18<br />
Parse failed</li></p>

<p><li><strong>p3-fox</strong><br />
*runs* but produces the wrong output</li></p>

<p><li><strong>p3-matthias</strong><br />
*runs* but produces the wrong output</li></p>

<p><li><strong>p3-moritz</strong><br />
Unhandled parameter twigil . at line 8</li></p>

<p><li><strong>p3-util</strong><br />
In parameter declaration, typename 'Int' must be predeclared (or marked as declarative with :: prefix) at line 13<br />
Parse failed</li></p>

<p><li><strong>p4a-colomon</strong><br />
Export tags NYI at line 5<br />
In parameter declaration, typename 'Numeric' must be predeclared (or marked as declarative with :: prefix) at line 26<br />
Parse failed</li></p>

<p><li><strong>p4b-colomon</strong><br />
Export tags NYI at line 5<br />
In parameter declaration, typename 'Numeric' must be predeclared (or marked as declarative with :: prefix) at line 26<br />
Parse failed</li></p>

<p><li><strong>p4-fox</strong><br />
Undeclared routines:<br />
	'max' used at line 42<br />
	'undefine' used at line 36<br />
Parse failed</li></p>

<p><li><strong>p4a-moritz</strong><br />
Malformed block at line 39<br />
Undeclared routines:<br />
	'all' used at line 24,29<br />
	'any' used at line 7<br />
Parse failed</li></p>

<p><li><strong>p4b-moritz</strong><br />
Malformed block at line 43<br />
Undeclared routines:<br />
	'all' used at line 28,33<br />
	'any' used at line 11<br />
Parse failed</li></p>

<p><li><strong>p4b-util</strong><br />
Unhandled exception: Unable to resolve method end in class Array at line 11</li></p>

<p><li><strong>p5-colomon</strong><br />
Traits, postconstraints, and shapes on variable declarators NYI at line 14<br />
In has declaration, typename 'Int' must be predeclared (or marked as declarative with :: prefix) at line 18<br />
Malformed has at line 18<br />
Parse failed</li></p>

<p><li><strong>p5-fox</strong><br />
No value in mainline available for parameter $j at line 24</li></p>

<p><li><strong>p5-matthias</strong><br />
Unable to resolve method push in class Hash at line 7</li></p>

<p><li><strong>p5-moritz</strong><br />
Unable to resolve method ast in class Any</li></p>

<p><li><strong>p5-util</strong><br />
Unable to resolve method keys in class Array at line 12</li></p>

</ul>]]>
        
    </content>
</entry>

<entry>
    <title>Rakudo Perl 6 gets into databases</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/martin_berends/2010/06/rakudo-perl-6-gets-into-databases.html" />
    <id>tag:blogs.perl.org,2010:/users/martin_berends//30.691</id>

    <published>2010-06-30T13:20:45Z</published>
    <updated>2010-06-30T22:33:02Z</updated>

    <summary>Database access for Rakudo Perl 6 has improved markedly in the past month. Here are the main points: The MiniDBI project formerly known as FakeDBI is destined for inclusion in Rakudo * and is now &apos;usable&apos; and &apos;useful&apos;. Commit permission...</summary>
    <author>
        <name>Martin Berends</name>
        
    </author>
    
        <category term="Perl6" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Rakudo" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="database" label="database" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl6" label="perl6" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/martin_berends/">
        <![CDATA[<p>Database access for <a href="http://rakudo.org/">Rakudo Perl 6</a> has improved markedly in the past month. Here are the main points:</p>

<p>The MiniDBI project formerly known as FakeDBI is destined for inclusion in Rakudo * and is now 'usable' and 'useful'.  Commit permission to the <a href="http://github.com/mberends/MiniDBI">repo</a> is freely available via hugme in #perl6. Porting simple database client software from Perl 5 to Perl 6 requires only minimal editing.</p>

<p>So, why MiniDBI and not just DBI? Because Perl 6 will have a DBI v2, based on JDBC, read more about that below. The Perl 5 DBI (v1) is very widely used, but enhancing it is far less important than maintaining its stability. Mini means a short term port of a v1 subset, leaving the DBI name free for v2 to use in future.</p>

<p>The mysql DBD has been working for several weeks now, most enjoyably inside <a href="http://pivo.jnthn.net">http://pivo.jnthn.net</a> (<a href="http://github.com/jnthn/pivo">source</a>). Su-Shee++ contributed various fetch* methods and tests in the new database independent test suite.</p>

<p>Several people on #perl6 independently decided to write a <a href="http://www.postgresql.org">Postgresql</a> driver. They chose various implementation methods, and discussed on IRC.</p>

<p>kaare++ <a href="http://blogs.perl.org/users/kaare/2010/06/my-first-perl6-code.html">blogged</a> about his first perl6 code after a long lurk. Yay! It uses the Pg.pir driver included with Parrot, and confirms that everything works.  It is at a similar proof of concept level to this <a href="http://github.com/jnthn/zavolaj/blob/master/examples/postgresqlclient.p6">Zavolaj example</a> without requiring Zavolaj.</p>

<p>moritz_++ chimed in with an <a href="http://nopaste.snit.ch/21655">untested snippet</a> which is based on the same Parrot library. It works similarly, yet is built with DBD style classes.</p>

<p>cxreg++ made a fork of the MiniDBI github repository and added <a href="http://github.com/cxreg/MiniDBI/blob/master/lib/MiniDBD/Pg.pm6">MiniDBD::Pg</a> which uses Zavolaj instead of the Pg.pir from Parrot.  It's the most complete Perl 6 Postgresql driver so far.</p>

<p>Each of the above makes a certain kind of progress.  What MiniDBD::Pg should ideally get is a combination of elements from them all. Whether to use Zavolaj or the Parrot Pg.pir is still undecided, both approaches have merit.  Well done everyone for the work done so far!</p>

<p>DBI v2 is also progressing, timbunce++ appears regularly in #perl6, working on <a href="http://github.com/timbunce/java2perl6">his project</a>. The idea is to automatically translate the Java JDBC API into Perl 6 stub classes and roles. Then Someone(tm) can fill the stubs out with implementation. Fortunately DBI v2 does not overlap or clash with MiniDBI, so all the code might in future merge into a single nice architecture.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Measuring Rakudo performance</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/martin_berends/2010/05/measuring-rakudo-performance.html" />
    <id>tag:blogs.perl.org,2010:/users/martin_berends//30.549</id>

    <published>2010-05-13T12:09:02Z</published>
    <updated>2010-05-16T09:48:41Z</updated>

    <summary>You can now create &quot;statistics&quot; about Rakudo performance (perhaps to augment your &quot;lies&quot; and &quot;damn lies&quot; ;-) using new funtionality added to the &apos;tools/test_summary.pl&apos; script. It&apos;s under the title &quot;Simple Relative Benchmarking&quot;, and needs at least two runs to give...</summary>
    <author>
        <name>Martin Berends</name>
        
    </author>
    
        <category term="Perl 6" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="perl6" label="perl6" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rakudo" label="rakudo" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/martin_berends/">
        <![CDATA[<p>You can now create "statistics" about Rakudo performance (perhaps to augment your "lies" and "damn lies" ;-) using new funtionality added to the 'tools/test_summary.pl' script.  It's under the title "Simple Relative Benchmarking", and needs at least two runs to give usable data. Please try it, and compare findings in #perl6.</p>

<p>With up to about 2% additional run time, test_summary gets Rakudo's Test.pm to emit per-test timestamps to microsecond resolution.  Then test_summary calculates the (real) execution time of each of the more than 30000 spectests and inserts the results into 'docs/test_summary.times' in JSON format.  That accumulates the results of the five most recent complete runs in FIFO fashion, occupying about 2.5 MB.</p>

<p>The times make interesting reading, but with the usual caution not to conclude too much from benchmarks.  Before these details were available, Rakudo developers would compare only the total execution time of an entire batch of tests.  The total time was generally stable, and changes up or down of less that 3% were usually ignored.  Bigger changes were mainly attributed to refactoring and optimization within Parrot.  It was therefore surprising to discover that individual test timings were much more volatile than that, even with roughly the same total batch time.</p>

<p>With five samples to compare, some tests are very consistent in their execution times and others are very erratic.  External factors such as CPU time spent in other processes are certainly resposible for some fluctuation (it's only "real" or wallclock time).  But extended observation of more than 5 runs on an otherwise quiescent computer indicates that internally, execution sometimes "freezes" for up to a few seconds.  These "spikes" in execution time seem to have nothing to with the test itself, because if the run is repeated with identical software, different tests show the effect.  There is a general ceiling for the duration of these random delays, and it seems to be unrelated to the typical time taken by the test.</p>

<p>There is also a fairly solid floor, below which test execution time never drops.  This is only partly due to the overhead of logging the timestamps.  You can see how much by exporting the PERL6_TEST_TIMES variable with any value, and then running a single test script directly with Rakudo.  The difference between the first two consecutive timestamps at the top of the TAP ouput is the logging overhead.</p>

<p>The major part of the minimum test execution time is probably ok() and its siblings in Test.pm.  They all end up calling proclaim(), which also conditionally outputs the timestamps.  Some more work could be done in this area, perhaps logging additional data such as the minimum test execution time and the minimum executable startup time.  By subtracting such minima from the test times, the differences between the remaining values would be clearer.</p>

<p>In order to better navigate so much data, there are two reports in the POD at the end of test_summary.pl.  They are written in Perl 5, because Rakudo became glacial when trying to do something like this.  After you have run at least two test_summary batches, paste the reports into temporary scripts and view the output (also about 2.5 MB) in a pager or editor.</p>

<p>The first report was one of the main goals of all this benchmarking effort, to show the change in execution time for each test between the last two test runs.  The idea was to identify the tests that speeded up or slowed down the most, presumably because of recent software changes. Alas, too much randomness in the timings has muddled the outcome so far.</p>

<p>The second report analyses how much the timings for each test vary.  It extracts the minimum and maximum times, and sorts all the results by percentage difference.  After five runs, the median test (almost number 16000 out of 32000) shows a difference of just over 25%.  There are about 400 tests out of 32000 (about 1.2%) where the maximum time is over twice the minimum.  Fortunately, at the other end the same number of tests have five timings within 2.8% of each other, showing good stability.</p>

<p>Is it too hasty a conclusion to speculate that garbage collection is behind these random delays?  Some memory usage profiling about a month ago pointed to that effect, and whilst some memory leaks have been plugged since, the main use of memory is basically unchanged.</p>

<p>Absolute figures are not as important as the differences (hence the term relative benchmarking).  For what it's worth, these statistics come from an 1.6GHz Intel Atom processor with hyperthreading enabled, 1GB memory and a 16GB solid state flash drive (basically an eeePC netbook) running Ubuntu Linux 10.04.  A second system with more than twice the memory and speed corroborated the results.</p>

<p>This timing software was added to associate performance changes with updates in Rakudo and Parrot.  So far it has failed to do that.  The "lesson learned" instead is that the software being monitored is very complex and therefore difficult to pin down, performance-wise.</p>

<p>Some other <a href="http://perlgeek.de/blog-en/perl-6/contribute-now-announce.html">Rakudo adopters</a> may be able to extend or improve the work done to date.  One idea not yet implemented is to filter out the irregular spikes in execution times as noise, and then rewrite the first report with cleaner data.   It might be an interesting subject for one of moritz_++'s weekly challenges.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Just what we all want - a decent blog site :-)</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/martin_berends/2009/11/just-what-we-all-want---a-decent-blog-site--.html" />
    <id>tag:blogs.perl.org,2009:/users/martin_berends//30.22</id>

    <published>2009-11-20T12:20:10Z</published>
    <updated>2009-11-20T12:37:50Z</updated>

    <summary>Is it really possible that this is the first outsider&apos;s entry on the shiny new blog site? That&apos;s exciting! This site ticks all the boxes, and that cannot be said for most of the alternatives. Well done to the Dave...</summary>
    <author>
        <name>Martin Berends</name>
        
    </author>
    
    <category term="perl6" label="Perl 6" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/martin_berends/">
        <![CDATA[<p>Is it really possible that this is the first outsider's entry on the shiny new blog site?  That's exciting!  This site ticks all the boxes, and that cannot be said for most of the alternatives.  Well done to the Dave Cross and the developer team!  At #perl6 on irc.freenode.net there are occasional discussions about writing a blogging engine in Perl 6.  Search for "yarn" in http://irclog.perlgeek.de/perl6/today and you will see how little has been done so far.  When it does begin to grow, it will be a good idea to stea^W adopt some layout annd style ideas from this wonderful site :) </p>

<p>(This will not become a Blogging Iron Man entry - guaranteed the flow of postings will be fairly sparse).  Right, let's try the Save button...</p>]]>
        
    </content>
</entry>

</feed>
