<?xml version="1.0"?>
<rss version="2.0">

<channel>
	<title>Planet Perl Six</title>
	<link>http://planetsix.perlfoundation.org</link>
	<language>en</language>
	<description>Planet Perl Six - http://planetsix.perlfoundation.org</description>

<item>
	<title>perl6.announce: Parrot 5.4.0 &quot;Austin Parrot&quot; Released! by Bruce Gray</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2013/05/msg694.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2013/05/msg694.html</link>
	<description>Jimi Hendrix, deceased, drugs.&lt;br /&gt;    Janis Joplin, deceased, alcohol.&lt;br /&gt;    Mama Cass, deceased, ham sandwich.&lt;br /&gt;        -- Austin Powers (making a list of friends from the Summer of Love)&lt;br /&gt;&lt;br /&gt;On behalf of the Parrot team, I'm proud to announce Parrot 5.4.0, also known&lt;br /&gt;as &quot;Austin Parrot&quot;.  Parrot (http://parrot.org/) is a virtual machine aimed&lt;br /&gt;at running all dynamic languages, and currently focusing on Perl 6.&lt;br /&gt;&lt;br /&gt;Parrot 5.4.0 is available on Parrot's FTP site&lt;br /&gt;(ftp://ftp.parrot.org/pub/parrot/releases/devel/5.4.0/), or by following the&lt;br /&gt;download instructions at http://parrot.org/download.  For those who would like&lt;br /&gt;to develop on Parrot, or help develop Parrot itself, we recommend using Git to&lt;br /&gt;retrieve the source code to get the latest and best Parrot code.&lt;br /&gt;&lt;br /&gt;Parrot 5.4.0 News:&lt;br /&gt;    - Core&lt;br /&gt;        + Implemented the coth() and acot() math functions.&lt;br /&gt;        + Fixed chomp to only trim a newline when it ends the string. [GH #958]&lt;br /&gt;        + Added readlink() and Parrot_file_readlink(), with tests. [GH #967]&lt;br /&gt;    - Build&lt;br /&gt;        + Parrot now detects the CPU model on Linux systems, as well as&lt;br /&gt;          detecting more CPU models on BSD, Cygwin, Solaris, Win32, and Darwin.&lt;br /&gt;          ARM v7 is also now recognized. [GH #962]&lt;br /&gt;    - Documentation&lt;br /&gt;        + Threads examples now have proper POD sections and useful descriptions&lt;br /&gt;          with links to references.&lt;br /&gt;        + Added main description for Task PMC.&lt;br /&gt;        + Added descriptions to trig methods in Float PMC.&lt;br /&gt;    - Tests&lt;br /&gt;        + Added improved test coverage targets &quot;cover_new&quot; and &quot;fullcover_new&quot;.&lt;br /&gt;        + Improved tests for acot(), coth(), acot() math functions.&lt;br /&gt;        + Added tests for options passed to debugger.&lt;br /&gt;        + Updated native PBC test files for string, number, and integer,&lt;br /&gt;          which resolved 11 TODOs in the test suite. [GH #959]&lt;br /&gt;        + Fixed test for the auto/arch config step.&lt;br /&gt;    - Release process&lt;br /&gt;        + Added message digests to crow.pir.&lt;br /&gt;        + Added in release.json: &quot;release.type&quot; can be &quot;devel&quot; or &quot;supported&quot;.&lt;br /&gt;        + Refactored common code to sub in auto_release.pl.&lt;br /&gt;    - Community&lt;br /&gt;        + Parrot is part of the Hackathon at YAPC::NA::2013, in Austin, TX, USA!&lt;br /&gt;            http://www.yapcna.org/yn2013/wiki?node=Hackathons&lt;br /&gt;        + Parrot has been accepted to Google Summer of Code 2013!&lt;br /&gt;        + Currently there are two high-quality proposals being worked on:&lt;br /&gt;            https://gist.github.com/sa1/5468408        - parrot-libgit2&lt;br /&gt;            https://gist.github.com/denisboyun/5472762 - App::Parrot::Create&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SHA256 message digests for the downloadable tarballs are:&lt;br /&gt;4e37686911b446f5e5f2c0aa62138988ba0c411d2c5e2ba231d1a3421a85ad10 parrot-5.4.0.tar.gz&lt;br /&gt;91d0e46fe3ef08e692e80756f26ee0e7311fe58e49d6c31f3f5180d4eb475696 parrot-5.4.0.tar.bz2&lt;br /&gt;&lt;br /&gt;Many thanks to all our contributors for making this possible, and our sponsors&lt;br /&gt;for supporting this project.  Our next scheduled release is 18 Jun 2013.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Wed, 22 May 2013 18:51:15 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W20</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W20.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W20.html</link>
	<description>&lt;p&gt;This week, the most notable change would be Rakudo sort of working on Java Virtual Machine. It still needs lots of improvements, but it can already run “Hello, world” program, what is important milestone in Rakudo for JVM.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/1e7aec467b4eb83738513f0bcb6d6ff07e89ec95&quot;&gt;You cannot create a set or bag from list of pairs or hash using a constructor.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;bag {a =&amp;gt; 2}&lt;/code&gt; was ambiguous, because it could mean either &lt;code&gt;bag&lt;/code&gt; containing &lt;code&gt;'a'&lt;/code&gt; with value &lt;code&gt;2&lt;/code&gt;, or &lt;code&gt;bag&lt;/code&gt; containg &lt;code&gt;{a =&amp;gt; 2}&lt;/code&gt; with value &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You’re expected to use &lt;code&gt;.Bag&lt;/code&gt; or &lt;code&gt;.Set&lt;/code&gt; instead, if you mean that.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/e2a36d862079acb91106f89bad8cb03e8279545d&quot;&gt;You cannot use &lt;code&gt;set&lt;/code&gt; or &lt;code&gt;bag&lt;/code&gt; to mean empty set or bag.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you really meant that, you are expected to use &lt;code&gt;set()&lt;/code&gt; or &lt;code&gt;bag()&lt;/code&gt; instead.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/fd94c282259268cc02bfc46e7a4c52488f34f927&quot;&gt;Slice adverbs support false booleans.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can write code like &lt;code&gt;%a&amp;lt;b&amp;gt; :!exists&lt;/code&gt; to check whatever the element doesn’t exist.&lt;/p&gt;

&lt;p&gt;You can also write code like &lt;code&gt;%a&amp;lt;b&amp;gt; :!delete&lt;/code&gt; which does nothing, but can be used for conditionally deleting hash keys (for example &lt;code&gt;%a&amp;lt;b&amp;gt; :delete(%a&amp;lt;c&amp;gt; :!exists)&lt;/code&gt;).&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/221b79f028ef77d1e9fec478b3d6933bf476fc9f&quot;&gt;Sets and bags use &lt;code&gt;===&lt;/code&gt; semantics.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously the specification hasn’t said which semantics should be used. As anything other than &lt;code&gt;===&lt;/code&gt; semantics would be slow, &lt;code&gt;===&lt;/code&gt; semantics are used.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/14e9ce6c8a7cb5f9f7c69d7c18b8a405031c4b33&quot;&gt;Defined &lt;code&gt;INIT&lt;/code&gt;/&lt;code&gt;END&lt;/code&gt; across modules.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/a7444d895a3641df8ee44311f3613c1612c4de33&quot;&gt;Added &lt;code&gt;FINAL&lt;/code&gt; and &lt;code&gt;COMPOSE&lt;/code&gt; phases.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;FINAL&lt;/code&gt; is ran at link time. &lt;code&gt;COMPOSE&lt;/code&gt; is ran when a role is composed into a class.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/e2a36d862079acb91106f89bad8cb03e8279545d&quot;&gt;&lt;code&gt;set&amp;lt;a b c&amp;gt;&lt;/code&gt; has special error message.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This syntax wasn’t useful for anything, except for perhaps obfuscation. It meant creating empty set, and getting keys &lt;code&gt;'a'&lt;/code&gt;, &lt;code&gt;'b'&lt;/code&gt;, and &lt;code&gt;'c'&lt;/code&gt; from it. As the empty set doesn’t have these keys, it was returning &lt;code&gt;False&lt;/code&gt; 3 times.&lt;/p&gt;

&lt;p&gt;As the behavior doesn’t make any sense, you probably wanted to use &lt;code&gt;set &amp;lt;a b c&amp;gt;&lt;/code&gt; instead. The old behavior is still accessible using &lt;code&gt;set()&amp;lt;a b c&amp;gt;&lt;/code&gt;, but I don’t think you would want to use this.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/4dc2553cbf357c3616f7e71d1c7ac2bac145c857&quot;&gt;Perl 5 grammar allows version in &lt;code&gt;require&lt;/code&gt; statement.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Perl 5, you can write code like &lt;code&gt;require 5.010&lt;/code&gt; do make runtime version check (as opposed to &lt;code&gt;use 5.010&lt;/code&gt; which is compile time check). The Perl 5 grammar, included as part of &lt;code&gt;STD.pm6&lt;/code&gt; now supports this syntax.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/9906f18ffb0e0e2cc2b685d56a1febb55ff4e014&quot;&gt;&lt;code&gt;FINAL&lt;/code&gt; and &lt;code&gt;COMPOSE&lt;/code&gt; phases is now recognized.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that these phases are in specification, the grammar was modified to recognize them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;JVM version of Rakudo supports simplest “Hello, world!” program.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/738531ae8b81805d59ebb79ec46e1f35b40efcf6&quot;&gt;Fixed infinite recursion in &lt;code&gt;IO::Spec::Unix.rel2abs&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rel2abs&lt;/code&gt; made infinite recursion if neither &lt;code&gt;$path&lt;/code&gt; or &lt;code&gt;$base&lt;/code&gt; were absolute.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/a9f3c63d3aa9854ad4e5ab05b0809659db42a0ec&quot;&gt;&lt;code&gt;infix:&amp;lt;~&amp;gt;&lt;/code&gt; is constant folded.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/0d3c9b08fd28214d34f68fb222ae39aad84c16f0&quot;&gt;&lt;code&gt;&amp;lt;prefix:&amp;lt;~&amp;gt;&lt;/code&gt; is constant folded.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/0d3c9b08fd28214d34f68fb222ae39aad84c16f0&quot;&gt;String comparison operators are constant folded.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/0d3c9b08fd28214d34f68fb222ae39aad84c16f0&quot;&gt;String bitwise operators are constant folded.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/b41219e4f001d6029e3bdb6adb69198376f0a085&quot;&gt;&lt;code&gt;defined&lt;/code&gt; is constant folded.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/17085660c99009d2901233812270b4dba246edf4&quot;&gt;&lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;KeySet&lt;/code&gt;, &lt;code&gt;Bag&lt;/code&gt;, and &lt;code&gt;KeyBag&lt;/code&gt; have &lt;code&gt;default&lt;/code&gt; method.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When reading undefined property of those classes, &lt;code&gt;default&lt;/code&gt; method contains value that you should receive. In case of sets, it’s &lt;code&gt;False&lt;/code&gt;. For bags, it’s &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/86cf85a372ddd3e23b4df74b55b6873afa72f318&quot;&gt;Regexpes support more delimiters.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, Rakudo didn’t accept regexpes like &lt;code&gt;m^42^&lt;/code&gt; or &lt;code&gt;m€cash€&lt;/code&gt;. Now, they are allowed, just like in Perl 5.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza&quot;&gt;Niecza&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/009f999b8ee82047259955f741685a263c3976a0&quot;&gt;&lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;KeySet&lt;/code&gt;, &lt;code&gt;Bag&lt;/code&gt;, and &lt;code&gt;KeyBag&lt;/code&gt; have &lt;code&gt;default&lt;/code&gt; method.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just like in Rakudo, except with Niecza.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 18 May 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jonathan Worthington (6guts): Rakudo on JVM progress update, and some questions answered</title>
	<guid>http://6guts.wordpress.com/?p=273</guid>
	<link>http://6guts.wordpress.com/2013/05/15/rakudo-on-jvm-progress-update-and-some-questions-answered/</link>
	<description>&lt;p&gt;It’s time for another progress update on the ongoing JVM work. Last time I posted here, we’d reached the point of having a self-hosting NQP ready to merge into the master branch of the NQP repository. That has now happened, so the May release of NQP will come with support for running on the JVM (note, this does &lt;strong&gt;not&lt;/strong&gt; mean the May release of Rakudo will come with this level of capability, and a JVM-based Star release with modules is further still!) . In this post, I will discuss some of the things that have happened in the last few weeks and also try to answer some of the questions left behind in the comments last time.&lt;/p&gt;
&lt;h3&gt;The Rakudo Port&lt;/h3&gt;
&lt;p&gt;With NQP pretty well ported (there are some loose ends to tie up, but it’s pretty capable), the currently ongoing step is porting Rakudo. At a high level, Rakudo breaks down into:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The core of the compiler itself: the grammar (for parsing), actions (which assign semantics to the things we parsed), world (which takes care of the declarative aspects of programs), optimizer (tries to cheat without getting caught) and a few other small pieces to support all of this. This is written in NQP.&lt;/li&gt;
&lt;li&gt;The Perl 6 MOP (meta-object protocol) implementation, which defines what classes, roles, enums, subsets and so forth mean. This is also written in NQP.&lt;/li&gt;
&lt;li&gt;The bootstrap, which uses the MOP to piece together various of the core Perl 6 types. It does Just Enough to let us start writing Perl 6 code to define the rest of the built-ins. Also written in NQP.&lt;/li&gt;
&lt;li&gt;The core setting, which is where the built-in types, operators and methods live. This is written in Perl 6.&lt;/li&gt;
&lt;li&gt;A chunk of per-VM code that does lower-level or performance-sensitive things.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first 3 of these need…an NQP compiler. And, it turns out that we have one of those hosted on the JVM these days. But could it handle compiling the Perl 6 grammar? It turns out that, after some portability improvements to the various bits of Perl 6 compiler code, the answer was a resounding “yes”. In fact, the grammar was compiled down to JVM bytecode sufficiently accurately that I didn’t encounter a single parse failure on the entire CORE.setting (though there were lots of other kinds of failures that took a lot of work – more on that in a moment). As for the rest of the compiler code, there were bits of lingering Parrot-specific stuff throughout it, but with a little work they were abstracted away. By far the hardest was BOOTSTRAP, which actually runs a huge BEGIN block to do its setup work and then pokes the results into the EXPORT package. This is kinda neat, as it means the setup work is done once when building Rakudo and then serialized. Anyway, onto the next pieces.&lt;/p&gt;
&lt;p&gt;Compiling the Perl 6 setting depends on the Perl 6 compiler working. Since the first thing the setting does is use the bootstrap, which in turn uses the MOP, it immediately brings all of the above three pieces together. While we talk about “compiling” the setting, there’s a little more to it than that. Thanks to various BEGIN time constructs – such as traits, constant declarations and, of course, BEGIN blocks – all of which show up in the CORE setting – we actually need to run chunks of the code during the compilation process. That’s right – we run bits of the file we’re in the middle of compiling while we’re compiling it. Of course, this will be nothing new to Perl folks – it’s just most Perl programmers probably don’t worry about how on earth you implement this. :-) Thankfully, it’s a solved problem in the NQP compiler toolchain, and the stuff that makes NQP BEGIN blocks work largely handles the Rakudo ones too.&lt;/p&gt;
&lt;p&gt;Anyway, all of this means that even getting the setting to finish the parse/AST phase requires doing enough to run the various traits and so forth. And that in turn brings in the fifth piece: the per-VM runtime support. This includes signature binding, container handling and a few other bits. Thankfully, it no longer involves multiple dispatch, since that is written in NQP these days (apart from some caching infrastructure, which is shared with NQP’s multiple dispatch, and thus was already done). Getting through the parse/AST phase of the setting doesn’t need all of the runtime support to be implemented, but it did require a decent chunk of it. Of course, at the start everything is missing, so getting from line 1 to line 100 was O(week), from 100 to 1000 O(day) and each thousand or so from there O(hour). It’s 13,000 or so lines in all.&lt;/p&gt;
&lt;p&gt;The parse/AST step is just the first (though biggest) phase of compiling Perl 6 code, however. Next comes the optimizer, followed by code generation. In theory, the optimizer could have been bypassed. I planned to do that, then discovered it basically worked for the set of optimizations that didn’t need signature binding to participate in the analysis, so I left it in. Code generation is part of the backend, and so is shared with NQP. So it shoulda just worked, right? Well, yes, apart from code generation is the place where nqp:: ops get resolved to lower level stuff. And Perl 6 uses a lot more of them than NQP. Note that they only have to be mapped to somewhere; the JVM is late bound enough that it won’t complain unless you actually hit the code path that tries to use something that is not yet implemented. In reality I did a bit of both: implementing those that would surely be hit soon or that were trivial, and leaving some others for later.&lt;/p&gt;
&lt;p&gt;So, some time yesterday, I finally got to the point of having a CORE.setting.class. Yup, a JVM bytecode file containing the compiled output of near enough the entire Perl 6 core setting. So, are we done yet? Oh, no way…&lt;/p&gt;
&lt;p&gt;Today’s task was trying to get the CORE setting to load. How hard could that be? Well, it turns out that it does a few tasks at startup, most of which hit upon something that wasn’t in place yet. Typically, it was more of the runtime support, though in some cases it was unimplemented nqp:: ops. Of course, there were a handful of bugs to hunt down in various places to.&lt;/p&gt;
&lt;p&gt;Anyway, finally, this evening, I managed to get the CORE setting to load, at which point, at long last, I could say:&lt;/p&gt;
&lt;pre&gt;perl6 -e &quot;say 'hello world, from the jvm'&quot;
hello world, from the jvm&lt;/pre&gt;
&lt;p&gt;Don’t get too excited just yet. It turns out that many other simple programs will happily explode, due to hitting something missing in the runtime support. There’s still plenty of work to go yet (to give you an idea, trying to say a number explodes, and a for loop hits something not yet implemented), but this is an important milestone.&lt;/p&gt;
&lt;h3&gt;Interop&lt;/h3&gt;
&lt;p&gt;A couple of the comments in response to my last post asked about interop with Java. There’s two directions to consider here: using Java libraries from Perl 6, and using Perl 6 code from Java. Both should be possible, with some marshalling cost, which we’ll no doubt need to spend some time figuring out how to get cheap enough it’s not a problem. It may well be that invokedynamic is a big help here.&lt;/p&gt;
&lt;p&gt;The Java stuff from Perl 6 direction can probably be made fairly convenient to use by virtue of the fact that Perl 6 has a nice, extensible MOP. The fact the object you’re making a call on lives in Java land can be just a detail; we can hide it behind the typical method call syntax, and should even be able to populate a 6model method cache with delegation methods that do the argument mapping. I’m sure there will be plenty of interesting options there. I suspect we’ll want to factor it a little like NativeCall – some lower level stuff in the runtime, and some higher level sugar.&lt;/p&gt;
&lt;p&gt;Going the other way will be more “fun”. I mean, on the one hand the marshalling is just “in the other direction”, which we’d need to do for values coming back from Java land anyway. But trying to work out how to make it feel nice from Java land could be trickier. I don’t believe the “.” operator is very programmable, which probably leaves us with string lookups or code-generated proxy thingies. Or maybe somebody will come up with a Really Great Solution that I hadn’t thought of.&lt;/p&gt;
&lt;p&gt;My JVM related Perl 6 dev focus for now will be getting Rakudo to work decently and start getting Perl 6 modules working on the JVM also, but interop with Java land is certainly on the roadmap of things I think should happen. As with all things, I’m delighted to be beaten to it, but will work on it if it goes undone for too long. :-)&lt;/p&gt;
&lt;h3&gt;Performance?&lt;/h3&gt;
&lt;p&gt;The first thing to say on this is that it’s too early to have a really good idea. The final pieces of the gather/take transform (which has global consequences) have yet to land, which will certainly have some negative impact and will need to happen soon. At the same time, I’ve been very much focused on making things work on the JVM at all over making them especially clever or optimal. Numerous things can be done in ways that will not only perform better in a naive sense, but that will also be much easier for the JVM’s JIT to do clever stuff with. There are many, many things we will be able to do in this area.&lt;/p&gt;
&lt;p&gt;Since I only have a sort-of-working Perl 6 compiler, I can’t say that much about Perl 6 performance. The only result I have to share is that the CORE setting parse completes in around a third of time that it does on Parrot (noting it’s not only about parsing, but also some code generation and running of stuff). This is not especially great – of course, we need to do better than that – but it’s certainly nice that the starting point before I really dig into the performance work is already a good bit faster.&lt;/p&gt;
&lt;p&gt;The other result I have is NQP related. nwc10++ has been doing performance testing with a Levenstein benchmark of each commit to the NQP JVM work, which is really great in so far as it gives me a rough idea if I accidentally regress (or improve ;-)) something performance wise. There, we saw a larger factor performance win, around 15 times faster than the same program running in NQP on Parrot.&lt;/p&gt;
&lt;p&gt;The big negative news on performance is startup time. Part of this is just the nature of the JVM, but I know another enormous part of it is inefficiencies that I can do something about. I’ve plenty of ideas – but again, let’s make things work first.&lt;/p&gt;
&lt;h3&gt;From Here&lt;/h3&gt;
&lt;p&gt;Things will be a little quieter from me over the next week and a bit, due to a busy teaching schedule. But now we have a fledgling Rakudo on JVM, and from here it’s going to be making it gradually more capable, first passing the sanity tests, then moving on to the spectests and the ecosystem. There are ways to help for the adventurous. Some ideas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Profile the code generation phase, which is one of the pieces that is slower than expected. Try to figure out why.&lt;/li&gt;
&lt;li&gt;Have a look at how multiple dispatch stuff is currently set up, and see if the dispatch logic could possibly be shuffled off behind invokedynamic.&lt;/li&gt;
&lt;li&gt;Try something. See how it explodes. See if you can fix it. (Yes, generic I know. :))&lt;/li&gt;
&lt;li&gt;Have a look at a “make install” target for Rakudo on JVM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’ll be speaking on the JVM work at the Polish Perl Workshop the weekend after next, and hope to have something a bit more interesting than “hello world” to show off by then.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/273/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/273/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=273&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 14 May 2013 23:29:33 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W19</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W19.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W19.html</link>
	<description>&lt;p&gt;So, well, what’s new. I’m going to answer - lots of changes and fixes. Even the Niecza, where lately development had slowed down got lots of fixes.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/37c7620bd6a9d45dcc452c4f468770b0bb3b7d62&quot;&gt;Array references aren’t treated as arrays in regular expressions.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Following code used to find 1, 2, or 3.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my $array = [1, 2, 3];
my $number = prompt 'Give me a number!';
say &quot;It's in array&quot; if $number ~~ / ^ $array $ /;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It doesn’t do that anymore, because variables are expected to be stringified inside regexpes. If you want the old behavior, be explicit and write &lt;code&gt;@$array&lt;/code&gt; instead of &lt;code&gt;$array&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Please note that currently regular expressions are exception to this rule. This is going to be fixed in the future. Lots of code depends on regexpes to be not stringified, and first the warnings will have to be implemented. You are expected to use &lt;code&gt;&amp;lt;$regexp&amp;gt;&lt;/code&gt; instead of &lt;code&gt;$regexp&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/20128d7c56282831893e990597cd193ae8787dce&quot;&gt;Changed &lt;code&gt;capitalize&lt;/code&gt; to &lt;code&gt;wordcase&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the current specification, that method is named &lt;code&gt;wordcase&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/b1710c17918ec10b4629ce611d8ea58a9e962ccf&quot;&gt;Removed &lt;code&gt;ucfirst&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ucfirst&lt;/code&gt; was long deprecated, and it’s finally time to remove it. You are expected to use &lt;code&gt;tc&lt;/code&gt; instead.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/2e98224d3c26fe90b93d97cb42e8bab7b10f527d&quot;&gt;Stringification of &lt;code&gt;Set&lt;/code&gt;, &lt;code&gt;KeySet&lt;/code&gt;, &lt;code&gt;Bag&lt;/code&gt;, and &lt;code&gt;KeyBag&lt;/code&gt; works properly when they are undefined.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Methods &lt;code&gt;Str&lt;/code&gt;, &lt;code&gt;gist&lt;/code&gt; and &lt;code&gt;perl&lt;/code&gt; expected they deal with defined object. This isn’t the case when dealing with the classes themselves.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/1d127e411ec6afe968b676aa1505c20d45d2ad1d&quot;&gt;Deprecated &lt;code&gt;$%&lt;/code&gt; and &lt;code&gt;$@&lt;/code&gt; variable checkers are working just like in STD.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;$@(1)&lt;/code&gt; was complaining about use of deprecated variable, when the real problem was use of invalid hard reference syntax.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/1b7852a45c9b47d229f2a4ac0c77536a1306c7a1&quot;&gt;&lt;code&gt;IO::Spec::Win32&lt;/code&gt; no longer warns when using relative pathes.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The check for initial prefix was using optional alternative (&lt;code&gt;([a | b | c])?&lt;/code&gt;). Because of that, it was &lt;code&gt;Nil&lt;/code&gt; if it matched nothing. Since the result of match was stringified just after it was matched, it returned a warning when &lt;code&gt;?&lt;/code&gt; matches nothing. It was fixed to do &lt;code&gt;([a | b | c]?)&lt;/code&gt; instead.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/6e9f45691c8c0a6e2357196484c9a7d26973f68c&quot;&gt;Added tests for &lt;code&gt;IO::Path&lt;/code&gt; and &lt;code&gt;IO::Spec&lt;/code&gt; to list of tests that should pass.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As &lt;code&gt;IO::Path&lt;/code&gt; and &lt;code&gt;IO::Spec&lt;/code&gt; were implemented, their tests are now ran when you request full test from roast test suite.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/2696aab9249fd7cdb83ebaf644c80000cc3a432e&quot;&gt;Interpolation of quotes in regexpes isn’t done twice anymore.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, quotes inside RegExpes were doing interpolation two times.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/2696aab9249fd7cdb83ebaf644c80000cc3a432e&quot;&gt;&lt;code&gt;match&lt;/code&gt; method is fast again.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;https://github.com/rakudo/rakudo/commit/c255f1df the older commits) made it 10 times slower. The performance regression was fixed, and now &lt;code&gt;match&lt;/code&gt; is as fast as it used to be.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/ad71045014a6da4fef5d5c0bff73331cd6a41712&quot;&gt;&lt;code&gt;wordcase&lt;/code&gt; method now accepts &lt;code&gt;where&lt;/code&gt; which is &lt;code&gt;Mu&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, only &lt;code&gt;Any&lt;/code&gt; values were accepted. While using &lt;code&gt;Mu&lt;/code&gt; doesn’t make much sense, there is no reason to disallow it, so it’s allowed now.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/782dec0df77b8d3f0d621de9ed06dd151e630bff&quot;&gt;Configuration instructions don’t say to use –gen-nqp.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It was pointless, since &lt;code&gt;--gen-parrot&lt;/code&gt; automatically implied &lt;code&gt;--gen-nqp&lt;/code&gt;. If you want Parrot, it’s safe to assume you want NQP for that Parrot too, right?&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/bfd8508f5ceee565380da201ef25bdfb6feb2b3d&quot;&gt;&lt;code&gt;our&lt;/code&gt; hashes and arrays work.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you had used &lt;code&gt;our @array&lt;/code&gt;, and &lt;code&gt;our %hash&lt;/code&gt;, the object wasn’t initialized properly, and it wasn’t working like array or hash. This made &lt;code&gt;our&lt;/code&gt; work only with &lt;code&gt;$scalar&lt;/code&gt;s previously.&lt;/p&gt;

&lt;p&gt;Previously, trying to use &lt;code&gt;our&lt;/code&gt; with arrays or hashes caused strange uninitialized variable to appear. It didn’t have &lt;code&gt;STORE&lt;/code&gt; method, so you couldn’t have put anything in this variable, and had &lt;code&gt;Any&lt;/code&gt; instead of empty array of hash.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/b1695cf3bb9ef32225d5862551253897f0667634&quot;&gt;It’s now possible to augment empty list.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;MONKEY_TYPING&lt;/code&gt; couldn’t be used to modify lists. Now it can.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/31f36d2a2fb76e6c819670860e2d892b25d9a397&quot;&gt;&lt;code&gt;Pair.perl&lt;/code&gt; can now deal with the cases when &lt;code&gt;Pair&lt;/code&gt; is the key.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Doing &lt;code&gt;((a =&amp;gt; 'b') =&amp;gt; 'c').perl&lt;/code&gt; used to output &lt;code&gt;&quot;a&quot; =&amp;gt; &quot;b&quot; =&amp;gt; &quot;c&quot;&lt;/code&gt;, what actually meant &lt;code&gt;(a =&amp;gt; (b =&amp;gt; 'c'))&lt;/code&gt;. &lt;code&gt;.perl&lt;/code&gt; now outputs correct code in that case.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/sorear/niecza/commit/69a3432d221934d6719ddbb4316d51f924af9149&quot;&gt;Implemented Hash.ACCEPTS.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 11 May 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: After the #masakism workshop</title>
	<guid>tag:strangelyconsistent.org,2013-05-05:blog/after-the-masakism-workshop</guid>
	<link>http://strangelyconsistent.org/blog/after-the-masakism-workshop</link>
	<description>&lt;p&gt;On May 1st I learned what happens if you tell a bunch of people on the
Internet, not all of whom you've met before, that you're going to teach Perl (5
and 6) for free on an IRC channel for four hours.&lt;/p&gt;

&lt;p&gt;It worked well. Actually, it worked well beyond my expectations.&lt;/p&gt;

&lt;h2&gt;Successes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prepare.&lt;/strong&gt; I had written a bunch of material; short-ish texts mixed with
exercises. I didn't hear any feedback about the texts, but people threw
themselves on the exercises. Which was lucky, because I basically didn't
have time to interact much with people. Everyone did their own thing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Map.&lt;/strong&gt; The week before the workshop, I was taking a walk, and it occurred
to me that the topics for the workshop should be laid out on a &lt;em&gt;subway map&lt;/em&gt;.
That turned out to work unexpectedly well. People followed the structure,
I think. The material was pretty clear that they were free to skip/jump
around if they wanted, so some did that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Github.&lt;/strong&gt; People suggested fixes and improvements to the material during
the workshop. I handled the easy ones, and delegated what could be delegated.
If anything about the workshop felt 2013-futuristic, it was the fact that
participants were hacking on the workshop &lt;em&gt;in real time&lt;/em&gt;, as it was being
played out. Github was totally right for this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tadzik++ did an exercise and got a solution that I didn't expect. We
agreed that a test was missing to force people to do the right thing,
so he went ahead and added it.&lt;/li&gt;
&lt;li&gt;LlamaRider++ added hyperlinks between all the files.&lt;/li&gt;
&lt;li&gt;grtodd++ made the subway map clickable.&lt;/li&gt;
&lt;li&gt;choroba++ added hyperlinks to a file that I added later.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Things learned&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Newbies.&lt;/strong&gt; This was never a workshop for total beginners. Still, we got
a number of those. I'm not sure how many. If there's a next time, I'll
want to add a track for the people who haven't done Perl before.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Exercises.&lt;/strong&gt; Based on the tasks that people &lt;a href=&quot;https://gist.github.com/masak/5496294&quot;&gt;actually
solved&lt;/a&gt;, I got a
lot of feedback on what worked and what didn't. Which exercises served the
overall message of the course, and which ones didn't.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Message.&lt;/strong&gt; After the workshop, I know much better what I &lt;em&gt;wanted&lt;/em&gt; the
whole thing to be about. I think I can go back and make that even more
clear. I'm still surprised at how well it worked already the first time
around... but some bits in there can certainly be improved.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Message&lt;/h2&gt;

&lt;p&gt;So... what was the real message of the workshop? What is &quot;masakism&quot;?&lt;/p&gt;

&lt;p&gt;Two things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Testing gets you far.&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;My pain threshold for writing things without tests is half a screen of
code. If I have more than that, there's probably something I should
be writing tests for.&lt;/li&gt;
&lt;li&gt;That said, there's no need to be a fundamentalist about anything. I'm
just saying that tests are good, and still somewhat undervalued
sometimes. But it's always a question on spending time testing the
stuff that matters. Of course.&lt;/li&gt;
&lt;li&gt;Even with tests, there's no substitute for knowing what you're doing
and where you're going. Tests help a lot, but they don't write the
program for you.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep it small and simple.&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&quot;Inside every big interesting problem is a small interesting problem,
struggling to get out.&quot;&lt;/li&gt;
&lt;li&gt;The realization that you can write objects that focus &lt;em&gt;entirely&lt;/em&gt; on
your core problem, is a strong one.&lt;/li&gt;
&lt;li&gt;People tend to bring in persistence too early, &quot;polluting&quot; their core
classes with database code. Hindering testability. This is backwards.&lt;/li&gt;
&lt;li&gt;Your program should be like an onion, with the most precious stuff
in the middle, and layers around that. Outer layers should point to
inner layers, but not vice versa.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Once more?&lt;/h2&gt;

&lt;p&gt;So, should we do another &lt;code&gt;#masakism&lt;/code&gt; workshop?&lt;/p&gt;

&lt;p&gt;Yes, maybe we should. People seemed to like this first one. I'm open to finding
a datetime for another one.&lt;/p&gt;

&lt;p&gt;If you have any suggestions, get in touch.&lt;/p&gt;</description>
	<pubDate>Sun, 05 May 2013 21:22:45 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W18</title>
	<guid>http://glitchmr.github.com/perl-changes-2013W18.html</guid>
	<link>http://glitchmr.github.com/perl-changes-2013W18.html</link>
	<description>&lt;p&gt;Perl 6 gets more and more stable, less features are added, and the features that are left are worked on. Also, Rakudo Perl is being ported to JVM.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/3acfeda8111674b72752bba03c9cbe02ded4c408&quot;&gt;Updated IO:: classes documentation pages.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To many minor changes to describe, just follow the link.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/2a92e084f167d7a76568b6c7aaffff6da572b140&quot;&gt;Added &lt;code&gt;IO::Spec&lt;/code&gt;, &lt;code&gt;IO::Path.cleanup&lt;/code&gt;, and &lt;code&gt;IO::Path.resolve&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/specs/commit/6e2d9c944ca5b50cef9e23b15f130a626c1c2b9e&quot;&gt;Flip flops now use smartmatch semantics instead of boolean semantics.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can write code like &lt;code&gt;&quot;BEGIN&quot; ff &quot;END&quot;&lt;/code&gt;, instead of using regexes for that.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/fa59c1b325a54b632447c1bcdb01a0e68b6bc0bd&quot;&gt;Use of &amp;amp; in infix position is now catched after whitespace.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, code like &lt;code&gt;$some-object.some-method &amp;amp;sub-routine&lt;/code&gt; appeared to work. However, it didn’t meant what you would expect, it didn’t called the method with subroutine argument, but assumed junction and. In order to avoid surprises, this is now disallowed.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/276a42f6c9602d25cd87518b0238876b6bce2f04&quot;&gt;The message about no parens or colon after method name is more specific.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now code like &lt;code&gt;$some-object.some-method 42&lt;/code&gt; shows information that colon or parens are required.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/291c7f08bd966544264332bb7c64f619f3a5cdca&quot;&gt;Added lots of function declarations.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The STD now recognizes certain functions that were added lately.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;is-prime&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;expmod&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;mkdir&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;rmdir&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;socket&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;listen&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;accept&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;connect&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;bind&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;infix:&amp;lt;leg&amp;gt;&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;infix:&amp;lt;cmp&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/perl6/std/commit/b33d8e0b99931d59e6fe4fed81f6c05443ab9e68&quot;&gt;Added &lt;code&gt;LoL&lt;/code&gt; class and &lt;code&gt;X&lt;/code&gt; role.&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/5b53365d8b774f94ccf371107e5c1544574bddcf&quot;&gt;Implemented &lt;code&gt;IO::Spec&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This class is intended to do OS-specific manipulation of pathes. It can get the localizations of special folders (for example home directory, root directory, temponary directory), and can manipulate pathes (by joining them, spliting them, converting them to absolute or relative, and so on).&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/22397c5677aa89a0dbdb631aab98454049a41a6f&quot;&gt;Implemented &lt;code&gt;IO::Path::&amp;lt;os subclasses&amp;gt;&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks to this change, the pathes objects are OS specific. You can have path marked to be Windows path, so you can parse it in OS specific way, without having to use that OS.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/08b640344cfd2de9a44afc313959a75c6568bcc5&quot;&gt;Repeated &lt;code&gt;shift&lt;/code&gt; is faster.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On large arrays, &lt;code&gt;shift&lt;/code&gt; is now noticeably faster. For example, if array &lt;code&gt;@a&lt;/code&gt; has &lt;code&gt;50_000&lt;/code&gt; elements, running following snippet of code is processed within 2.5 seconds (and not 9.0 seconds).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;@a.shift while @a;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/5edb1357bec9418a9b45d78c85290b59e3e0f821&quot;&gt;Failed regex matches now return &lt;code&gt;Nil&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previously, failed regex matches were returning the &lt;code&gt;Match&lt;/code&gt; object that stringified to &lt;code&gt;#&amp;lt;failed match&amp;gt;&lt;/code&gt; and was converted to &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/80257434650c3fd8059df2d39916eee96f2dd19b&quot;&gt;&lt;code&gt;&amp;amp;diag&lt;/code&gt; function in &lt;code&gt;Test.pm&lt;/code&gt; accepts &lt;code&gt;Mu&lt;/code&gt;.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This, I think is self explanatory. &lt;code&gt;&amp;amp;diag&lt;/code&gt; is a debugging function, outputing its argument. Forbidding &lt;code&gt;Mu&lt;/code&gt; didn’t made sense, so it’s now allowed.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/c66c428cee75dcc28dcdf5140d6903105392d9d6&quot;&gt;Exporting of subroutines now works properly.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;use Module qw(sub1 sub2)&lt;/code&gt; should now work.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/02c7fbb8d716e9f1b8eb664d1340fc4b378858eb&quot;&gt;Fixed &lt;code&gt;dir()&lt;/code&gt; to work on Windows.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This makes &lt;code&gt;panda&lt;/code&gt; work on Windows.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 04 May 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Gabor Szabo: To merge or not to merge?</title>
	<guid>http://szabgab.com/to-merge-or-not-to-merge.html</guid>
	<link>http://szabgab.com/to-merge-or-not-to-merge.html</link>
	<description>I have a problem:

Should I keep the 3 Perl Maven sites (
&lt;a href=&quot;http://perl5maven.com/&quot;&gt;Perl 5 Maven&lt;/a&gt;, 
&lt;a href=&quot;http://perl6maven.com/&quot;&gt;Perl 6 Maven&lt;/a&gt;, and
&lt;a href=&quot;http://perlmaven.com/&quot;&gt;Perl Maven&lt;/a&gt;) separate,
or should I merge them together?

Or maybe I should merge P5M into PM and leave P6M separate.


&lt;p&gt;For the full article visit &lt;a href=&quot;http://szabgab.com/to-merge-or-not-to-merge.html&quot;&gt;To merge or not to merge?&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Sun, 28 Apr 2013 18:04:29 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W17</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W17.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W17.html</link>
	<description>&lt;p&gt;Continuing, still with commit IDs.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DateTime&lt;/code&gt; doesn’t accept &lt;code&gt;Callable&lt;/code&gt; timezones anymore. &lt;a href=&quot;https://github.com/perl6/specs/commit/5692ced333&quot;&gt;5692ced333&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Renamed &lt;code&gt;IO&lt;/code&gt; to &lt;code&gt;IO::Handle&lt;/code&gt;. &lt;code&gt;IO&lt;/code&gt; itself is a role. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/2dca6ed950&quot;&gt;2dca6ed950&lt;/a&gt; &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/37c9956502&quot;&gt;37c9956502&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;DateTime&lt;/code&gt; doesn’t accept &lt;code&gt;Callable&lt;/code&gt; timezones anymore. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/71ea142406&quot;&gt;71ea142406&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Implemented &lt;code&gt;Cool.lines&lt;/code&gt;. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/0d1d1194a4&quot;&gt;0d1d1194a4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 27 Apr 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: t2: Rectangle haikus</title>
	<guid>tag:strangelyconsistent.org,2013-04-25:blog/t2-rectangle-haikus</guid>
	<link>http://strangelyconsistent.org/blog/t2-rectangle-haikus</link>
	<description>&lt;div style=&quot;background: #ded; margin: 1em; padding: 1em;&quot;&gt;&lt;code&gt;sheep hide at bad rains&lt;br /&gt;
bitterly modest slumber&lt;br /&gt;
its star to their rains&lt;br /&gt;
     -- generated by one of the t2 solutions&lt;/code&gt;&lt;/div&gt;

&lt;p&gt;How time flies. It's two months since I reviewed the first batch of
&lt;a href=&quot;http://github.com/masak/p6cc2012#readme&quot;&gt;p6cc&lt;/a&gt; solutions. I solemnly swear the
next blog post will appear sooner than that.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;## Generate rectangle haikus

Write a program that generates haikus. A haiku has three lines, where the first
and last lines have five syllables each, and the middle line has seven. For the
purpose of this exercise, each line consists only of letters and spaces.

The haikus generated have the additional requirement that each line be of equal
length. The length requirement should not be gamed in any way, for example by
padding lines with spaces.

    since this one does it
    rectangle plus a haiku
    it serves as fine text

The program should attempt to generate a new haiku each time. The haiku should
consist of English words. If the words make sense in some kind of sentence
structure, that's considered a big bonus. Humor and/or deeper meanings are even
bonuser.

If you attempt to cheat at this task, you will be defeated by people who don't.

You're free to supply your own wordlist. How you count syllables is up to you,
and part of the task. You won't be challenged on trivial differences in
syllable counts.

It's OK for the program to run for a while, but it should preferably terminate
within a reasonable span of time.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I warmly recommend people to check out &lt;a href=&quot;https://github.com/masak/p6cc2012/tree/master/t2/review&quot;&gt;the
solutions&lt;/a&gt; to this one. People are all over the place, coming up with ways to generate a rectangular haiku.&lt;/p&gt;

&lt;p&gt;Some patterns recur, though. Let's break things down into subtasks and discuss
them separately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Word lists&lt;/strong&gt;. Some contestants had their wordlists inlined in the code.
Others had it in a separate file. Some stored part-of-speech information
together with the word, or syllable count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sentence structure&lt;/strong&gt;. Solutions are all across the spectrum, all the way from
&quot;just spew words&quot;, via &quot;generate something that could perhaps pass for a
sentence&quot;, all the way to &quot;try really hard to be grammatical&quot;. In my view, being
more high-end on this bit pays off big in quality. But it also costs in code
complexity and program speed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search&lt;/strong&gt;. This is a biggie, because it bleads through into the whole design of
the program. Some of the solutions simply brute-force it. Others generate stuff
randomly but store things in a hash table, guaranteeing that eventually some
triplet of lines will form a haiku of some length. Some algorithms do clever
things here, like turning problems around, going from &quot;how many syllables does
this line have?&quot; to &quot;ok, give me a word with this many syllables&quot;. One solution
partitions the integers 5 and 7 in all possible ways, and hard-codes the
resulting table.&lt;/p&gt;

&lt;p&gt;But the really interesting bit in all solutions is the syllable counting. This
is where the participants really differ in approach. One went with porting the
CPAN module for counting syllables. Someone else did the same, but put the
module on modules.perl6.org for everyone to use. Two contestants seem to have
come up with their own (flawed) syllable-counter. A few people evade the
syllable-counting by just storing the values along with the word lists. (Which
is fine.)&lt;/p&gt;

&lt;p&gt;All in all, an interesting set of solutions to a fun problem. Somehow, after
reviewing all of these, I have the distinct feeling that a &quot;best&quot; solution
could be put together by combining the best bits of everyone's solutions. I
might just do that myself, if no-one beats me to it.&lt;/p&gt;

&lt;p&gt;Next up: arranging wire crossings to rearrange wires!&lt;/p&gt;</description>
	<pubDate>Thu, 25 Apr 2013 20:50:50 +0000</pubDate>
</item>
<item>
	<title>Carl Masak: The #masakism workshop</title>
	<guid>tag:strangelyconsistent.org,2013-04-24:blog/the-masakism-workshop</guid>
	<link>http://strangelyconsistent.org/blog/the-masakism-workshop</link>
	<description>&lt;p&gt;So, as part of my &lt;code&gt;$dayjob&lt;/code&gt;, I was teaching a Perl course. Then this happened:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;* masak is teaching Perl 5 today! :)
&amp;lt;Heather&amp;gt; masak teach me
&amp;lt;masak&amp;gt; Heather: later; these people are paying me. :P
[...]
&amp;lt;masak&amp;gt; seriously though; if there were enough interest here on IRC, I
        would totally do a 1-day Perl 5 IRC workshop, pro bono.
&amp;lt;masak&amp;gt; ditto a one-day Perl 6 IRC workshop.
&amp;lt;vaelxon&amp;gt; (Perl 6 IRC workshop)++
&amp;lt;masak&amp;gt; it'd be very awesome, I promise. I'd need some time to prepare.
        but then we can grab a channel and basically party/learn for a
        day together.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that's now what's happening. It'll be a loose-knit group of us, joining up
in the &lt;code&gt;#masakism&lt;/code&gt; IRC channel for four hours on May 1.&lt;/p&gt;

&lt;p&gt;The course will be two-pronged; Perl 5 or Perl 6, whatever people prefer.&lt;/p&gt;

&lt;p&gt;There will be prepared study material and exercises, but basically, people who
participate can go off on a tangent, just spend the four hours solving one of
the exercises really well, or solving a &lt;em&gt;different&lt;/em&gt; exercise that they make up
themselves. People can focus on doing the exercises, or on discussing various
ways to solve them, or on discussing general principles of programming. Think
of the workshop as a hybrid of people writing/showing nice code, and people
discussing programming best practices.&lt;/p&gt;

&lt;p&gt;Why am I doing this? Because as part of teaching Perl courses for &lt;code&gt;$dayjob&lt;/code&gt;, I
realized how much I &lt;em&gt;love&lt;/em&gt; teaching Perl. I literally spend those two course
days teaching Perl in a mild state of euphoria. I teach a lot of other courses,
and some of them are great to teach, but none of them are like Perl. I think
it's because I feel at home in the language, my brain has somehow &quot;shaped
itself&quot; around Perl, and the questions I get can often be answered with a
happy &quot;let's find out!&quot; where (a) we do some quick experiment in a terminal
window, and (b) I tend to know what we'll get before, so it's easy to explain.&lt;/p&gt;

&lt;p&gt;The whipuptitude of Perl really works to one's advantage there. That, combined
with knowing my way around most of the &lt;code&gt;perldoc&lt;/code&gt; pages and most of the special
variables. Oh, and I probably have a slight advantage being fairly deeply
involved in Perl 6 stuff, too.&lt;/p&gt;

&lt;p&gt;Anyway, I absolutely love teaching Perl. Five and six. So much so that I'd
do it for free. So this is me doing it for free.&lt;/p&gt;

&lt;p&gt;As I write this, there are 13 participants signed up for the course. This is
already twice as big as the typical Perl course I teach in a corporate setting.
It's also a wide range of people; from relative newbies to people who could
probably give the workshop better than me. I expect people further up on the
learning curve to step in and assist with people further down. But I hardly
need to say that; this is Perl, and we're a helpful bunch.&lt;/p&gt;

&lt;p&gt;Here's &lt;a href=&quot;https://gist.github.com/masak/5431185&quot;&gt;more info about the workshop&lt;/a&gt;,
including when, where, what, and how to sign up.&lt;/p&gt;</description>
	<pubDate>Wed, 24 Apr 2013 22:37:50 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W16</title>
	<guid>http://glitchmr.github.com/-perl-6-changes-2013W16.html</guid>
	<link>http://glitchmr.github.com/-perl-6-changes-2013W16.html</link>
	<description>&lt;p&gt;It’s sixteen article in the series. The game goes so fast, and I still haven’t done pagination on my website (lazy as always). The scrollbar is still shorter (1 pixel on my PC) than on Planet Six, but most likely because of longer lines.&lt;/p&gt;&lt;p&gt;NQP was bootstrapped on JVM. That means it can compile itself. It still doesn’t support Perl 6 perfectly, because some code still uses &lt;code&gt;pir::&lt;/code&gt;, but it progressed really far. Also, the new version of Rakudo Perl, 2013.04 “Albany” was released. Every improvement mentioned here, is in.&lt;/p&gt;&lt;p&gt;I’ve decided to experiment with commit links this time. This way, you can click (or press, or whatever, depends on your device, to get code of this change).&lt;/p&gt; id='potentially_incompatible_changes'&amp;gt;Potentially incompatible changes&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Removed &lt;code&gt;IO::Dir&lt;/code&gt; and &lt;code&gt;IO::File&lt;/code&gt; classes. &lt;a href=&quot;https://github.com/perl6/specs/commit/fb25fa47585436c8f1d9e227f86e3de537e62cb1&quot;&gt;fb25fa475854&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IO::Path&lt;/code&gt; is closer to actual spec. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/24532aca13377bad63c57e428bb2a4c36ecf536f&quot;&gt;24532aca13&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;Bool&lt;/code&gt; method to &lt;code&gt;Capture&lt;/code&gt;. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/9f873d89e3538e8cc8c9c41cbc9abd6f78e6499b&quot;&gt;9f873d89e3&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;List.ACCEPTS&lt;/code&gt; now has special &lt;code&gt;Whatever&lt;/code&gt; handling. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/f17d339185c95e4b3b17230cb9b93032578e2a53&quot;&gt;f17d339185&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;do...for&lt;/code&gt; doesn’t propose &lt;code&gt;repeat...for&lt;/code&gt; now. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/41a92e808ebc8d70eda169f549f9ece869019708&quot;&gt;41a92e808e&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;Documented build memory requirements (1GB of memory). &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/4109be8905860adf8369b51808c8e9d93970dfca&quot;&gt;4109be8905&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;code&gt;require PATH|$variable|Module:file(PATH)&lt;/code&gt; syntaxes are now accepted. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/c946d0f7f715a8420917e518b9d7cad608519062&quot;&gt;c946d0f7f7&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;Removed reporting variable name for uninitialized variable warnings because it was producing too many false positives. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/c39b887388d85c70e0a2a17de8cdacf751461c7d&quot;&gt;c39b887388&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;Replaced more &lt;code&gt;pir::&lt;/code&gt; to &lt;code&gt;nqp::&lt;/code&gt;. In particular, getting env variables is now done using NQP, not Parrot directly. &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/e9e1b5d9625d400453b922aca36417e96c040945&quot;&gt;e9e1b5d962&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 20 Apr 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jonathan Worthington (6guts): NQP on JVM bootstrapped, soon will land in NQP master</title>
	<guid>http://6guts.wordpress.com/?p=269</guid>
	<link>http://6guts.wordpress.com/2013/04/18/nqp-on-jvm-bootstrapped-soon-will-land-in-nqp-master/</link>
	<description>&lt;p&gt;The work to get NQP running and bootstrapped on the JVM has reached an interesting milestone, and I thought I’d take a few moments from working on it to talk about what has taken place since my last post here, as well as taking a look at what will be coming next.&lt;/p&gt;
&lt;h3&gt;Getting NQP on JVM Bootstrapped&lt;/h3&gt;
&lt;p&gt;When I last posted here, I had reached the point of having an NQP cross-compiler to the JVM that covered quite a lot of NQP’s language features. Cross-compilation meant using NQP on Parrot to parse NQP source, build an AST, and then turn the AST into a kind of JVM assembly language. This in turn was then transformed into a JVM bytecode file by a small tool written in Java, which could then be executed on the JVM.&lt;/p&gt;
&lt;p&gt;Since the last post, the cross-compiler became capable of cross-compiling NQP itself. This meant taking the NQP source files and using the cross-compiler to produce an NQP that would run on the JVM – without depending on Parrot. This also enabled support for eval-like scenarios. I reached this stage last month; the work involved tracking down a range of bugs, implementing some missing features, and doing a little more work to improve NQP’s portability. So, we had an NQP that ran on the JVM. Port done? Well, not quite.&lt;/p&gt;
&lt;p&gt;A little vacation later, I dug into the next stage: making NQP on the JVM able to compile (and thus reproduce) itself. While I’d already implemented the deserialization used to persist meta-objects (representing classes, grammars and so forth), for this next step I had to implement the serialization side of things. Thankfully, there are a bunch of tests for this, so this was largely “just” a matter of working through making them pass. Finally, it was time to work through the last few problems, and get NQP on JVM able to build the NQP sources – and therefore able to compile new versions of itself. I decided to do this work as part of moving the JVM support into the main NQP repository.&lt;/p&gt;
&lt;p&gt;Since we’ve only had NQP running on one backend (Parrot) up until now, certain aspects of the repository structure were not ideal. Before starting to bring in the JVM support, I first did a little bit of reorganization to segregate the VM specific components from the VM independent ones. Happily, much of NQP’s implementation falls into the latter category. Next came gradually building up the bootstrapping build process, working a file at a time, tracking down any issues that came up. This was a little tedious, especially given a couple of the problems were separate compilation leakages (where things from the running compiler would get confused with the version of the compiler that it was compiling). It was pretty clear that this was the problem from the errors I was seeing, but such problems show up long after things actually go wrong, requiring some careful analysis to hunt down. With those leaks plugged, and a few other relatively small bugs fixed, I had a working NQP on JVM…compiled by NQP on JVM.&lt;/p&gt;
&lt;p&gt;The work from there has been to fill out the rest of the build process, adding in the second bootstrap stage and the test targets. The good news: the NQP produced by NQP on JVM passes all the tests that the original cross-compiled version did, so we’ve got no regressions there as a result of the bootstrap.&lt;/p&gt;
&lt;p&gt;This work is currently sat in the jvm-support branch of the NQP repository. After the upcoming NQP release, it will be merged.&lt;/p&gt;
&lt;h3&gt;Supporting invokedynamic&lt;/h3&gt;
&lt;p&gt;Amongst all of this progress, we’ve also gained infrastructure to support using the invokedynamic instruction. This is a mechanism that enables those implementing non-Java languages on the JVM to teach its JIT about how their dispatch works. Most of the hard work here was done by donaldh++. I’d initially built things using BCEL in order to do code generation. While it served well up to a point, it turns out that &lt;a href=&quot;http://asm.ow2.org/&quot;&gt;ASM&lt;/a&gt; has much better support for invokedynamic, as well as being a little faster. So, donaldh got things switched over, and I soon was able to emit invokedynamic.&lt;/p&gt;
&lt;p&gt;So far, we are not using it a great deal (just for making QAST::WVal compile to something a bit – or potentially a lot – cheaper), but in the future it will be used for things you’d typically think of as invocations (sub and method calls). I’ll write in more detail about it as things evolve.&lt;/p&gt;
&lt;h3&gt;What next?&lt;/h3&gt;
&lt;p&gt;With NQP now ported, the focus will fall on Rakudo itself. Quite a lot of preparations have already been made; for example, many pir:: ops have been replaced with nqp:: ones, multiple dispatch has been ported to NQP from C (fixing some bugs along the way), the way HLL boundaries work has been updated to cope with a fully-6model world (this also let me fix a long-standing introspection bug).&lt;/p&gt;
&lt;p&gt;The path through getting Rakudo ported will largely follow the build order. This means starting with the module loader, then the compiler, followed by the MOP and its bootstrapping. After that comes the setting – the place where the built-ins live. There’s around 13,650 lines worth of that, so of course I expect to take it a little at a time. :-) I’ll try to remember to get a progress update here in a couple of weeks time.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/269/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/269/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=269&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 18 Apr 2013 16:37:13 +0000</pubDate>
</item>
<item>
	<title>Moritz Lenz (Perl 6): The REPL trick</title>
	<guid>http://perlgeek.de/blog-en/perl-6/2013-repl-trick.html</guid>
	<link>http://perlgeek.de/blog-en/perl-6/2013-repl-trick.html</link>
	<description>&lt;p&gt;A recent &lt;a href=&quot;http://irclog.perlgeek.de/perl6/2013-04-15#i_6706783&quot;&gt;discussion on
IRC&lt;/a&gt; prompted me to share a small but neat trick with you.&lt;/p&gt;

&lt;p&gt;If there are things you want to do quite often in the Rakudo
REPL (the interactive &quot;Read-Evaluate-Print Loop&quot;), it makes sense to create a
shortcut for them. And creating shortcuts for often-used stuff is what
programming languages excel at, so you do it right in Perl module:&lt;/p&gt;

&lt;pre&gt;&lt;span class=&quot;synPreProc&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;v&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;synStatement&quot;&gt;module&lt;/span&gt; REPLHelper&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;synStatement&quot;&gt;sub&lt;/span&gt; p(Mu &lt;span class=&quot;synStatement&quot;&gt;\x&lt;/span&gt;) &lt;span class=&quot;synIdentifier&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;export&lt;/span&gt; {
    &lt;span class=&quot;synStatement&quot;&gt;x.^&lt;/span&gt;mro&lt;span class=&quot;synStatement&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;*.^&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;
}

&lt;/pre&gt;

&lt;p&gt;I have placed mine in &lt;code&gt;$HOME/.perl6/repl&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And then you make sure it's loaded automatically:&lt;/p&gt;

&lt;pre&gt;$ alias p6repl=&quot;perl6 -I$HOME/.perl6/repl/ -MREPLHelper&quot;
$ p6repl
&amp;gt; p Int
Int Cool Any Mu
&amp;gt;
&lt;/pre&gt;

&lt;p&gt;Now you have a neat one-letter function which tells you the parents of an
object or a type, in method resolution order. And a way to add more shortcuts
when you need them.&lt;/p&gt;</description>
	<pubDate>Thu, 18 Apr 2013 04:54:42 +0000</pubDate>
</item>
<item>
	<title>perl6.announce: Parrot 5.3.0 &quot;W00tstock Parrot&quot; Released! by Bruce Gray</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2013/04/msg693.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2013/04/msg693.html</link>
	<description>We are stardust.&lt;br /&gt;Billion year old carbon.&lt;br /&gt;We are golden.&lt;br /&gt;Caught in the devil's bargain&lt;br /&gt;And we've got to get ourselves back to the garden.&lt;br /&gt;(To some semblance of a garden.)&lt;br /&gt;   -- &quot;Woodstock&quot;, by Joni Mitchell&lt;br /&gt;&lt;br /&gt;On behalf of the Parrot team, I'm proud to announce Parrot 5.3.0, also known&lt;br /&gt;as &quot;W00tstock Parrot&quot;.  Parrot (http://parrot.org/) is a virtual machine aimed&lt;br /&gt;at running all dynamic languages, and currently focusing on Perl 6.&lt;br /&gt;&lt;br /&gt;Parrot 5.3.0 is available on Parrot's FTP site&lt;br /&gt;(ftp://ftp.parrot.org/pub/parrot/releases/devel/5.3.0/), or by following the&lt;br /&gt;download instructions at http://parrot.org/download.  For those who would like&lt;br /&gt;to develop on Parrot, or help develop Parrot itself, we recommend using Git to&lt;br /&gt;retrieve the source code to get the latest and best Parrot code.&lt;br /&gt;&lt;br /&gt;Parrot 5.3.0 News:&lt;br /&gt;   - Build&lt;br /&gt;       + Files generated by `make cover` are now correctly cleaned by `make`&lt;br /&gt;         and ignored by `git`.&lt;br /&gt;   - Tests&lt;br /&gt;       + Internal testing of the Configure probe for Fink now works correctly&lt;br /&gt;         with the --verbose flag.&lt;br /&gt;       + Tests added for .sort method of ResizableFloatArray and&lt;br /&gt;         ResizableIntegerArray. [GH #926], [GH #927]&lt;br /&gt;       + Benchmarks added for .sort methods of various Array objects.&lt;br /&gt;         [GH #175]&lt;br /&gt;       + Coverage analysis added for pbc_disassemble.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SHA256 message digests for the downloadable tarballs are:&lt;br /&gt;79d6f1fe20645b0afbc496cd0d7850a78b8940230e7637c5356d780f5aa1750b parrot-5.3.0.tar.gz&lt;br /&gt;4cff32521c79d8a783ad57d9a13e205ea3c1b1585085e0da80138b58b77d0ed5 parrot-5.3.0.tar.bz2&lt;br /&gt;&lt;br /&gt;Many thanks to all our contributors for making this possible, and our sponsors&lt;br /&gt;for supporting this project.  Our next scheduled release is 21 May 2013.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Wed, 17 Apr 2013 19:53:19 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W15</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W15.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W15.html</link>
	<description>&lt;p&gt;I apologize I forgot about Perl 6 changes article yesterday. This ought not to happen, but it did. As for reason why it happened, well, I guess I will tell you anyway - it’s &lt;a href=&quot;https://minecraft.net/&quot; title=&quot;Minecraft&quot;&gt;that game&lt;/a&gt;.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Parcel&lt;/code&gt;s are allowed to have 0 elements.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.DUMP&lt;/code&gt; method can detect recursion for hashes.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;ForeignCode&lt;/code&gt; for non-Perl 6 code objects (like C code).&lt;/li&gt;

&lt;li&gt;Removed lots of &lt;code&gt;pir::&lt;/code&gt; usage for JVM port of Rakudo.&lt;/li&gt;

&lt;li&gt;Semicolon after keyword that takes a block, like &lt;code&gt;PRE ;&lt;/code&gt; now has specific error message.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;symlink&lt;/code&gt; and &lt;code&gt;link&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;require&lt;/code&gt; can take paths.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Added special cases for &lt;code&gt;big_pow&lt;/code&gt; when either of values is &lt;code&gt;-1&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt;, or &lt;code&gt;1&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sun, 14 Apr 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W14</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W14.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W14.html</link>
	<description>&lt;p&gt;You may have noticed may page went down for some time. This appears to be connected to &lt;a href=&quot;https://github.com/blog/1452-new-github-pages-domain-github-io&quot; title=&quot;GitHub blog - New GitHub Pages domain: github.io&quot;&gt;newest domain change&lt;/a&gt;. In order to be more… modern, I’ve moved the repository to &lt;code&gt;glitchmr.github.io&lt;/code&gt;, but that made entire page to go down. I apologize for inconvience, but it didn’t affected Planet Six, so I think it’s fine.&lt;/p&gt;&lt;p&gt;As always, I’m going to describe changes in Perl 6.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Renamed &lt;code&gt;weekday-of-month&lt;/code&gt; to &lt;code&gt;day-of-week-in-month&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Fixed signature of &lt;code&gt;Pod::Block.gist&lt;/code&gt;, so it works properly with &lt;code&gt;multi&lt;/code&gt;s.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;for&lt;/code&gt; loops are eager now.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;Buf.perl&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Fixed &lt;code&gt;Buf.gist&lt;/code&gt;, so it works properly with &lt;code&gt;multi&lt;/code&gt;s.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 06 Apr 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Moritz Lenz (Perl 6): Rakudo's Abstract Syntax Tree</title>
	<guid>http://perlgeek.de/blog-en/perl-6/2013-rakudos-abstract-syntax-tree.html</guid>
	<link>http://perlgeek.de/blog-en/perl-6/2013-rakudos-abstract-syntax-tree.html</link>
	<description>&lt;p&gt;After or while a compiler parses a program, the compiler usually translates
the source code into a tree format called &lt;em&gt;Abstract Syntax Tree&lt;/em&gt;, or
&lt;em&gt;AST&lt;/em&gt; for short.&lt;/p&gt;

&lt;p&gt;The optimizer works on this program representation, and then the code
generation stage turns it into a format that the platform underneath it
can understand. Actually I wanted to write about the optimizer, but noticed
that understanding the AST is crucial to understanding the optimizer, so let's
talk about the AST first.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;http://rakudo.org/&quot;&gt;Rakudo Perl 6 Compiler&lt;/a&gt; uses an AST
format called &lt;em&gt;QAST&lt;/em&gt;. QAST nodes derive from the common superclass
&lt;code&gt;QAST::Node&lt;/code&gt;, which sets up the basic structure of all QAST
classes. Each QAST node has a list of child nodes, possibly a hash map for
unstructured annotations, an attribute (confusingly) named &lt;code&gt;node&lt;/code&gt;
for storing the lower-level parse tree (which is used to extract line numbers
and context), and a bit of extra infrastructure.&lt;/p&gt;

&lt;p&gt;The most important node classes are the following:&lt;/p&gt;

&lt;dl&gt;
    &lt;dt&gt;QAST::Stmts&lt;/dt&gt;
    &lt;dd&gt;A list of statements. Each child of the node is considered a separate
    statement.&lt;/dd&gt;
    &lt;dt&gt;QAST::Op&lt;/dt&gt;
    &lt;dd&gt;A single operation that usually maps to a primitive operation of the
    underlying platform, like adding two integers, or calling a routine.&lt;/dd&gt;
    &lt;dt&gt;QAST::IVal, QAST::NVal, QAST::SVal&lt;/dt&gt;
    &lt;dd&gt;Those hold integer, float (&quot;numeric&quot;) and string constants
    respectively.&lt;/dd&gt;
    &lt;dt&gt;QAST::WVal&lt;/dt&gt;
    &lt;dd&gt;Holds a reference to a more complex object (for example a class) which
    is serialized separately.&lt;/dd&gt;
    &lt;dt&gt;QAST::Block&lt;/dt&gt;
    &lt;dd&gt;A list of statements that introduces a separate lexical scope.&lt;/dd&gt;
    &lt;dt&gt;QAST::Var&lt;/dt&gt;
    &lt;dd&gt;A variable&lt;/dd&gt;
    &lt;dt&gt;QAST::Want&lt;/dt&gt;
    &lt;dd&gt;A node that can evaluate to different child nodes, depending on the
    context it is compiled it.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;To give you a bit of a feel of how those node types interact, I want to
give a few examples of Perl 6 examples, and what AST they could produce. (It
turns out that Perl 6 is quite a complex language under the hood, and usually
produces a more complicated AST than the obvious one; I'll ignore that for
now, in order to introduce you to the basics.)&lt;/p&gt;

&lt;h2&gt;Ops and Constants&lt;/h2&gt;

&lt;p&gt;The expression &lt;code&gt;23 + 42&lt;/code&gt; could, in the simplest case, produce
this AST:&lt;/p&gt;

&lt;pre&gt;QAST::Op.new(
    :op('add'),
    QAST::IVal.new(:value(23)),
    QAST::IVal.new(:value(42)),
);
&lt;/pre&gt;

&lt;p&gt;Here an &lt;code&gt;QAST::Op&lt;/code&gt; encodes a primitive operation, an addition of
two numbers. The &lt;code&gt;:op&lt;/code&gt; argument specifies which operation to use.
The child nodes are two constants, both of type &lt;code&gt;QAST::IVal&lt;/code&gt;, which
hold the operands of the low-level operation &lt;code&gt;add&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now the low-level &lt;code&gt;add&lt;/code&gt; operation is not polymorphic, it always
adds two floating-point values, and the result is a floating-point value
again. Since the arguments are integers and not floating point values, they
are automatically converted to float first. That's not the desired semantics for Perl 6; actually the operator
&lt;code&gt;+&lt;/code&gt; is implemented as a subroutine of name
&lt;code&gt;&amp;amp;infix:&amp;lt;+&amp;gt;&lt;/code&gt;, so the real generated code is closer to&lt;/p&gt;

&lt;pre&gt;QAST::Op.new(
    :op('call'),
    :name('&amp;amp;infix:&amp;lt;+&amp;gt;'),    # name of the subroutine to call
    QAST::IVal.new(:value(23)),
    QAST::IVal.new(:value(42)),
);
&lt;/pre&gt;

&lt;h2&gt;Variables and Blocks&lt;/h2&gt;

&lt;p&gt;Using a variable is as simple as writing
&lt;code&gt;QAST::Var.new(:name('name-of-the-variable'))&lt;/code&gt;, but it must be declared
first. This is done with &lt;code&gt;QAST::Var.new(:name('name-of-the-variable'),
    :decl('var'), :scope('lexical'))&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But there is a slight caveat: in Perl 6 a variable is always scoped to a
block. So while you can't ordinarily mention a variable prior to its
declaration, there are indirect ways to achieve that (lookup by name, and
&lt;code&gt;eval()&lt;/code&gt;, to name just two).&lt;/p&gt;

&lt;p&gt;So in Rakudo there is a convention to create &lt;code&gt;QAST::Block&lt;/code&gt; nodes
with two &lt;code&gt;QAST::Stmts&lt;/code&gt; children. The first holds all the
declarations, and the second all the actual code. That way all the declaration
always come before the rest of the code.&lt;/p&gt;

&lt;p&gt;So &lt;code&gt;my $x = 42; say $x&lt;/code&gt; compiles to roughly this:&lt;/p&gt;

&lt;pre&gt;QAST::Block.new(
    QAST::Stmts.new(
        QAST::Var.new(:name('$x'), :decl('var'), :scope('lexical')),
    ),
    QAST::Stmts.new(
        QAST::Op.new(
            :op('p6store'),
            QAST::Var.new(:name('$x')),
            QAST::IVal.new(:value(42)),
        ),
        QAST::Op.new(
            :op('call'),
            :name('&amp;amp;say'),
            QAST::Var.new(:name('$x')),
        ),
    ),
);
&lt;/pre&gt;

&lt;h2&gt;Polymorphism and QAST::Want&lt;/h2&gt;

&lt;p&gt;Perl 6 distinguishes between native types and reference types. Native types
are closer to the machine, and their type name is always lower case in Perl
6.&lt;/p&gt;

&lt;p&gt;Integer literals are polymorphic in that they can be either a native
&lt;code&gt;int&lt;/code&gt; or a &quot;boxed&quot; reference type &lt;code&gt;Int&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To model this in the AST, &lt;code&gt;QAST::Want&lt;/code&gt; nodes can contain
multiple child nodes. The compile-time context decides which of those is
acutally used.&lt;/p&gt;

&lt;p&gt;So the integer literal &lt;code&gt;42&lt;/code&gt; actually produces not just a simple
&lt;code&gt;QAST::IVal&lt;/code&gt; node but rather this:&lt;/p&gt;

&lt;pre&gt;QAST::Want.new(
    QAST::WVal(Int.new(42)),
    'Ii',
    QAST::Ival(42),
)
&lt;/pre&gt;

&lt;p&gt;(Note that &lt;code&gt;Int.new(42)&lt;/code&gt; is just a nice notation to indicate a
boxed integer object; it doesn't quite work like this in the code that
translate Perl 6 source code into ASTs).&lt;/p&gt;

&lt;p&gt;The first child of a &lt;code&gt;QAST::Want&lt;/code&gt; node is the one used by
default, if no other alternative matches. The comes a list where the elements
with odd indexes  are format specifications (here &lt;code&gt;Ii&lt;/code&gt; for
integers) and the elements at even-side indexes are the AST to use in that
case.&lt;/p&gt;

&lt;p&gt;An interesting format specification is &lt;code&gt;'v'&lt;/code&gt; for void context,
which is always chosen when the return value from the current expression isn't
used at all. In Perl 6 this is used to eagerly evaluate lazy lists that are
used in void context, and for several optimizations.&lt;/p&gt;</description>
	<pubDate>Mon, 01 Apr 2013 00:22:59 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W13</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W13.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W13.html</link>
	<description>&lt;p&gt;The month is coming to end, and with that, I’m going to make yet another list of changes.&lt;/p&gt; id='new_features_like_anything_is_other_than_that'&amp;gt;New features (like anything is other than that)&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Added many &lt;code&gt;IO::Path&lt;/code&gt; methods: &lt;code&gt;.contents&lt;/code&gt;, &lt;code&gt;.is-absolute&lt;/code&gt;, &lt;code&gt;.is-relative&lt;/code&gt;, &lt;code&gt;.absolute&lt;/code&gt;, and &lt;code&gt;.relative&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;.path&lt;/code&gt; is now NOP that returns itself. For its previous behavior, use &lt;code&gt;.Str&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Changed &lt;code&gt;Numeric.conjugate&lt;/code&gt; to &lt;code&gt;Numeric.conj&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;+(23..2300000000)&lt;/code&gt; is optimized.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;--help&lt;/code&gt; reports &lt;code&gt;-I&lt;/code&gt; and &lt;code&gt;-M&lt;/code&gt; options.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 30 Mar 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Tadeusz Sośnierz (tadzik): Polish Perl Workshop status update</title>
	<guid>http://ttjjss.wordpress.com/?p=225</guid>
	<link>http://ttjjss.wordpress.com/2013/03/27/polish-perl-workshop-status-update/</link>
	<description>&lt;p&gt;Exactly two months remain until Polish Perl Workshop this year. In case you didn’t know, I’m shamelessly reposting the &lt;a href=&quot;http://act.yapc.eu/plpw2013/news/1006&quot;&gt;status update from our ACT website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We’ve got the first sponsor offers, and about 15 talk submissions so far. Awesome! However, as we are well aware that most of you will wait to submit talks until there’s less than 2 days until the deadline (or later :)) I’m hereby announcing: &lt;strong&gt;The talk submission deadline for Polish Perl Workshop 2013 is 14 of April&lt;/strong&gt;. That’s about two weeks to finally make up your mind and submit something. Please do! There’ll be only one chance to talk at the First Polish Perl Workshop: there’ll be no other :)&lt;/p&gt;
&lt;p&gt;Of course, if you’d prefer to organize more of a hands-on event, we have the entire sunday dedicated to hackathon, BoFs, classes etc. If you want to submit something more lenghty, that’s the right way to do it.&lt;/p&gt;
&lt;p&gt;In other interesting news, we started looking at conference t-shirts (yes, they’re free for all attendees). We have something on our mind that never happened before on a Perl conference (or at least I’ve never seen or heard of something like this). We’ll keep you informed.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/ttjjss.wordpress.com/225/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/ttjjss.wordpress.com/225/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=ttjjss.wordpress.com&amp;amp;blog=15099040&amp;amp;post=225&amp;amp;subd=ttjjss&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 27 Mar 2013 11:56:41 +0000</pubDate>
</item>
<item>
	<title>perl6.announce: Parrot 5.2.0 &quot;Stuffed Parrot&quot; Released! by Bruce Gray</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2013/03/msg692.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2013/03/msg692.html</link>
	<description>I am not dead yet                               I can dance and I can sing&lt;br /&gt;I am not dead yet                              I can do the Highland Fling&lt;br /&gt;I am not dead yet                                     No need to go to bed&lt;br /&gt;No need to call the doctor                          Cause I'm not yet dead&lt;br /&gt;    -- Spamalot&lt;br /&gt;&lt;br /&gt;On behalf of the Parrot team, I'm proud to announce Parrot 5.2.0, also known&lt;br /&gt;as &quot;Stuffed Parrot&quot;.  Parrot (http://parrot.org/) is a virtual machine aimed&lt;br /&gt;at running all dynamic languages.&lt;br /&gt;&lt;br /&gt;Parrot 5.2.0 is available on Parrot's FTP site&lt;br /&gt;(ftp://ftp.parrot.org/pub/parrot/releases/devel/5.2.0/), or by following the&lt;br /&gt;download instructions at http://parrot.org/download.  For those who would like&lt;br /&gt;to develop on Parrot, or help develop Parrot itself, we recommend using Git to&lt;br /&gt;retrieve the source code to get the latest and best Parrot code.&lt;br /&gt;&lt;br /&gt;Parrot 5.2.0 News:&lt;br /&gt;    - Core&lt;br /&gt;        + IO now only syncs buffers for the IO types where syncing makes sense.&lt;br /&gt;            = PIO_VF_SYNC_IO flag added&lt;br /&gt;    - Build&lt;br /&gt;        + installable_pdump now has the correct rpath (blib corrected to lib).&lt;br /&gt;    - Libraries&lt;br /&gt;        + Tcl/Glob.pir has been removed. (PGE/Glob.pir remains intact)&lt;br /&gt;    - Ecosystem&lt;br /&gt;        + All Parrot tarballs are now symlinked to the 'all' directory,&lt;br /&gt;          regardless of their true homes ('devel' or 'stable'), to better&lt;br /&gt;          allow for automated downloads.&lt;br /&gt;            ftp://ftp.parrot.org/pub/parrot/releases/all/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SHA256 message digests for the downloadable tarballs are:&lt;br /&gt;1245d11f2b2ea44e6465aff6da5a533324d69b6eb3ddf7d84e81385ea95150ad parrot-5.2.0.tar.gz&lt;br /&gt;0c538d780f9c70c510e142a8a663c30474125c9fcf9fe25d2129e68fc7baec8d parrot-5.2.0.tar.bz2&lt;br /&gt;&lt;br /&gt;Many thanks to all our contributors for making this possible, and our sponsors&lt;br /&gt;for supporting this project.  Our next scheduled release is 16 Apr 2013.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;-- &lt;br /&gt;Bruce Gray (Util of PerlMonks)&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Sun, 24 Mar 2013 13:58:55 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W12</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W12.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W12.html</link>
	<description>&lt;p&gt;I really should optimize my blog layout, so empty intro wouldn’t be ugly. But I guess I’m too lazy to do it right now, so I have to explain stuff. Every week, I list the list of changes in Perl 6 specifications, and its implementations. That’s just everything, boring, I know. Still, it doesn’t look that bad on Planet Six, so I guess I will continue to make these articles :-).&lt;/p&gt;&lt;p&gt;This week, the Rakudo 2013.03 was released. Every change mentioned here was implemented in it.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;X::Range::InvalidArg&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Removed lots of &lt;code&gt;pir::&lt;/code&gt; usage.&lt;/li&gt;

&lt;li&gt;Multi dispatch is now implemented in NQP, not C.&lt;/li&gt;

&lt;li&gt;Released Rakudo 2013.03.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 23 Mar 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Perl 6 Maven: Reading from a file in Perl 6</title>
	<guid>http://perl6maven.com/reading-from-a-file-in-perl6</guid>
	<link>http://perl6maven.com/reading-from-a-file-in-perl6</link>
	<description>&lt;p&gt;
It can be interesting to do operations on existing data structures in Perl 6, but without Input and Output,
that would have limited usability in the real world.
&lt;/p&gt;&lt;p&gt;
Therefore reading from files is a critical operation.
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description>
	<pubDate>Tue, 19 Mar 2013 20:52:02 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W11</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W11.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W11.html</link>
	<description>&lt;p&gt;I would put nothing here, but the layout of blog would make this look ugly. So, well, like usually I put something here, even if it is meaningless. Just look below to see list of changes.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Closing brace, followed by newline and infix operator was parsed incorrectly. For example, following code.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my %a;
{ }
%a&amp;lt;b&amp;gt; = 1;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Was parsed like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my %a;
{ } % a()&amp;lt;b&amp;gt; = 1;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Instead of correct.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my %a;
{ };
%a&amp;lt;b&amp;gt; = 1;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Done more &lt;code&gt;pir::&lt;/code&gt; to &lt;code&gt;nqp::&lt;/code&gt; replacements in order to help JVM port of Rakudo Perl.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Case insensitive matches with strings now work.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my $nonsense = 'asdf';
say &quot;OK&quot; if &quot;ADSF&quot; ~~ m:i/$nonsense/;&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Typing &lt;code&gt;else if&lt;/code&gt; and &lt;code&gt;elif&lt;/code&gt; after &lt;code&gt;if&lt;/code&gt; block shows “Please use ‘elsif’” error message.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;code&gt;&amp;amp;?ROUTINE&lt;/code&gt; variable is available inside &lt;code&gt;regex foo { ... }&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;The named params are optimized in compile time when possible.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;code&gt;X::Method::NotFound&lt;/code&gt; is raised even when dealing with &lt;code&gt;&quot;&quot;&lt;/code&gt; (empty) method names.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Fixed proto of &lt;code&gt;infix:&amp;lt;ne&amp;gt;&lt;/code&gt; in order to require &lt;code&gt;Mu&lt;/code&gt; objects.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;code&gt;Stash.at_key&lt;/code&gt; method now works.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Postcircumfix calls can be cached now.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;code&gt;LEAVE&lt;/code&gt; is now fired on &lt;code&gt;next&lt;/code&gt;/&lt;code&gt;last&lt;/code&gt; in &lt;code&gt;MapIter&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Exception is thrown when &lt;code&gt;Range&lt;/code&gt; endpoint is used to create a Range.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Empty.gist&lt;/code&gt; returns nothing.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 16 Mar 2013 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Perl 6 Maven: Getting started with Rakudo * (2013.01) on Windows</title>
	<guid>http://perl6maven.com/getting-started-with-rakudo-star-2013-01-on-windows</guid>
	<link>http://perl6maven.com/getting-started-with-rakudo-star-2013-01-on-windows</link>
	<description>&lt;p&gt;
After a break of several months, I rebuild Rakudo on the server, a few days ago,
and regenerated the Perl 6 Maven pages. This promptly broke the site. The fix was easy, and as expected the bug was mine.
&lt;/p&gt;&lt;p&gt;
Today I decided to try Rakudo on my Windows machine as well, but I went for the easy
route and installed the pre-built msi file.
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 15 Mar 2013 20:52:02 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W10</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W10.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W10.html</link>
	<description>&lt;p&gt;During making this update, I had lots of problems with Internet. I have managed to load commits history for every repository I check, but I haven’t checked commits. Will update this after Internet access will be more stable.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Rat.perl&lt;/code&gt; returns decimal number when denominator is normalizable to a power of 10.&lt;/li&gt;

&lt;li&gt;Added FALLBACK methods.&lt;/li&gt;

&lt;li&gt;Included Failure in smartmatch passthroughs.&lt;/li&gt;

&lt;li&gt;Loosened relationship between &lt;code&gt;Nil&lt;/code&gt; and &lt;code&gt;()&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;List.permutations&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;rat64&lt;/code&gt; type has unsigned denominator.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Nil&lt;/code&gt; isn’t suggested for empty list in error messages anymore.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Fixed expanding of variables that don’t exist when converting string to RegExp. For example, &lt;code&gt;&quot;a&quot; ~~ / &amp;lt;$blah&amp;gt; /&lt;/code&gt; is fixed.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;Rat.perl&lt;/code&gt; returns decimal number when denominator is normalizable to a power of 10.&lt;/li&gt;

&lt;li&gt;Removed lots of &lt;code&gt;pir::&lt;/code&gt; usage in order to help porting Rakudo to JVM.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;Rat.perl&lt;/code&gt; provides angle brackets around fractional forms.&lt;/li&gt;

&lt;li&gt;Added missing shellwords postcircumfixes (&lt;code&gt;&amp;lt;&amp;lt; &amp;gt;&amp;gt;&lt;/code&gt; and &lt;code&gt;« »&lt;/code&gt;).&lt;/li&gt;

&lt;li&gt;Generalized “augment” check, and made error message more generic.&lt;/li&gt;

&lt;li&gt;User defined circumfixes are parsed just like STD.pm6 does.&lt;/li&gt;

&lt;li&gt;Added colorcircumfixes.&lt;/li&gt;

&lt;li&gt;Rakudo now warns about integers starting with &lt;code&gt;0&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Mistakes like &lt;code&gt;if(1 &amp;lt; 2) { ... }&lt;/code&gt; (where mistake is that &lt;code&gt;if&lt;/code&gt; is called like a function) give good errors.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;Nil&lt;/code&gt; isn’t suggested for empty list in error messages anymore.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Rat.perl&lt;/code&gt; returns decimal number when denominator is normalizable to a power of 10.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;CommonEnum.gist&lt;/code&gt; returns &lt;code&gt;(Type)&lt;/code&gt; instead of &lt;code&gt;Type()&lt;/code&gt; for undefined.&lt;/li&gt;

&lt;li&gt;Restored &lt;code&gt;infix:&amp;lt;cmp&amp;gt;&lt;/code&gt; sorting for different types.&lt;/li&gt;

&lt;li&gt;Failed matches return &lt;code&gt;Nil&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 09 Mar 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Solomon Foster: Philosophical Issues with Rakudo’s .parse</title>
	<guid>http://justrakudoit.wordpress.com/?p=464</guid>
	<link>http://justrakudoit.wordpress.com/2013/03/06/philosophical-issues-with-rakudos-parse/</link>
	<description>&lt;p&gt;For a little bit now I’ve had the ABC module working on both Niecza and Rakudo.  I got a new Linux box yesterday; this morning I was playing around with my ABC tools there, trying to see if I could get them to work.  I installed them with panda, so I was using ABC with Niecza by default on my MBP and with Rakudo by default on my new machine.  I tried it with a file of my own compositions.  Apparently I hadn’t tried this in a while, because it had several issues.   And the two systems handled them completely differently.&lt;/p&gt;
&lt;p&gt;On Niecza, I got this message:&lt;br /&gt;
&lt;/p&gt;&lt;pre class=&quot;brush: plain; light: true;&quot;&gt;Unhandled exception: Did not match ABC grammar: last tune understood:
 A Hat for the Whales
d|:e~A3 BGEF|G2BG DG (3ABd|eBdB ~A3G|Bdef gfed|
e~A3 BGEF|G2BG DG (3ABd|eBdB AAGA|[1Beed e3d:|
&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On Rakudo, there were no error messages, but “A Hat for the Whales” was the last tune processed, even though there were a dozen more tunes in the ABC file after it.&lt;/p&gt;
&lt;p&gt;Without thinking about it too much I corrected this batch of errors.  Now on Niecza the entire file parsed, but I got the error&lt;br /&gt;

Unhandled exception: Illegal key signature B minor
&lt;br /&gt;
Under Rakudo, the same ABC file just appeared to work.&lt;/p&gt;
&lt;p&gt;What’s going on here?  Well, key signature processing looks something like this (simplified):&lt;br /&gt;
&lt;/p&gt;&lt;pre class=&quot;brush: plain; light: true;&quot;&gt;    token key-def { &amp;lt;basenote&amp;gt; &amp;lt;chord_accidental&amp;gt;? &amp;lt;mode&amp;gt;? }
    token mode { &amp;lt;minor&amp;gt; | &amp;lt;major&amp;gt; }
    token minor { &quot;m&quot; [&quot;in&quot; [&quot;o&quot; [&quot;r&quot;]?]?]? }
    token major { &quot;maj&quot; [&quot;o&quot; [&quot;r&quot;]?]? }
&lt;/pre&gt;&lt;br /&gt;
No space allowed between &lt;code&gt;basenote&lt;/code&gt; and &lt;code&gt;mode&lt;/code&gt;.  So when you invoke parse with that rule on “B minor”, in Niecza it fails, because the entire string was not successfully parsed.  In Rakudo it succeeds, because “B” is a valid key signature, and it doesn’t care that the entire string was not parsed.  In practice, this means that three of the tunes in the collection got the wrong key signature: B major instead of the correct B minor.&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To my mind, Niecza’s behavior is more intuitive.  If you’re trying to parse a file, parsing half of it and then silently ignoring the rest is wildly unhelpful behavior.  In every use I’ve had for parse so far, I’ve wanted it to parse everything in the string I sent to the function.&lt;/p&gt;
&lt;p&gt;But hey, I understand that some people might have different needs.  Can we at least add a flag that will give you a parsing failure if the entire string is not parsed?  &lt;code&gt;:all&lt;/code&gt;, perhaps?&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/justrakudoit.wordpress.com/464/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/justrakudoit.wordpress.com/464/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=justrakudoit.wordpress.com&amp;amp;blog=12219098&amp;amp;post=464&amp;amp;subd=justrakudoit&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 06 Mar 2013 12:59:01 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W09</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W09.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W09.html</link>
	<description>&lt;p&gt;I would put a description, but who seriously cares?&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Inside of &lt;code&gt;try&lt;/code&gt; is considered eager context, unless &lt;code&gt;try&lt;/code&gt; is called in sink context, when it’s in sink context.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Type placeholders (like &lt;code&gt;Int&lt;/code&gt;, which is null, except Int typed) now have their &lt;code&gt;.gist&lt;/code&gt; method show their name within parens to suggest being undefined. For example, &lt;code&gt;(Int)&lt;/code&gt;, &lt;code&gt;(Mu)&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Changed “Cannot assign to a non-container” error message to “Cannot modify an immutable value” that hopefully is more clear.&lt;/li&gt;

&lt;li&gt;Release announcements now use Markdown.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;Cool.substr&lt;/code&gt; doesn’t coerce its first argument to &lt;code&gt;Int&lt;/code&gt; anymore.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 02 Mar 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: I made a pointless webpage</title>
	<guid>http://glitchmr.github.com/i-made-a-pointless-webpage.html</guid>
	<link>http://glitchmr.github.com/i-made-a-pointless-webpage.html</link>
	<description>&lt;p&gt;So, well, I have a VPS, and decided to put a webpage on it for lulz. You can see it at &lt;a href=&quot;http://mango.uk.to/&quot;&gt;mango.uk.to&lt;/a&gt;, and the source (sauce) is available on &lt;a href=&quot;https://github.com/GlitchMr/Mango&quot;&gt;my GitHub profile&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Just mentioning, not that this site is important. I just wanted to run a web server just to run a web server.&lt;/p&gt;&lt;p&gt;By the way, this blog is also open sauce, you can see its source code &lt;a href=&quot;https://github.com/GlitchMr/glitchmr.github.com&quot;&gt;on GitHub&lt;/a&gt;. It’s full of hacks, but that’s Jekyll for you.&lt;/p&gt;</description>
	<pubDate>Fri, 01 Mar 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>rakudo.org: Rakudo Star 2013.02 released</title>
	<guid>http://rakudo.org/?p=248</guid>
	<link>http://rakudo.org/2013/02/24/rakudo-star-2013-02-released/</link>
	<description>&lt;p&gt;On behalf of the Rakudo and Perl 6 development teams, I’m happy to announce the February 2013 release of “Rakudo Star”, a useful and usable distribution of Perl 6.  The tarball for the  February 2013 release is available from &lt;a href=&quot;http://rakudo.org/downloads/star/&quot;&gt;http://rakudo.org/downloads/star/&lt;/a&gt;.  A Windows .MSI version of Rakudo star will usually appear in the downloads area shortly after the tarball release.&lt;/p&gt;
&lt;p&gt;In the Perl 6 world, we make a distinction between the language (“Perl 6″) and specific implementations of the language such as “Rakudo Perl”.  This Star release includes &lt;a href=&quot;https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.02&quot;&gt;release 2013.02.1&lt;/a&gt; of the &lt;a href=&quot;http://rakudo.org/&quot;&gt;Rakudo Perl 6 compiler&lt;/a&gt;, version 4.10.0 of the &lt;a href=&quot;http://parrot.org/&quot;&gt;Parrot Virtual Machine&lt;/a&gt;, and various modules, documentation, and other resources collected from the Perl 6 community.&lt;/p&gt;
&lt;p&gt;Some of the new features added to this release include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;“Did you mean …” suggestions for symbol-not-found errors&lt;/li&gt;
&lt;li&gt;Compile-time optimization of some cases of junctions in boolean context&lt;/li&gt;
&lt;li&gt;IO::Socket.get now works again with non-ASCII characters&lt;/li&gt;
&lt;li&gt;constant folding for routines marked as ‘is pure’&lt;/li&gt;
&lt;li&gt;natively typed variables and better error reporting in the REPL&lt;/li&gt;
&lt;li&gt;speed up eqv-comparison of Bufs&lt;/li&gt;
&lt;li&gt;warnings for useless use of (some) literals, variables and constant expressions in sink context&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This release also contains a range of bug fixes, improvements to error reporting&lt;br /&gt;
and better failure modes. &lt;/p&gt;
&lt;p&gt;The following features have been deprecated or modified from previous&lt;br /&gt;
releases due to changes in the Perl 6 specification, and are being removed&lt;br /&gt;
or changed as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;.gist on a type object will return ‘(Typename)’ instead of ‘Typename()’.  If you want to get the class name alone, continue to use $obj.^name&lt;/li&gt;
&lt;li&gt;postcircumfix:&amp;lt;[ ]&amp;gt; and postcircumfix:&amp;lt;{ }&amp;gt; will become multi-subs rather than multi-methods. Both at_pos and at_key will remain methods.&lt;/li&gt;
&lt;li&gt;Unary hyper ops currently descend into nested arrays and hashes.  This will change to make them equivalent to a one-level map.&lt;/li&gt;
&lt;li&gt;The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc.&lt;/li&gt;
&lt;li&gt;Leading whitespace in rules and under :sigspace will no longer be converted to &amp;lt;.ws&amp;gt; .  For existing regexes that expect this conversion, add a &amp;lt;?&amp;gt; in front of leading whitespace to make it meta again.&lt;/li&gt;
&lt;li&gt;The ?-quantifier on captures in regexes currently binds the capture slot to a List containing either zero or one Match objects; i.e., it is equivalent to “** 0..1″.  In the future, the ?-quantifier will bind the slot directly to a captured Match or to Nil.  Existing code can manage the transition by changing existing ?-quantifiers to use “** 0..1″, which will continue to return a List of matches.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are some key features of Perl 6 that Rakudo Star does not&lt;br /&gt;
yet handle appropriately, although they will appear in upcoming&lt;br /&gt;
releases.  Some of the not-quite-there features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;advanced macros&lt;/li&gt;
&lt;li&gt;threads and concurrency&lt;/li&gt;
&lt;li&gt;Unicode strings at levels other than codepoints&lt;/li&gt;
&lt;li&gt;interactive readline that understands Unicode&lt;/li&gt;
&lt;li&gt;non-blocking I/O&lt;/li&gt;
&lt;li&gt;much of Synopsis 9&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is an online resource at http://perl6.org/compilers/features&lt;br /&gt;
that lists the known implemented and missing features of Rakudo&lt;br /&gt;
and other Perl 6 implementations.&lt;/p&gt;
&lt;p&gt;In many places we’ve tried to make Rakudo smart enough to inform the&lt;br /&gt;
programmer that a given feature isn’t implemented, but there are&lt;br /&gt;
many that we’ve missed.  Bug reports about missing and broken&lt;br /&gt;
features are welcomed at &lt;a&gt;&lt;br /&gt;
href=&quot;mailto:rakudobug@perl.org&quot;&amp;gt;rakudobug@perl.org&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;http://perl6.org/&quot;&gt;perl6.org&lt;/a&gt; for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources.  A draft of a Perl 6 book is available as UsingPerl6-draft.pdf&amp;gt; in the release tarball.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;p&gt;The development team thanks all of the contributors and sponsors for making Rakudo Star possible.  If you would like to contribute, see &lt;a href=&quot;http://rakudo.org/how-to-help&quot;&gt;http://rakudo.org/how-to-help&lt;/a&gt;, ask on the perl6-compiler@perl.org mailing list, or join us on IRC #perl6 on freenode.&lt;/p&gt;</description>
	<pubDate>Sun, 24 Feb 2013 19:21:21 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W08</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W08.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W08.html</link>
	<description>&lt;p&gt;Now, I’m back to the your regularly scheduled Perl 6 changes article that isn’t. Well, it is, but it’s not. Or something. Rakudo 2013.02.1 was released (well, 2013.02 was released too). The version bump was caused by the fact that NQP 2013.02 had broken native call support.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Failed matches result &lt;code&gt;Nil&lt;/code&gt;, not &lt;code&gt;(Match)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Removed &lt;code&gt;Set.powerset&lt;/code&gt;. It was removed after 10 hours of existing. Consider it a printing error in my previous article, or something. Not really an incompatible change, as it practically never existed.&lt;/li&gt;

&lt;li&gt;Type placeholders (like &lt;code&gt;Int&lt;/code&gt;, which is null, except Int typed) now have their &lt;code&gt;.gist&lt;/code&gt; method show their name within parens to suggest being undefined. For example, &lt;code&gt;(Int)&lt;/code&gt;, &lt;code&gt;(Mu)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;Added a warning for smartmatch of &lt;code&gt;(Match)&lt;/code&gt; or &lt;code&gt;(Nil)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;The sink context now can be detected. Side-effect-free operations, constants and variables warn about it.&lt;/li&gt;

&lt;li&gt;Compiler warns about apparent subscripts in regexes being treated as regexes (for example, &lt;code&gt;@a[0]&lt;/code&gt;, which is treated as any of &lt;code&gt;@a&lt;/code&gt; elements followed by &lt;code&gt;0&lt;/code&gt;).&lt;/li&gt;

&lt;li&gt;It’s possible to interpolate arrays in regular expressions.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;int64&lt;/code&gt; native type.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;/./&lt;/code&gt; and &lt;code&gt;rx/./&lt;/code&gt; now matches against &lt;code&gt;$_&lt;/code&gt; in sink context.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;$feature is not yet implemented. Sorry.&lt;/code&gt; error message doesn’t have &lt;code&gt;is&lt;/code&gt; anymore.&lt;/li&gt;

&lt;li&gt;Coercive type declarations make not yet implemented error.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Type placeholders (like &lt;code&gt;Int&lt;/code&gt;, which is null, except Int typed) now have their &lt;code&gt;.gist&lt;/code&gt; method show their name within parens to suggest being undefined. For example, &lt;code&gt;(Int)&lt;/code&gt;, &lt;code&gt;(Mu)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 23 Feb 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: t1: Tell knights from knaves</title>
	<guid>tag:strangelyconsistent.org,2013-02-22:blog/t1-tell-knights-from-knaves</guid>
	<link>http://strangelyconsistent.org/blog/t1-tell-knights-from-knaves</link>
	<description>&lt;div style=&quot;background: #ded; margin: 1em; padding: 1em;&quot;&gt;&lt;code&gt;&amp;lt;grondilu&amp;gt; masak: are you sure problem #1 is computationnaly doable?  It's not NP = P or something, is it?&lt;br /&gt;
* grondilu thinks of it and realizes the number of possibilities is not so large&lt;br /&gt;
&amp;lt;grondilu&amp;gt; .oO( 2**number_of_islanders  possibilities anyway )&lt;/code&gt;&lt;/div&gt;

&lt;p&gt;And so, the time-honored tradition of reviewing &lt;a href=&quot;http://github.com/masak/p6cc2012#readme&quot;&gt;p6cc&lt;/a&gt; solutions begins. Again.&lt;/p&gt;

&lt;p&gt;For our first task, we have the very human conundrum of figuring out who is telling the truth and who is lying. Fortunately, on the island of Smul, that's a much more tractable problem than in the real world.&lt;/p&gt;

&lt;p&gt;The problem description follows.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;## Tell knights from knaves based on what they say

On the mythical island of Smul, people suffer from a rare genetic disorder that
make them either tell the truth all the time, or lie all the time. These are
the only two types of people on the island, known as knights and knaves,
respectively.

Write a program that takes as input a number of utterances by islanders, and
outputs for each person whether that person is a knight or a knave. If there is
no possible assignment that works, the program should report that no solution
exists. In the case of multiple solutions, the program should report every
possible solution.

The islanders can make four different classes of utterances:

    X is a knight.
    X is a knave.
    X and Y are of the same type.
    X and Y are of different types.

(Here, X and Y are used as metavariables, of course, and can in fact be any
name of an islander.)

Islanders can refer to each other. The same islander can make several
utterances. If an islander mentions another islander that doesn't say anything,
your program should consider the entire input to be erroneous.

Here are a few examples:

    A: A is a knight.

Both a knight and a knave would assert the same thing. So this input has two
solutions.

    B: B is a knave.

Neither a knight or a knave would ever say this about themselves. So this input
allows no solution.

    C: C and D are of the same type.
    D: D and C are of different types.

Here, the two islanders are contradicting each other, so one of them must be a
knight and the other a knave. But this is exactly what D is saying, so D is the
knight. One solution.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Let's get one obvious thing out of the way: we can solve this with a brute-force method, supposing for each islander in a situation first that he is a knight and then that he is a knave. Each islander thus bifurcates the universe in two possible universes. Two islanders will yield four possible universes to investigate. Three islanders will yield eight universes. Ten islanders will yield 1024 universes. The universes grow exponentially with the islanders. The brute-force solution will always &lt;em&gt;work&lt;/em&gt;, but at an exponential slowdown.&lt;/p&gt;

&lt;p&gt;Many people choose the brute-force solution. I don't blame them; it's there for the picking. Some people get fancy with logical propositions or &quot;affiliations&quot; between islanders, but they all fall down the exponential pit at one point or another. The brute-forcers are all over the place in terms of style and brevity, and it's quite fun to watch.&lt;/p&gt;

&lt;p&gt;Then there's this &lt;em&gt;one&lt;/em&gt; contestant that gets the nice solution. It always thrills me when that happens.&lt;/p&gt;

&lt;p&gt;Here, let me lay it out for you. Let 0 mean &lt;code&gt;False&lt;/code&gt;/knave and 1 mean &lt;code&gt;True&lt;/code&gt;/knight. Then let's translate the four possible utterances to equations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&quot;A: X is a knight.&quot; → A = X&lt;/li&gt;
&lt;li&gt;&quot;A: X is a knave.&quot; → A = 1 xor X&lt;/li&gt;
&lt;li&gt;&quot;A: X and Y are of the same type.&quot; → A = 1 xor X xor Y&lt;/li&gt;
&lt;li&gt;&quot;A: X and Y are of different types.&quot; → A = X xor Y&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By some amazing coincidence, all the utterances can be put into more or less the same mold, and the only operator used is xor. It's actually fun to translate these formulas back, and get alternative formulations of things, sometimes giving a different perspective on things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A = X → &quot;A is as truthful as X&quot;&lt;/li&gt;
&lt;li&gt;A = 1 xor X → &quot;A or X is truthful, but not both&quot;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From that first formulation we see why, when A is asserting that A is a knight, that utterance devolves into a tautology A = A. It's as if an islander cannot assert his own knighthood solely on his own authority.&lt;/p&gt;

&lt;p&gt;From the second formulation we see why, when A is asserting that A is a knave, such an utterance devolves into a contradiction A = 1 xor A. There just isn't any such number A. (We'd have to look in the murky domain of fuzzy logic, but that's outside the realm of the island of Smul.)&lt;/p&gt;

&lt;p&gt;Anyway, translating all the utterances to this form is a &lt;em&gt;big&lt;/em&gt; win. Now we can make a linear equation system of all the utterances, and solve the linear equation system. Do we have fast algorithms for that? Yes, we do! Gaussian elimination has an arithmetic complexity of O(n&lt;sup&gt;3&lt;/sup&gt;). That's quite an improvement on exponential brute force!&lt;/p&gt;

&lt;p&gt;We must take care to do all the additions and subtractions as xors, though. This is because our underlying algebra is truth values, outside of which we may not stray. So we're really doing Gaussian elimination on the &lt;a href=&quot;https://en.wikipedia.org/wiki/Quotient_ring&quot;&gt;quotient ring&lt;/a&gt; Z/2Z.&lt;/p&gt;

&lt;p&gt;In the literature, we find this problem as &lt;a href=&quot;https://en.wikipedia.org/wiki/3SAT#XOR-satisfiability&quot;&gt;XOR-satisfiability&lt;/a&gt;. Wikipedia dignifies it with two sentences.&lt;/p&gt;

&lt;p&gt;One contestant did it this way. Yay him. You should check out his solution.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/masak/p6cc2012/tree/master/t1/review&quot;&gt;Here are the solutions&lt;/a&gt;, and my reviews of same. Enjoy.&lt;/p&gt;

&lt;p&gt;Next up: rectangle haikus, possibly the most fun I've ever had with a p6cc task.&lt;/p&gt;</description>
	<pubDate>Fri, 22 Feb 2013 22:39:50 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: friendly interactive shell</title>
	<guid>http://glitchmr.github.com/friendly-interactive-shell.html</guid>
	<link>http://glitchmr.github.com/friendly-interactive-shell.html</link>
	<description>&lt;p&gt;I’m not sure if anybody noticed, but lately, nothing was happening on my blog. So, I’m going to write an article about friendly interactive shell (fish), the best shell I’ve used ever (it’s my personal opinion, in case you haven’t noticed, see my footer blog). Actually, I think I’ve moved to it half of the year ago or something.&lt;/p&gt;&lt;p&gt;These days, the two popular shells exist - bash and Z shell. I’m aware of that more shells exist - just nobody uses them these days By the way, if you try to find logical fallacy, I agree, cmd.exe and Windows PowerShell are often used, but those aren’t UNIX shells. Oh, and programming language REPLs are often used too (like irb), but they aren’t UNIX shells too.&lt;/p&gt; id='bash'&amp;gt;Bash&amp;gt;&lt;p&gt;The bash shell is standard shell, included in many Linux distributions. It will make you bash your head against the brick wall (pun intended).&lt;/p&gt;&lt;p&gt;One of examples of bash code I could have found is this. And trust me, it’s not the worst thing (thanks, &lt;a href=&quot;https://en.wikibooks.org/wiki/Bash_Shell_Scripting#Non-integer_arithmetic&quot; title=&quot;Wikibooks: Bash Shell Scripting&quot;&gt;Wikibooks&lt;/a&gt;).&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# print the powers of two, from 1 to 512:&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 1; i &amp;lt; 1000; i *&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 2&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Do you see double parens here? This is really strange math syntax that only supports integers. Why double parenthesis? Well, the answer is compatibility with Bourne shell (really, really old shell, usually called sh (but sometimes sh is actually bash, to make you bash)).&lt;/p&gt;&lt;p&gt;Also, you could have noticed keywords &lt;code&gt;do&lt;/code&gt; and &lt;code&gt;done&lt;/code&gt;. Bash could easily not require &lt;code&gt;do&lt;/code&gt; keyword before &lt;code&gt;for&lt;/code&gt; loop body. Yet, it’s required. The other strange quirks is that you aren’t allowed to put semicolon after &lt;code&gt;do&lt;/code&gt; keyword. Why? I’ve no idea, really. The &lt;code&gt;done&lt;/code&gt; word, while I think it’s needed, differs between blocks. For example, &lt;code&gt;if&lt;/code&gt; blocks end with &lt;code&gt;fi&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Bourne again shell has lots of strange syntax you really wouldn’t ever use. For example, bash has &lt;code&gt;$''&lt;/code&gt; syntax. It unescapes escape sequences inside. The strange part is &lt;code&gt;''&lt;/code&gt; in bash doesn’t do any processing at all, yet &lt;code&gt;$''&lt;/code&gt; does. Bash also has &lt;code&gt;$&quot;&quot;&lt;/code&gt; syntax, but it doesn’t do escape processing - instead it uses gettext to translate string inside.&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Prints 'Hello world.', with new line in middle.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;Hello&lt;span class=&quot;s1&quot;&gt;$'\n'&lt;/span&gt;world.
&lt;span class=&quot;c&quot;&gt;# Prints 'Hello\nworld.', literally.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;echo &lt;/span&gt;Hello&lt;span class=&quot;s2&quot;&gt;$&quot;\n&quot;&lt;/span&gt;world.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Consistency in bash is even worse than in languages such as PHP. There are many ways to do something, but none of them are obvious. And I mean that, none. Expanding bash is adding new syntax that totally doesn’t make sense, but was a syntax error in previous versions. &lt;code&gt;$&lt;/code&gt; sign is used for many features that have nothing with variables.&lt;/p&gt;&lt;p&gt;Also, bash integrates many programs in it that really shouldn’t be inside. For example, &lt;code&gt;echo&lt;/code&gt;.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[glitchmr@pineapple ~]$ echo --help
--help
[glitchmr@pineapple ~]$ which echo
/bin/echo
[glitchmr@pineapple ~]$ /bin/echo --help
Usage: /bin/echo [SHORT-OPTION]... [STRING]...
  or:  /bin/echo LONG-OPTION
Echo the STRING(s) to standard output.

...

NOTE: your shell may have its own version of echo, which usually supersedes
the version described here.  Please refer to your shell's documentation
for details about the options it supports.

Report echo bugs to bug-coreutils@gnu.org
GNU coreutils home page: &amp;lt;http://www.gnu.org/software/coreutils/&amp;gt;
General help using GNU software: &amp;lt;http://www.gnu.org/gethelp/&amp;gt;
Report echo translation bugs to &amp;lt;http://translationproject.org/team/&amp;gt;
For complete documentation, run: info coreutils 'echo invocation'&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;/bin/echo&lt;/code&gt; on my system is GNU echo. The &lt;code&gt;bash&lt;/code&gt; on my system is GNU bash. They were both made by GNU. Yet, they act differently. Is there a better recipe for failure than program that actually isn’t called because your shell is “clever”.&lt;/p&gt;&lt;p&gt;It’s not just &lt;code&gt;echo&lt;/code&gt;. Many commands are implemented in shell, when they should be implemented outside shell. For example, &lt;code&gt;pwd&lt;/code&gt;. Why exactly? To confuse you when dealing with recursive structures.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;[glitchmr@pineapple ~]$ mkdir recursion
[glitchmr@pineapple ~]$ cd recursion/
[glitchmr@pineapple recursion]$ ln -s . recursion
[glitchmr@pineapple recursion]$ cd recursion
[glitchmr@pineapple recursion]$ pwd
/home/glitchmr/recursion/recursion
[glitchmr@pineapple recursion]$ which pwd
/bin/pwd
[glitchmr@pineapple recursion]$ /bin/pwd
/home/glitchmr/recursion
[glitchmr@pineapple recursion]$ &lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The shell outright lies about your location. You’re in &lt;code&gt;/home/glitchmr/recursion&lt;/code&gt;. Why shell does that? Well, it does that to not confuse you when typing &lt;code&gt;cd ..&lt;/code&gt;. And indeed, if you type &lt;code&gt;cd recursion/recursion&lt;/code&gt;, and &lt;code&gt;cd ..&lt;/code&gt; after that, you will end in &lt;code&gt;recursion&lt;/code&gt; directory, not the directory where you created the first &lt;code&gt;recursion&lt;/code&gt; directory.&lt;/p&gt;&lt;p&gt;Symbolic links in UNIX are simply redirects. If you made a symbolic link to &lt;code&gt;/usr/share/hell&lt;/code&gt;, you shouldn’t expect that &lt;code&gt;cd ..&lt;/code&gt; made after following link follow return you anywhere that isn’t &lt;code&gt;/usr/share&lt;/code&gt;. Yet, implementation of symbolic links in bash lies.&lt;/p&gt;&lt;p&gt;The lie is obvious after using anything that isn’t bash builtin. For example, &lt;code&gt;ls ..&lt;/code&gt; will always show contents of &lt;code&gt;/usr/share&lt;/code&gt;, even if you made symbolic link in &lt;code&gt;/tmp/heaven&lt;/code&gt;. Yet, &lt;code&gt;cd ..&lt;/code&gt; will return to &lt;code&gt;/tmp/heaven&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;By the way, in case you ask, &lt;code&gt;cd&lt;/code&gt; is also a builtin. But that’s acceptable, because external command cannot change environment of caller (such at PATH). So it has to be a builtin. Yet, somehow, &lt;a href=&quot;http://superuser.com/questions/241129/why-wont-sudo-cd-work&quot; title=&quot;Super User: Why won&quot;&gt;some people are still confused&lt;/a&gt;.&lt;/p&gt; id='z_shell'&amp;gt;Z shell&amp;gt;&lt;p&gt;Z shell is a shell that is way better than bash. Well, if you &lt;em&gt;configure&lt;/em&gt; it properly. It’s a shell that appears to have some compatibility with Bash scripters (for example &lt;code&gt;$''&lt;/code&gt; syntax works, but &lt;code&gt;$&quot;&quot;&lt;/code&gt; doesn’t (or rather, it returns literal ’$’ and contents of &lt;code&gt;&quot;&quot;&lt;/code&gt;)).&lt;/p&gt;&lt;p&gt;Z shell has lots of features. In fact, the author is “not aware of a major interactive feature in any other freely-available shell which zsh does not also have (except smallness)”. Something that would be sane default actually isn’t default. In fact, with default settings it mostly works like &lt;code&gt;bash&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;For example, completion. By default, Z shell only completes file names and command names. If you will type &lt;code&gt;sudo apt-get install&lt;/code&gt;, press space and then press Tab, it will give you file names. Useful? I don’t think so.&lt;/p&gt;&lt;p&gt;Of course, the option to enable better Tab completion is possible to turn on. It’s just not default. Why the shell would have default that don’t make sense. Simiarly, by default Tab completion cannot expand globs. Yet, it’s possible to enable.&lt;/p&gt;&lt;p&gt;When you start Z shell for first time, you see the configuration wizard (called &lt;code&gt;zsh-newuser-install&lt;/code&gt;). The problem is, it’s the most non-user-friendly thing I’ve seen. It asks about minor details you don’t care about, without proposing any useful default. For example, the maximum number of errors you can make for the command to be still proposed in error message. I just have pressed Enter, and the response is “Please enter a number”. Do you think I care about this?&lt;/p&gt;&lt;p&gt;Actually, as far I know, nobody actually uses this wizard. In most cases, zsh is configured using so called &lt;code&gt;oh-my-zsh&lt;/code&gt;. What it is actually? Well, it’s a config script with sane things configured by default. Yet, it has got 8,648 stars on GitHub and 3,326 forks as I’m writing it.&lt;/p&gt;&lt;p&gt;Yes, it’s just ZSH config file that has things that should be default, but they aren’t. Oh, and &lt;code&gt;plugins&lt;/code&gt; array that contains list of plugins that mostly make aliases and completion adders that aren’t in main zsh (like CoffeeScript). For example &lt;code&gt;git&lt;/code&gt; plugin adds aliases like &lt;code&gt;gc&lt;/code&gt; for &lt;code&gt;git commit -v&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;I don’t know about you, but I don’t like programs which take 4 hours to configure. Z shell is one of these. &lt;code&gt;oh-my-zsh&lt;/code&gt; makes the job easier, but I still don’t think it’s worth wasting the time. Perhaps if &lt;code&gt;fish&lt;/code&gt; wouldn’t exist, it would be worth it.&lt;/p&gt; id='friendly_interactive_shell'&amp;gt;friendly interactive shell&amp;gt;&lt;p&gt;Z shell, aside of totally insane configuration isn’t a bad shell (if I would want to talk about bad shells, it would be csh or cmd.exe). friendly interactive shell is as good as Z shell (with good Z shell configuration), except without having to configure it.&lt;/p&gt;&lt;p&gt;In fact, most of things cannot be configured. You cannot configure nonsense like maximal history length (by design). You cannot configure interpretation of numbers starting with 0 as octal (you can in Z shell - I have no idea why Z shell even allows you to type “echo 010” to get “8” when configured to do so - but it does). You cannot disable file globs.&lt;/p&gt;&lt;p&gt;Remember &lt;code&gt;.bashrc&lt;/code&gt;/&lt;code&gt;.zshrc&lt;/code&gt; configuration file? You won’t need it. The colors and themes can be easily configured using a web service (but if you prefer, you can use &lt;code&gt;set&lt;/code&gt; command directly).&lt;/p&gt;&lt;p&gt;For example, if you want to configure your &lt;code&gt;EDITOR&lt;/code&gt; to be &lt;code&gt;vim&lt;/code&gt;, you can run the following command.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;set -Ux EDITOR vim&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;-U&lt;/code&gt; modifier means that this value is stored between session. The &lt;code&gt;-x&lt;/code&gt; means that this variable is exported to programs ran by shell. After you have done that, your variable magically appears in every &lt;code&gt;fish&lt;/code&gt; session.&lt;/p&gt;&lt;p&gt;Adding new functions is also easy. It’s enough to type &lt;code&gt;funced function-name&lt;/code&gt;. After&lt;/p&gt;&lt;p&gt;Fish also offers features I haven’t seen in other shells, like syntax highlighting. Ommited quote? Syntax highlighting will help you.&lt;/p&gt;&lt;p&gt;In fish, everything is tab-completeable. Even if the program doesn’t have specific tab completion definitions, it’s still tab-completeable, thanks to generating tab completions from man pages. For example, &lt;code&gt;gedit&lt;/code&gt; doesn’t have specific tab completions, yet fish managed to create them.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;glitchmr@pineapple ~&amp;gt; gedit -
--background                                         (Run gedit in the background.)
--encoding        (Set the character encoding to be used for openi… [See Man Page])
--geometry                     (Set the X geometry window size (WIDTHxHEIGHT+X+Y).)
--help                                           (Prints the command line options.)
--list-encodings  (Display list of possible values for the encodin… [See Man Page])
--new-document            (Create a new document in an existing instance of gedit.)
--new-window       (Create a new toplevel window in an existing instance of gedit.)
--standalone                                        (Run gedit in standalone mode.)
--version                                    (Output version information and exit.)
--wait                                    (Open files and block the gedit process.)
-b                                                   (Run gedit in the background.)
-g                             (Set the X geometry window size (WIDTHxHEIGHT+X+Y).)
-s                                                  (Run gedit in standalone mode.)
-w                                        (Open files and block the gedit process.)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, just like zsh (with correct configuration), it can expand more stuff. For example, kill command expands process IDs.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;glitchmr@pineapple ~&amp;gt; kill 
1            (systemd)  127           (systemd-udevd)  479                (gconfd-2)
2           (kthreadd)  132         (systemd-journal)  508                   (gvfsd)
3        (ksoftirqd/0)  229               (hd-audio0)  512              (gvfsd-fuse)
5       (kworker/0:0H)  230               (kpsmoused)  527         (cinnamon [tty1])
7       (kworker/u:0H)  299              (irq/46-mei)  528                  (colord)
8        (migration/0)  307                (cfg80211)  534  (polkit-gnome-au [tty1])
9        (rcu_preempt)  308                    (hci0)  536          (dropbox [tty1])
10            (rcu_bh)  309            (kworker/u:1H)  539        (nm-applet [tty1])
11         (rcu_sched)  310               (scsi_eh_6)  540  (gnome-screensav [tty1])
12        (watchdog/0)  311         (rts5139-control)  558      (gsd-printer [tty1])
13        (watchdog/1)  312         (rts5139-polling)  566         (gvfs-udisks2-vo)
14       (ksoftirqd/1)  314                (ttm_swap)  568                 (udisksd)
15       (migration/1)  325          (NetworkManager)  598             (gvfsd-trash)
17      (kworker/1:0H)  329             (dbus-daemon)  728          (firefox [tty1])
18            (cpuset)  331          (systemd-logind)  744          (hexchat [tty1])
19           (khelper)  332                   (login)  746      (pxgsettings [tty1])
20         (kdevtmpfs)  335                 (polkitd)  797           (dconf-service)
21             (netns)  341                  (mysqld)  798   (gnome-terminal [tty1])
22       (bdi-default)  344          (wpa_supplicant)  805  (gnome-pty-helpe [tty1])
23           (kblockd)  348                   (nginx)  806            (fish [pts/0])
26        (khungtaskd)  349                   (nginx)  1374            (kworker/1:2)
27           (kswapd0)  351                 (php-fpm)  5790           (fish [pts/1])
28              (ksmd)  352                 (php-fpm)  10502        (gvfsd-metadata)
29        (khugepaged)  353                 (php-fpm)  13551          (fish [pts/2])
30     (fsnotify_mark)  373                (dhclient)  13635           (ssh [pts/2])
31            (crypto)  385             (fish [tty1])  13866           (kworker/1:0)
35          (kthrotld)  387                   (fishd)  18892            (gvfsd-http)
38           (deferwq)  412           (startx [tty1])  20044          (fish [pts/1])
62             (khubd)  429            (xinit [tty1])  20046        (python [pts/1])
63           (ata_sff)  430                       (X)  20405           (vim [pts/0])
64         (scsi_eh_0)  434    (gnome-session [tty1])  21370           (kworker/0:1)
65         (scsi_eh_1)  437      (dbus-launch [tty1])  21373           (kworker/u:2)
66         (scsi_eh_2)  438             (dbus-daemon)  22399          (fish [pts/3])
67         (scsi_eh_3)  440         (at-spi-bus-laun)  22472           (vim [pts/3])
68         (scsi_eh_4)  444             (dbus-daemon)  22521           (kworker/u:0)
69         (scsi_eh_5)  447         (at-spi2-registr)  22863           (kworker/0:0)
93      (kworker/0:1H)  455  (gnome-settings- [tty1])  22945           (kworker/u:1)
95      (kworker/1:1H)  464              (pulseaudio)  23238            (ps [pts/4])
103      (jbd2/sda6-8)  465            (rtkit-daemon)  23239          (grep [pts/4])
104  (ext4-dio-unwrit)  468                 (upowerd)  23240          (tail [pts/4])
110        (flush-8:0)  476            (gconf-helper)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Of course, fish has some disadvantages. One of disadvantages is the syntax. It’s not POSIX compatible by design. For example, the history substition doesn’t exist. Instead, you’re supposed (if you wanted, let’s say, sudo) to press Up, Home, and type ‘sudo’. Command substitution uses &lt;code&gt;()&lt;/code&gt;, not &lt;code&gt;``&lt;/code&gt; or &lt;code&gt;$()&lt;/code&gt;. Still, if you will accidentally use &lt;code&gt;$()&lt;/code&gt; bashism, the shell will inform you with an error.&lt;/p&gt;&lt;p&gt;Also, the newest stable is really old and slow. Instead I would use version from git, which is usually more stable than stable version. In Arch Linux, it’s &lt;code&gt;fish-shell-git&lt;/code&gt; from AUR, on other operating systems (like CentOS I use on my VPS), you have to compile it yourself. It isn’t so difficult. The GitHub repository is &lt;a href=&quot;https://github.com/fish-shell/fish-shell/&quot; title=&quot;GitHub: fish-shell/fish-shell&quot;&gt;fish-shell/fish-shell&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;As for why I’m mentioning fish shell, well, I have lately contributed a small patch to &lt;a href=&quot;https://github.com/fish-shell/fish-shell/commit/a61e2caadb532ddbe73b85fd539c58c173e9f051&quot; title=&quot;GitHub: fish-shell/fish-shell - Update Perl completion&quot;&gt;hint -C suboptions in perl&lt;/a&gt; - like &lt;code&gt;-CSDL&lt;/code&gt;. Nothing special, but hey, why not make a blog post, considering I write them rarely.&lt;/p&gt;</description>
	<pubDate>Fri, 22 Feb 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>perl6.announce: Parrot 5.1.0 &quot;Zombie Parrot&quot; Released! by Bruce Gray</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2013/02/msg691.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2013/02/msg691.html</link>
	<description>Flat on the bunk again, he ran for his life. The Parrot stalked him&lt;br /&gt;	through the grey hours of morning, smoothing its fractal feathers,&lt;br /&gt;	shuffling itself slowly into clarity as though at the end of a&lt;br /&gt;	flashy film-dissolve, until at last his mind's eye had to acknowledge&lt;br /&gt;	a shape,&lt;br /&gt;		a shape,&lt;br /&gt;			a wink&lt;br /&gt;-- From BLIT, a short story by David Langford&lt;br /&gt;	http://www.infinityplus.co.uk/stories/blit.htm&lt;br /&gt;&lt;br /&gt;On behalf of the Parrot team, I'm proud to announce Parrot 5.1.0, also known&lt;br /&gt;as &quot;Zombie Parrot&quot;.  Parrot (http://parrot.org/) is a virtual machine aimed&lt;br /&gt;at running all dynamic languages.&lt;br /&gt;&lt;br /&gt;Parrot 5.1.0 is available on Parrot's FTP site&lt;br /&gt;(ftp://ftp.parrot.org/pub/parrot/releases/supported/5.1.0/), or by following the&lt;br /&gt;download instructions at http://parrot.org/download.  For those who would like&lt;br /&gt;to develop on Parrot, or help develop Parrot itself, we recommend using Git to&lt;br /&gt;retrieve the source code to get the latest and best Parrot code.&lt;br /&gt;&lt;br /&gt;Parrot 5.1.0 News:&lt;br /&gt;   - Core&lt;br /&gt;       + The .sort() method was added to the FixedFloatArray PMC&lt;br /&gt;       + Improved detection of system memory for machines with &amp;gt;2GB&lt;br /&gt;       + Improved pbc_to_exe support for spacey paths&lt;br /&gt;       + Fixed Parrot_io_readall_s allocating too much string space&lt;br /&gt;   - Build&lt;br /&gt;       + Fixed generated MANIFEST files to omit $destdir&lt;br /&gt;   - Documentation&lt;br /&gt;   - Tests&lt;br /&gt;       + .readall now checks that prior reads are respected.&lt;br /&gt;   - Community&lt;br /&gt;       + Weekly IRC meetings have resumed. #parrotsketch Tuesdays at 1930 UTC&lt;br /&gt;&lt;br /&gt;The SHA256 message digests for the downloadable tarballs are:&lt;br /&gt;af26c2fcc806505ec516ebb013bdd37b218633f5fe63faaa6b843ffe55e0135e parrot-5.1.0.tar.bz2&lt;br /&gt;2483963c1bec665be772cb40a71fd3d9d2621feca547932475017c81a2f7e49b parrot-5.1.0.tar.gz&lt;br /&gt;&lt;br /&gt;Many thanks to all our contributors for making this possible, and our sponsors&lt;br /&gt;for supporting this project.  Our next scheduled release is 19 Mar 2013.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;&lt;br /&gt;-- &lt;br /&gt;Bruce Gray (Util of PerlMonks)&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Wed, 20 Feb 2013 18:36:17 +0000</pubDate>
</item>
<item>
	<title>Jonathan Worthington (6guts): NQP on JVM gets Grammars, Multiple Dispatch</title>
	<guid>http://6guts.wordpress.com/?p=267</guid>
	<link>http://6guts.wordpress.com/2013/02/17/nqp-on-jvm-gets-grammars-multiple-dispatch/</link>
	<description>&lt;p&gt;Having just reached an interesting milestone, I thought I’d blog a quick progress update on my work to port NQP to the JVM, in preparation for also doing a port of Rakudo Perl 6.&lt;/p&gt;
&lt;p&gt;The big news is that the grammar and regex engine is pretty much ported. This was a sizable and interesting task, and while a few loose ends need to be wrapped up I think it’s fair to say that the hard bits are done. The port includes support for the basics (literals, quantifiers, character classes, positional and named captures, calls to other rules, and so forth) as well as the more advanced features (transitive Longest Token Matching for both alternations and protoregexes, and embedded code blocks and assertions). Missing are anchors, conjunctions and a small number of built-in rules; none of these are particularly demanding or require primitives that don’t already exist, however. It’s also worth pointing out that the NQP code to calculate the NFAs used in Longest Token Matching also runs just fine atop of the JVM.&lt;/p&gt;
&lt;p&gt;Another interesting feature that I ported a little while ago is multiple dispatch. This was some effort to port, since the original implementation had been done in C. While it’s sensible to have a close-to-the-VM dispatch cache, there’s little reason for the one-off candidate sorting work (not a hot path) to be done in C, so I ported the code for this to NQP. This meant that on the JVM side, I just needed to implement a few extra primitives, and could then run the exact same candidate sorting code.&lt;/p&gt;
&lt;p&gt;I think it’s worth noting again that I’m really doing two things in parallel here: hunting down places where NQP couples too tightly to Parrot and loosening the coupling, and also doing the porting to the JVM. The first half of this work is relevant to all future ports. In many cases, I’m also finding that the changes give us architectural improvements or just cleaner, more maintainable code. I wanted to point this out especially because I’m seeing various comments popping up suggesting that Rakudo (or even Perl 6) is on a one-way road to the JVM, forsaking all other platforms. That’s not the case. The JVM has both strengths (mature, a solid threading story, widely deployed, the only allowed deployment platform in some development shops, increasing attention to supporting non-Java languages through things like invokedynamic) as well as weaknesses (slow startup time, lack of native co-routine support, and the fact that it was originally aimed at static languages). Rakudo most certainly should run on JVM – and it most certainly should run on other platforms too. And, as I wrote in my previous post, we’ve designed things so that we are able to do so. Perl has always been a language where There’s More Than One Way To Do It. Perl also has a history of running on a very wide range of platforms. Perl 6 should continue down this track – but the new reality is that a bunch of the interesting platforms are virtual, not hardware/OS ones.&lt;/p&gt;
&lt;p&gt;By now, the JVM porting work is fast approaching a turning point. Up until now, it’s been about getting a cross-compiler and runtime support in place and working our way through the NQP test suite. This phase is largely over. The next phase is about getting NQP itself cross-compiled – that is, cross-compiling the compiler, so that we have an NQP compiler that runs on the JVM, supporting eval and able to run independently.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/267/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/267/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=267&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 16 Feb 2013 23:16:22 +0000</pubDate>
</item>
<item>
	<title>Carl Masak: Perl 6 is now half as old as Perl</title>
	<guid>tag:strangelyconsistent.org,2013-02-16:blog/perl6-is-now-half-as-old-as-perl</guid>
	<link>http://strangelyconsistent.org/blog/perl6-is-now-half-as-old-as-perl</link>
	<description>&lt;p&gt;Today Perl 6 is as old as Perl was when Perl 6 was announced.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ perl6 -e 'say Date.new(2000, 7, 18) + (Date.new(2000, 7, 18) - Date.new(1987, 12, 18))'
2013-02-16
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The 1987 date is the release of Perl 1. The 2000 date is the &lt;a href=&quot;http://strangelyconsistent.org/blog/happy-10th-anniversary-perl-6&quot;&gt;throwing of the mugs&lt;/a&gt;, which I consider to be Perl 6's birthday.&lt;/p&gt;

&lt;p&gt;It's a bit interesting to compare Perl 6 at this point with Perl back then. They are two fairly different projects, even though the people are overlapping to a great extent.&lt;/p&gt;

&lt;h2&gt;Bottom-up vs top-down&lt;/h2&gt;

&lt;p&gt;In any programming project, you can start from the small pieces and build upwards to the overreaching goals and ideas, or you can start from the ideas and build downwards to the nitty-gritty stuff.&lt;/p&gt;

&lt;p&gt;Perl is a bottom-up project: the Perl 1 release looks puny today. It didn't do much. But it did run. It did solve people's problems. And there's an unbroken chain of commits leading from Perl 1 to today's Perl 5.&lt;/p&gt;

&lt;p&gt;Perl 6 is definitely a top-down project. Larry mulled over those RFC's and wrote the Apocalypses. These eventually resulted in the Synopses, which guide implementation work. Implementations reach up towards the spec, and are in some sense always built bottom-up... but on the most zoomed-out scale, Perl 6 is built from the top down.&lt;/p&gt;

&lt;p&gt;This difference was very much deliberate. For the Perl 6 project, it was felt that a specification (and a corresponding test suite) was needed. The Pugs project is currently very dormant and not actively developed, but it &lt;em&gt;did&lt;/em&gt; result in both the Synopses and the spectest suite. Both are essential artifacts for any Perl 6 implementer.&lt;/p&gt;

&lt;h2&gt;Second system syndrome&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;&quot;It's important to remember that when you start from scratch there is &lt;strong&gt;absolutely no reason&lt;/strong&gt; to believe that you are going to do a better job than you did the first time.&quot; — Joel Spolsky, &lt;a href=&quot;http://www.joelonsoftware.com/articles/fog0000000069.html&quot;&gt;Things You Should Never Do, Part I&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Look, here's the thing: everyone knows that The Big Rewrite isn't a good idea. That's like, Software Project Management 101. Even the people going into this project knew that. The &lt;a href=&quot;http://www.zazzle.com/camelia_second_system_tote_bag-149004096878338512&quot;&gt;jokes about second systems&lt;/a&gt; have been with us from the start, as a part of our cultural heritage.&lt;/p&gt;

&lt;p&gt;There have been efforts to mitigate the risks and to calm people on the way. The Ponie project was an effort to put Perl 5 on Parrot, for example, to provide for a migration path or simply a communication bridge from Perl 5 to Perl 6.&lt;/p&gt;

&lt;p&gt;Early on, it was also felt that Perl 6 wouldn't be so different from Perl 5, syntactically. Sure, the sigils would come out being invariant, and a comma would have to be added here and there for consistency. But that was about it. Perl 5 programmers would still feel right at home.&lt;/p&gt;

&lt;p&gt;Well, guess what? The Ponie project, even with brilliant developers behind it, slowed and finally halted at the height of the Pugs era. Turns out the reasons people wanted to further themselves from the existing Perl 5 internals — that they are a big hairy mess of intertwined C macros — also made porting to Parrot exceedingly difficult. Ponie brought some permanent improvements to the Perl 5 core, but in the end it didn't reach its goal of Perl 5 targeting Parrot.&lt;/p&gt;

&lt;p&gt;In the meantime, Perl 6 kept improving and evolving, syntactically as well as semantically. The differences piled up. Perl 6, unfettered by backward-compatibility, could take sometimes vast leaps and reach places in the state-space Perl 5 could only dream of. Also, things kept shaking around and stabilizing, features growing together into a unified whole instead of &lt;a href=&quot;http://perl-begin.org/humour/perl6_perl_6_cover_lg.jpg&quot;&gt;this&lt;/a&gt;. All good and well, but it meant that Perl 6 drifted further away from Perl 5.&lt;/p&gt;

&lt;p&gt;So here we are, a decade later, with two distinct languages, and no way for them to interoperate. Having them actually talk to each other is still very much on the agenda. It's just that it's a big undertaking. A couple of recent projects are attempting to put Perl 5 on a platform where it can talk to Perl 6.&lt;/p&gt;

&lt;p&gt;I think the biggest thing to realize in all this is that Perl 6, even from the very start, could never have followed the trajectory Perl did. There was one thing that existed in 2000 that didn't exist in 1987, when Perl was announced: Perl. &lt;em&gt;That's&lt;/em&gt; why Perl 6 is a top-down project. &lt;em&gt;That's&lt;/em&gt; why it's a second system. And &lt;em&gt;that's&lt;/em&gt; why the obvious measure-stick of Perl 6 is Perl, with its 13-year head start.&lt;/p&gt;

&lt;h2&gt;Rubber, meet road&lt;/h2&gt;

&lt;p&gt;I'm not complaining about this, mind. We &lt;em&gt;should&lt;/em&gt; compare Perl 6 to Perl. And to all other scripting languages that have popped up in the same niche. We should steal ideas and adapt to modern practices, like we always do, in both Perl and Perl 6.&lt;/p&gt;

&lt;p&gt;But for a top-down project, the biggest challenge is always to reach all the way down to the ground: to actually start being useful for someone. That's perhaps our big challenge. It was back in 2008 when I became heavily involved in the Perl 6 effort, and it still is today: be useful. Be usable. &lt;a href=&quot;http://www.youtube.com/watch?v=GRfhTBmw9Y8&quot;&gt;Put food on someone's family&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Perl 6 is useful to me today. Not to the extent that I can write Perl 6 code all day, but to the extent that it makes me more effective and more productive now and then. Bringing that kind of usefulness to others requires lots of work writing modules, documentation, books, and tutorials, as has been discussed elsewhere. We're making some headway with this. I'm more optimistic than I was two years ago.&lt;/p&gt;

&lt;p&gt;We also need to work on things such as performance. Perl 6 is fast enough for some things, but overall implementations are still fairly slow. Sometimes ridiculously slow. Good work is being done in this area, too.&lt;/p&gt;

&lt;p&gt;But here's what makes me the most optimistic about the Perl 6 effort: after a few years of watching things evolve, I've noticed that while Perl 6 is being developed top-down on the outermost scale, it's actually a series of bottom-up projects that drive Perl 6 forwards.&lt;/p&gt;

&lt;p&gt;jnthn likes to tell about how he promised to implement junctions in Rakudo back in 2008, and then realized that junctions were actually tied to method dispatch and the object system, so he had to implement those, too. Later, while pmichaud was rebuilding the parser according to our current understanding of it, jnthn was building Rakudo's meta-object protocol, a project called 6model. Each step on the way replacing the layer below based on what we had found that the layer above required. The 6model work is part of what now enables us to port nqp and Rakudo to the JVM.&lt;/p&gt;

&lt;p&gt;That's what makes me optimistic. While Perl 6 is undeniably, unchangeably a top-down project, highly competent people are factoring that top-down knowledge into the design of components in a bottom-up way. What's been happening in these 13 years is that we've become increasingly better and more efficient at building Perl 6.&lt;/p&gt;

&lt;h2&gt;So, how're we doing?&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;&quot;Chuck Norris has actually been using Perl 6 since 1987, and has been waiting for Larry to play catch-up. :)&quot; — dukeleto on #perl6&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's stop and compare the state of Perl 6 today with the state of Perl back in 2000.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mugs&lt;/strong&gt;. Back then, Jon Orwant threw coffee mugs against a wall because he felt there was nothing to energize the community and people would walk off to other things.&lt;/p&gt;

&lt;p&gt;Are sixers doing any mug-throwing nowadays? Yup, we did, at the Perl Reunification Summit. Liz felt, and still feels, that if we don't actively bring Perl 5 and Perl 6 together, then both projects are eventually going to fizzle out.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Crisis&lt;/strong&gt;. As part of that, the feeling Jon Orwant was expressing was that Perl was stagnating or going nowhere.&lt;/p&gt;

&lt;p&gt;Is Perl 6 stagnating? I wouldn't say so. We're still extremely small compared to Perl 5, but my general sense is that we're still &lt;em&gt;gaining&lt;/em&gt; speed, becoming stronger every day. Still very much pre-peak.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Usefulness&lt;/strong&gt;. In 2000, Perl was on its thirteenth year of solving everyday problems for people.&lt;/p&gt;

&lt;p&gt;What about Perl 6 today? Well, it's very different. Part of this is due to the top-down nature of the project. People are waiting for it to be useful to them. Part of it is &lt;em&gt;perception&lt;/em&gt;: people are &lt;em&gt;waiting&lt;/em&gt;, instead of jumping in and using the language in cases where it could already be useful to them. We see this in the verb tenses people are using when they ask stuff: &quot;Will Perl 6...&quot; Perl 6 is about the future, but if we don't do something about that perception, we'll never get there. The problem with &quot;tomorrow&quot; is that it never actually arrives.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community&lt;/strong&gt;. In 2000, Perl drew thousands of people to conferences each year.&lt;/p&gt;

&lt;p&gt;Is Perl 6 drawing thousands? No. The Perl people are kind enough to let us piggyback on Perl conferences and workshops, and through them we have an audience of thousands. I keep feeling that there's a big interest in Perl 6, both from within the Perl community and from other communities. But there's also a sense of waiting, of not-yet-production-ready. (And I agree.)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;What remains?&lt;/h2&gt;

&lt;p&gt;Which brings us to the last, perhaps most important question. What's left for Perl 6 to become a viable, useful solution to most people out there?&lt;/p&gt;

&lt;p&gt;For years I wouldn't go near that question. Just working along, head looking down at the current sub-projects, making Perl 6 more useful to myself and hoping that was enough. But my recent visit to FOSDEM made me realize that some kind of production release is actually within reach — say, a few years away — and a focused effort to reach a releasable state by some criteria would be highly useful for us and for others.&lt;/p&gt;

&lt;p&gt;So here are my for criteria. This is what Perl 6 needs to be ready for the world.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;. Slightly simplified, this is what we've been working on since the Pugs days. &lt;a href=&quot;http://perl6.org/compilers/features&quot;&gt;We are doing well&lt;/a&gt; on features. There's not much I feel is missing nowadays from the core language. It's a pleasant language to use and to express thoughts in. There are bugs, sure, but with each month that passes, those bugs are becoming less frequent and less serious.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Speed&lt;/strong&gt;. Working on it. I won't make any promises about the JVM port, but I have a strong feeling it will make a big difference. Parallel to this, there are various already-implemented or to-be-implemented efforts to make the compiler smarter about generating efficient code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Concurrency&lt;/strong&gt;. There are some good ideas in the specification about concurrency. Some of them will work fine, some probably won't pan out. What's needed now is a solid implementation of concurrency in either Rakudo or Niecza, a test-bed for the ideas in the spec, so that users can get a feel for what's there and what's missing. I'd really like for Perl 6 to have a decent concurrency story, because it's one of the things that were promised early on for Perl 6, and one of the things that Perl never got right. Also, concurrency in all its various forms seems to be growing increasingly important in the programming world of today.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CPAN&lt;/strong&gt;. Sure, we have &lt;a href=&quot;http://modules.perl6.org/&quot;&gt;an ecosystem&lt;/a&gt; for Perl 6. But it isn't CPAN. It's three orders of magnitude as small as CPAN. And it's not realistic to port all of CPAN either — that'll simply never happen. What we really need is a high-bandwidth connection between Perl 5 and Perl 6. We need for them to run in the same runloop. Once they do that, Perl 6 programmers can have their CPAN modules, and Perl 5 programmers can work Perl 6 code into their projects. This is also something that was promised early on. It's not an easy task.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Perl 6 is a multi-year project. Though today's date is a little bit arbitrary, it's worthwhile to look both backwards and forwards, to see where we currently are. And though we're structurally different from the Perl project, it's still interesting to make comparisons.&lt;/p&gt;

&lt;p&gt;We believe we're building something really nice with Perl 6. 2013 may not be the year when we're finally production-ready, but it sure feels like a year where a lot of significant things will happen (and are already happening). And, unlike 2012, I finally feel ready to speculate about the light at the end of the tunnel.&lt;/p&gt;</description>
	<pubDate>Sat, 16 Feb 2013 18:00:54 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W07</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W07.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W07.html</link>
	<description>&lt;pre&gt;&lt;code&gt;&amp;gt; my $perl = Date.new: '1987-12-18' # Perl 1 release&lt;sup&gt;&lt;a href=&quot;http://perldoc.perl.org/perlhist.html&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;
1987-12-18
&amp;gt; my $perl6 = Date.new: '2000-07-18' # Perl 6 announcement&lt;sup&gt;&lt;a href=&quot;http://strangelyconsistent.org/blog/happy-10th-anniversary-perl-6&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;
2000-07-18
&amp;gt; Date.today - $perl6
4596
&amp;gt; $perl6 - $perl
4596&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Normally, I wouldn’t put irrelevant snippets of code&lt;sup&gt;[citation
needed]&lt;/sup&gt;. But this day is different - we have Perl 6 equidieversary (thanks, &lt;a href=&quot;http://www.perlgeek.de/&quot; title=&quot;Perlgeek.de&quot;&gt;moritz&lt;/a&gt;). It’s 4596 days since Perl 6 was announced (Wikipedia says it was annouced 2000-07-19, but actually it was earlier). In 2000-07-19, Perl was 4596 days old. But I won’t discuss about this more, as &lt;a href=&quot;http://strangelyconsistent.org/blog/perl6-is-now-half-as-old-as-perl&quot; title=&quot;Strangely Consistent: Perl 6 is now half as old as Perl&quot;&gt;masak already made perfectly fine article about that&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Let’s return to your regularly scheduled program.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;Set&lt;/code&gt;s and &lt;code&gt;Bag&lt;/code&gt;s do not flatten in list context.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Metaoperators are treated as normal operators, and aren’t making list of closures. So, for example &lt;code&gt;@array X* *&lt;/code&gt; is &lt;code&gt;-&amp;gt; $arg { @array X* $arg }.&lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Inner classes and roles must be lexically scoped.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Added &lt;code&gt;List.combinations&lt;/code&gt; and &lt;code&gt;Set.combinations&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Added &lt;code&gt;Set.powerset&lt;/code&gt;. It’s defined like that.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;multi method powerset { set ∅, self.combinations }&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$_&lt;/code&gt; is writable in &lt;code&gt;-n&lt;/code&gt;/&lt;code&gt;-p&lt;/code&gt; code (one-liner).&lt;/li&gt;

&lt;li&gt;&lt;code&gt;eqv&lt;/code&gt; is faster for &lt;code&gt;Buf&lt;/code&gt; objects.&lt;/li&gt;

&lt;li&gt;Configure script fails on unknown command line options.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 16 Feb 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Moritz Lenz (Perl 6): Pattern Matching and Unpacking</title>
	<guid>http://perlgeek.de/blog-en/perl-6/2013-pattern-matching.html</guid>
	<link>http://perlgeek.de/blog-en/perl-6/2013-pattern-matching.html</link>
	<description>&lt;p&gt;When talking about &lt;em&gt;pattern matching&lt;/em&gt; in the context of Perl 6,
people usually think about regex or grammars. Those are indeed very powerful
tools for pattern matching, but not the only one.&lt;/p&gt;

&lt;p&gt;Another powerful tool for pattern matching and for unpacking data
structures uses signatures.&lt;/p&gt;

&lt;p&gt;Signatures are &quot;just&quot; argument lists:&lt;/p&gt;

&lt;pre&gt;&lt;span class=&quot;synStatement&quot;&gt;sub&lt;/span&gt; repeat(&lt;span class=&quot;synType&quot;&gt;Str&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$s&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt; Int &lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;$count&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt; &lt;/span&gt;{
    &lt;span class=&quot;synComment&quot;&gt;#     ^^^^^^^^^^^^^^^^^^^^  the signature&lt;/span&gt;
    &lt;span class=&quot;synComment&quot;&gt;# $s and $count are the parameters&lt;/span&gt;
    &lt;span class=&quot;synSpecial&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$s&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$count&lt;/span&gt;
}
&lt;/pre&gt;

&lt;p&gt;Nearly all modern programming languages have signatures, so you might say:
nothing special, move along. But there are two features that make them more useful
than signatures in other languages.&lt;/p&gt;

&lt;p&gt;The first is &lt;em&gt;multi dispatch&lt;/em&gt;, which allows you to write several
routines with the name, but with different signatures. While extremely
powerful and helpful, I don't want to dwell on them. Look at Chapter 6 of
the &lt;a href=&quot;https://github.com/downloads/perl6/book/2012.05.23.a4.pdf&quot;&gt;&quot;Using
Perl 6&quot; book&lt;/a&gt; for more details.&lt;/p&gt;

&lt;p&gt;The second feature is &lt;em&gt;sub-signatures&lt;/em&gt;. It allows you to write a
signature for a sigle parameter.&lt;/p&gt;

&lt;p&gt;Which sounds pretty boring at first, but for example it
allows you to do declarative validation of data structures. Perl 6 has no
built-in type for an array where each slot must be of a specific but different
type. But you can still check for that in a sub-signature&lt;/p&gt;

&lt;pre&gt;&lt;span class=&quot;synStatement&quot;&gt;sub&lt;/span&gt; f(&lt;span class=&quot;synIdentifier&quot;&gt;@array&lt;/span&gt; [&lt;span class=&quot;synType&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synType&quot;&gt;Str&lt;/span&gt;]) {
    &lt;span class=&quot;synIdentifier&quot;&gt;say&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;@array&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;
}
f [&lt;span class=&quot;synConstant&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;]&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;synComment&quot;&gt;# 42, str&lt;/span&gt;
f [&lt;span class=&quot;synConstant&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synConstant&quot;&gt;23&lt;/span&gt;]&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;         &lt;span class=&quot;synComment&quot;&gt;# Nominal type check failed for parameter '';&lt;/span&gt;
                    &lt;span class=&quot;synComment&quot;&gt;# expected Str but got Int instead in sub-signature&lt;/span&gt;
                    &lt;span class=&quot;synComment&quot;&gt;# of parameter @array&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;Here we have a parameter called &lt;code&gt;@array&lt;/code&gt;, and it is followed by
a square brackets, which introduce a sub-signature for an array. When calling
the function, the array is checked against the signature &lt;code&gt;(Int,
Str)&lt;/code&gt;, and so if the array doesn't contain of exactly one Int and one
Str in this order, a type error is thrown.&lt;/p&gt;

&lt;p&gt;The same mechanism can be used not only for validation, but also for
&lt;em&gt;unpacking&lt;/em&gt;, which means extracting some parts of the data structure.
This simply works by using variables in the inner signature:&lt;/p&gt;

&lt;pre&gt;&lt;span class=&quot;synStatement&quot;&gt;sub&lt;/span&gt; head(&lt;span class=&quot;synStatement&quot;&gt;*&lt;/span&gt;@ [&lt;span class=&quot;synIdentifier&quot;&gt;$head&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;*&lt;/span&gt;@]) {
    &lt;span class=&quot;synIdentifier&quot;&gt;$head&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;
}
&lt;span class=&quot;synStatement&quot;&gt;sub&lt;/span&gt; tail(&lt;span class=&quot;synStatement&quot;&gt;*&lt;/span&gt;@ [&lt;span class=&quot;synIdentifier&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;@tail&lt;/span&gt;]) {
    &lt;span class=&quot;synIdentifier&quot;&gt;@tail&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;
}
&lt;span class=&quot;synIdentifier&quot;&gt;say&lt;/span&gt; head &lt;span class=&quot;synSpecial&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;a b c &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;synComment&quot;&gt;# a&lt;/span&gt;
&lt;span class=&quot;synIdentifier&quot;&gt;say&lt;/span&gt; tail &lt;span class=&quot;synSpecial&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;a b c &lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;      &lt;span class=&quot;synComment&quot;&gt;# b c&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;Here the outer parameter is anonymous (the &lt;code&gt;@&lt;/code&gt;), though it's
entirely possible to use variables for both the inner and the outer
parameter.&lt;/p&gt;

&lt;p&gt;The anonymous parameter can even be omitted, and you can write &lt;code&gt;sub
tail( [$, *@tail] )&lt;/code&gt; directly.&lt;/p&gt;

&lt;p&gt;Sub-signatures are not limited to arrays. For working on arbitrary objects,
you surround them with parenthesis instead of brackets, and use named
parameters inside:&lt;/p&gt;

&lt;pre&gt;&lt;span class=&quot;synStatement&quot;&gt;multi&lt;/span&gt; key-type ($ (Numeric &lt;span class=&quot;synStatement&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;*%&lt;/span&gt;)) { &lt;span class=&quot;synSpecial&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&quot;&lt;/span&gt; }
&lt;span class=&quot;synStatement&quot;&gt;multi&lt;/span&gt; key-type ($ (&lt;span class=&quot;synType&quot;&gt;Str&lt;/span&gt;     &lt;span class=&quot;synStatement&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;synIdentifier&quot;&gt;$key&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;*%&lt;/span&gt;)) { &lt;span class=&quot;synSpecial&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;&quot;&lt;/span&gt; }
&lt;span class=&quot;synStatement&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;synConstant&quot;&gt;42&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;synConstant&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;synSpecial&quot;&gt;'&lt;/span&gt; &lt;span class=&quot;synStatement&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;synConstant&quot;&gt;42&lt;/span&gt;) &lt;span class=&quot;synStatement&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;synIdentifier&quot;&gt;$pair&lt;/span&gt; {
    &lt;span class=&quot;synIdentifier&quot;&gt;say&lt;/span&gt; key-type &lt;span class=&quot;synIdentifier&quot;&gt;$pair&lt;/span&gt;&lt;span class=&quot;synStatement&quot;&gt;;&lt;/span&gt;
}
&lt;span class=&quot;synComment&quot;&gt;# Output:&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt;# Number&lt;/span&gt;
&lt;span class=&quot;synComment&quot;&gt;# String&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;This works because the &lt;code&gt;=&amp;gt;&lt;/code&gt; constructs a &lt;a href=&quot;http://doc.perl6.org/type/Pair&quot;&gt;Pair&lt;/a&gt;, which has a
&lt;code&gt;key&lt;/code&gt; and a &lt;code&gt;value&lt;/code&gt; attribute. The named parameter
&lt;code&gt;:$key&lt;/code&gt; in the sub-signature extracts the attribute
&lt;code&gt;key&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can build quite impressive things with this feature, for example &lt;a href=&quot;http://rosettacode.org/wiki/Pattern_matching#Perl_6&quot;&gt;red-black tree
balancing based on multi dispatch and signature unpacking&lt;/a&gt;. (&lt;a href=&quot;http://blogs.perl.org/users/ovid/2013/02/red-black-trees-in-perl-6-explained.html&quot;&gt;More verbose explanation of the code&lt;/a&gt;.) Most use
cases aren't this impressive, but still it is very useful to have
occasionally. Like for &lt;a href=&quot;https://gist.github.com/masak/ca5a82ae76951cc387cc&quot;&gt;this small
evaluator.&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Wed, 13 Feb 2013 05:49:13 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W06</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W06.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W06.html</link>
	<description>&lt;p&gt;This time without any gimmicks (like five word sentences). This will be simple description of changes I do regularly.&lt;/p&gt; id='new_features_this_time_without_building_stuff_part'&amp;gt;New features (this time without building stuff part)&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Constant folded &lt;code&gt;^..^&lt;/code&gt; (infix) and &lt;code&gt;^&lt;/code&gt; (prefix) operators.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Added (borrowed from Rakudo Perl) the &lt;code&gt;Match.gist&lt;/code&gt; method.&lt;/li&gt;

&lt;li&gt;Replaced “Unhandle conext character” error with “Unhandle con&lt;strong&gt;t&lt;/strong&gt;ext character” error.&lt;/li&gt;

&lt;li&gt;Added Cool.set method. It can be used to convert argument to set.&lt;/li&gt;

&lt;li&gt;Added Cool.bag. Just like method above, it can be used to convert argument to bag.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 09 Feb 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: I have Twitter account</title>
	<guid>http://glitchmr.github.com/i-have-twitter-account.html</guid>
	<link>http://glitchmr.github.com/i-have-twitter-account.html</link>
	<description>&lt;p&gt;Yet another ignorable self promotion. &lt;a href=&quot;http://twitter.com/GlitchMr&quot; title=&quot;Twitter: GlitchMr&quot;&gt;http://twitter.com/GlitchMr&lt;/a&gt;&lt;/p&gt;&lt;p&gt;(perhaps I should have different news feed for Planet Six…)&lt;/p&gt;</description>
	<pubDate>Wed, 06 Feb 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes article - 2013W05</title>
	<guid>http://glitchmr.github.com/perl-6-changes-article-2013W05.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-article-2013W05.html</link>
	<description>&lt;p&gt;The changes are so fun. jnthn is working on porting. nqp will be on JVM. And then, Rakudo will be. Java is very, very fast. There are some interesting problems. But nothing impossible to solve. At least, I hope so. I would continue, but well. This is not the topic. This is article about changes. Changes in Perl 6, obviously. If you want, enjoy reading.&lt;/p&gt;&lt;p&gt;Rakudo Star 2013.01 was released. It’s based on Rakudo 2013.01. Those changes aren’t in.&lt;/p&gt;&lt;p&gt;On sidenote, a small note. Five word sentences are interesting. I am not stealing ideas. Well, actually, I am now. I should stop talking now.&lt;/p&gt; id='new_features_to_build_stuff'&amp;gt;New features to build stuff&amp;gt;&lt;h2 id=&quot;rakudo_a_perl_6_distribution&quot;&gt;Rakudo, a Perl 6 distribution&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;any&lt;/code&gt; and &lt;code&gt;all&lt;/code&gt; are optimized. To be exact, in statements. The &lt;code&gt;if&lt;/code&gt; and &lt;code&gt;while&lt;/code&gt; statements. And opposites - &lt;code&gt;unless&lt;/code&gt; and &lt;code&gt;until&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Many operators are pure now. That means they are sideeffect-free.&lt;/li&gt;

&lt;li&gt;Site libraries are loaded first.&lt;/li&gt;

&lt;li&gt;Pure subroutines are constant folded.&lt;/li&gt;

&lt;li&gt;REPL supports natively typed variables.&lt;/li&gt;

&lt;li&gt;REPL has better error reporting.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 02 Feb 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jonathan Worthington (6guts): A look at the preparations behind the JVM port, and a progress update</title>
	<guid>http://6guts.wordpress.com/?p=263</guid>
	<link>http://6guts.wordpress.com/2013/02/02/a-look-at-the-preparations-behind-the-jvm-port-and-a-progress-update/</link>
	<description>&lt;div lang=&quot;x-western&quot;&gt;
&lt;p&gt;After my last post giving a status update on the JVM porting of NQP and the compiler toolchain Rakudo builds upon, hercynium++ left a comment suggesting that I also blog about the design work behind this effort. I liked the idea, and in this post I’ll attempt to describe it a bit. I can’t possibly capture all of the interesting things in a single post, so if this doesn’t cover aspects that are particularly interesting to anybody reading, let me know and I’ll try and find time to write something on them. :-)&lt;/p&gt;
&lt;h3&gt;It started long ago…&lt;/h3&gt;
&lt;p&gt;The first commit to the repository where I’m doing the initial porting work to the JVM may have been back in November, but that isn’t where the journey really started. We’ve known for multiple years now that we would want Rakudo and NQP to target backends besides Parrot. In that time, we’ve had to build a lot of technology in order to be able to build Rakudo at all. Some things we’ve had to build more than once because the first time didn’t produce something satisfactory (where satisfactory means “actually meets our needs”, not “is the most awesome thing ever possible”). Software is, fairly often, as much about learning as it is about building. The more complex the domain you’re working in, there more this applies, and the more likely it is that you’ll have to build one to throw away. By now we’ve thrown away a parser engine, an AST, and about 3 implementations of roles. :-)&lt;/p&gt;
&lt;p&gt;Of course, there’s the build/buy thing, where buy in open source really means “buy into”, as in use an existing library. We’ve done a bunch of that too, such as libtommath for our big integer support and dyncall for NativeCall support. But the closer something is to the “core domain” – the thing that makes your product distinctive and special – the less able you are to use something off the shelf. Parsing Perl 6 really needs to be done with a Perl 6 grammar, using Longest Token Matching. Its object system really needs something that supports meta-programming, representation polymorphism and gradual typing. Getting BEGIN/eval right and supporting compilation and having the possibility for lexical and anonymous types and packages, which can be dynamically constructed and exported, also left us with something to build (this is the work that led to bounded serialization).&lt;/p&gt;
&lt;p&gt;Eventual portability has been a design factor in what we’ve built for quite a while. While the only 6model implementation to have become complete enough to support all of Rakudo’s object needs so far is the one running on Parrot, the initial prototypes of 6model were done on the .Net CLR. This was in no small part to make sure that there was a feasible way to implement it on such a VM. Granted, what I actually discovered was a less than awesome way to build it on the CLR (and what I’m doing on the JVM this time around fits in far better with the JVM’s world view). But it was a design consideration from the start.&lt;/p&gt;
&lt;p&gt;When we updated PAST, the previous AST representation, to QAST (Q is just P++ :-)) then once again portability was a concern; the VM specific bits were all placed under a QAST::VM node type. This makes it easy to escape to the underlying VM where needed or where it is most expedient, but it’s both explicit and done in a way that allows specification of what to do on other backends. As part of this work we also build support for the nqp::op abstraction directly into the AST format. The nqp::ops form an opcode set independent of any particular VM. These get mapped as part of turning a QAST tree into code for the target backend (thus meaning there’s no overhead for them in the generated code). They may map directly to the VM’s opcodes, a function or method call in the VM, or do some more complex code generation.&lt;/p&gt;
&lt;p&gt;The other important piece of the groundwork for portability is that we implemented Rakudo in a mixture of Perl 6 and NQP, and over time have got NQP to the point where it is also written in NQP (and thus can compile itself). This has been a gradual thing; the earliest NQP editions were written directly in PIR, and with time we’ve migrated those bits to NQP – usually at the same point we were doing other improvements already. For example, pmichaud++ wrote the latest edition of the regex engine, with LTM support, in NQP. PAST, written in PIR, was replaced by QAST, written in NQP. And 6model’s meta-objects were, from the start, expressed in NQP too. It’s pretty neat that NQP’s definition of things so fundamental as classes is actually written in NQP. It means that we don’t have to port classes and roles, just the primitives they are made out of.&lt;/p&gt;
&lt;h3&gt;So digging into the JVM port itself…&lt;/h3&gt;
&lt;p&gt;With all of the above mentioned things in place, it was possible to form a fairly concrete roadmap for porting NQP, then Rakudo, over to the JVM. Being comfortable that the result would enable us to get a fully functional Rakudo on the JVM and an idea of how to get there was important. It’s easy to implement a subset, but if it isn’t factored in a way that lets you do the rest afterwards then you’re in bother and it’ll be time for re-work. My hope was that, after some years of learning about things that don’t work and replacing them with things that do, this time much of the re-work could be avoided. A starting point for this was taking a good look at the JVM’s instruction set, as well as considering what JVMs are typically good at doing.&lt;/p&gt;
&lt;p&gt;The JVM is a stack machine. This is in contrast to Parrot, which is a register machine. Thankfully, this is mostly a code generation detail rather than being especially deep. As well as the stack, a given method can have local variables (note that everything that contains code on the JVM is called a method, even subroutines, but they call them static methods because it sounds so much more OO :-)). These can hold longer-lived things, so in a sense could be used a bit like Parrot registers. In general, the code generation from QAST uses the stack where possible and falls back to locals where needed. This is because stack usage fits well with what a JVM expects to be doing, and also what its bytecode format expresses most compactly.&lt;/p&gt;
&lt;p&gt;Locals have an important restriction: they can only be accessed directly in the scope where they are declared. There is no notion of nested methods at the JVM level. This means that locals are not suitable for implementing lexical variables. Thankfully, there is a well established solution: promote such things onto the heap, keeping them in some kind of invocation record. This is what happens with closures in C# on the CLR, for example. There are a bunch of ways to do this transform, with various trade-offs. I’ve done one that was fairly fast to implement, but also enables lookup by array indexing rather than needing a named (hash) lookup in the vast majority of cases. As well as an array index being algorithmically cheaper than a hash lookup, the JVM supports array indexing natively in its opcode set, but not hash lookups.&lt;/p&gt;
&lt;p&gt;Talking of allocating things on the heap brings us nicely to think about objects. JVMs are very good at fast allocation and collection of objects, because they have to be; there is no stack allocation in Java of anything non-trivial. Of course, that doesn’t mean the VM can’t do escape analysis and stack allocate under the hood. That the VM is really good at object allocation and GC means we don’t need to worry too much about lexicals leading to invocation records on the heap; there’s plenty of performant uses of this approach in the wild. Furthermore, most records will be very short lived, nicely meeting the generational hypothesis (which is that most objects are either short lived or long lived, and so we can optimize separately for each through doing generational garbage collection).&lt;/p&gt;
&lt;p&gt;While invocation records are relatively internal, of course NQP and Perl 6 involve lots of user-visible objects. From the things you think about as objects (and call “new” on) to things like scalar containers, strings, boxed integers and so forth, both NQP and Perl 6 lead to plenty of allocations. While some things are quite predictably shaped, most come from user class definitions. Ideally, we’d like it if a Perl 6 class definition like:&lt;/p&gt;
&lt;pre&gt;class Point {
    has $!surface;
    has num $!x;
    has num $!y;
}&lt;/pre&gt;
&lt;p&gt;Was to use memory similarly to if you wrote something in Java like:&lt;/p&gt;
&lt;pre&gt;class Point {
    private Object surface;
    private double x;
     private double y;
}&lt;/pre&gt;
&lt;p&gt;At the same time, we know that the JVM’s idea of type is some way off the Perl 6 notion of type, so we can’t simply turn Perl 6 classes into JVM classes. Thankfully, 6model has from the start been designed around the idea of representation polymorphism. Really, this is just a separation of concerns: we decouple the details of memory representation and access from the notion of being a type and dispatch. The former is handled by a representation, and the latter two by a meta-object. One early but important observation I made when designing 6model is that the representation will always couple closely to the underlying runtime (and thus would need to be implemented for each runtime we wanted to run on), whereas the other bits can be expressed in a higher level way, with the common cases made efficient by caching. Thus there’s no reason to re-implement classes and roles per VM, but there is a need to provide a different, VM-specific way to do P6opaque (the default representation for NQP and Perl 6 objects).&lt;/p&gt;
&lt;p&gt;The C implementation of P6opaque on Parrot works by calculating a memory layout – essentially, figuring out a struct “on the fly”. What’s the JVM equivalent of that? Well, that’s just creating a JVM class on the fly and loading it. Is the JVM capable of doing that? Sure, it’s easily dynamic enough. Furthermore, once we’ve done that little bit of bytecode generation, it’s a perfectly ordinary JVM class. This means that the JIT compiler knows what to do with it. Does doing any of this require changes to the meta-objects for classes in NQP and Rakudo? No, because these details are all encapsulated in the representation. Things like these are good signs for a design; it tends to show that responsibilities are correctly identified and segregated.&lt;/p&gt;
&lt;h3&gt;So, how’s the cross-compiler going?&lt;/h3&gt;
&lt;p&gt;Things are going nicely. Having got much of the way there with the NQP MOP, I turned to ModuleLoader and started to get together a basic setting (the setting being the place where built-ins are defined). With those in place, work has moved on to trying to pass the NQP test suite.&lt;/p&gt;
&lt;p&gt;The build process cross-compiles the MOP, module loader and setting. To run the test suite, each test is taken and cross-compiled against those, then the result of compiling it is run on the JVM. The fact we invoke NQP, then invoke the JVM twice in order to run each test gives quite a bit of fixed overhead per test; once we have NQP itself (that is, the compiler) cross-compiled and self-hosting on the JVM it’ll be down to a single invocation.&lt;/p&gt;
&lt;p&gt;The NQP test suite for the NQP language itself consists of 65 test files. 3 of them are specific to Parrot, so there’s 62 that are interesting to make run. As of today, we pass 46 of those test files in full. While some of those passing tests exercise relatively simple things (literals, operators, variables, conditionals, loops, closures), others exercise more advanced features (classes, roles, basic MOP functionality, runtime mixins and so forth). Of the 16 test files that remain, 9 of them depend on regexes or grammars. Getting those to run will be the focus of the next major chunk of work: porting the regex compiler and getting the NFA, Cursor and Match classes to cross-compile (which will involve some portability improvements). The other 7 relate to non-trivial, but smaller-than-grammars features (for example, 2 are about multiple dispatch, which I’m working on porting at the moment).&lt;/p&gt;
&lt;p&gt;It was only three weeks ago when I wrote that the JVM port did not even manage “hello world” yet, and that I had little more to show than something that could turn a range of QAST trees into JVM bytecode. Three weeks later and we’re running around 75% of the NQP test files, and timotimo++ was even able to feed an almost unmodified Levenstein distance implementation written in NQP to the cross-compiler and have it run on the JVM.&lt;/p&gt;
&lt;p&gt;So, mad amounts of coding have taken place? Well, only sorta…I’ve taught two three-day classes for $dayjob in the last couple of weeks also. :-) Mostly, progress has been fast now because the foundations it is building upon have proved fairly solid. For the backend, this is in no small part down to having grown a test suite for the QAST to JVM phase of the work as it progressed. The fact we could happily couple this new backend to the existing NQP parser is thanks to the compiler being structured as a pipeline of stages, each one strongly isolated from the others, just passing a data structure between them. In my teaching work, I often encourage automated testing and talk a lot about the importance of enforcing carefully chosen, well-defined, information-centric boundaries between components. It’s pleasing to see these things paying off well in my Perl 6 work also. :-)&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/263/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/263/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=263&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Fri, 01 Feb 2013 23:49:17 +0000</pubDate>
</item>
<item>
	<title>Carl Masak: I am going to FOSDEM</title>
	<guid>tag:strangelyconsistent.org,2013-02-01:blog/i-am-going-to-fosdem</guid>
	<link>http://strangelyconsistent.org/blog/i-am-going-to-fosdem</link>
	<description>&lt;p&gt;&lt;em&gt;(Using exclusively five word sentences.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Perl Mongers needed speakers quickly. &quot;Very Late Call for Papers&quot;. &quot;Why so late&quot;, you ask. Perl dev room was denied. Another community got the room. Perl only got a booth. The other community backed out. Perl then got the room. Therefore, talks were requested urgently. Only about one week notice. &lt;a href=&quot;https://nxadm.wordpress.com/2013/01/25/perlfosdem2013-a-very-late-call-for-papers/&quot;&gt;The announcement is recorded here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I missed that blog post. But I got an email. Wendy wrote to some people. I was one of them. Talk about very short notice. Eight days before the talk! That must be a record. Nothing to be done, though. The invitation was nicely worded. I considered whether to go. Finally I decided I would.&lt;/p&gt;

&lt;p&gt;My talk concerns Perl 6. I have given it before. It was in Bristol, England. You were likely not there. That time, jnthn helped me. Now I will talk alone. I must give it quickly. I only have 20 minutes. That is not a lot. I rather like challenges, though. Looking forward to it all.&lt;/p&gt;

&lt;p&gt;Will you come to &lt;a href=&quot;https://fosdem.org/2013/&quot;&gt;FOSDEM&lt;/a&gt;? I certainly hope you will. If you do, stop by. I will give my talk. &lt;a href=&quot;https://fosdem.org/2013/schedule/event/perl6__dude_wheres_my_flying_car/&quot;&gt;&quot;Where is my flying car?&quot;&lt;/a&gt; A reference to the future. In the future, cars fly. Also, Perl 6 is everywhere. Especially in the flying cars. It will be totally awesome. My talk is about that. Or sorta kinda about that. It is about Perl 6. Why is it not released? What makes me keep hoping? What has been implemented already? That is what it covers.&lt;/p&gt;

&lt;p&gt;Looking forward to the weekend.&lt;/p&gt;</description>
	<pubDate>Thu, 31 Jan 2013 23:22:38 +0000</pubDate>
</item>
<item>
	<title>rakudo.org: Rakudo Star 2013.01 released</title>
	<guid>http://rakudo.org/?p=242</guid>
	<link>http://rakudo.org/2013/01/30/rakudo-star-2013-01-released/</link>
	<description>&lt;p&gt;On behalf of the Rakudo and Perl 6 development teams, I’m happy to announce the January 2013 release of “Rakudo Star”, a useful and usable distribution of Perl 6.  The tarball for the  January 2013 release is available from &lt;a href=&quot;http://rakudo.org/downloads/star/&quot;&gt;the download page&lt;/a&gt;.  A Windows .MSI version of Rakudo star will usually appear in the downloads area shortly after the tarball release.&lt;/p&gt;
&lt;p&gt;In the Perl 6 world, we make a distinction between the language (“Perl 6″) and specific implementations of the language such as “Rakudo Perl”.  This Star release includes release 2013.01 [0] of the Rakudo Perl 6 compiler [1], version 4.10.0 of the Parrot Virtual Machine [2], and various modules, documentation, and other resources collected from the Perl 6 community.&lt;/p&gt;
&lt;p&gt;Some of the new features added to this release include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sink context (what some other languages call void context) is now enforced correctly. This means that for-loops are now lazy by default. It fixes the bug where a map in sink context would not execute, and also means that a Failure returned to sink context will be properly thrown.&lt;/li&gt;
&lt;li&gt;‘require’ now works with indirect module names&lt;/li&gt;
&lt;li&gt;Restored socket read semantics to returning the requested number of bytes&lt;/li&gt;
&lt;li&gt;$obj.Some::Role::meth() now passes the correct $obj&lt;/li&gt;
&lt;li&gt; try/CATCH now returns Nil when the CATCH is triggered, rather than the exception; this brings it in line with try without a CATCH&lt;/li&gt;
&lt;li&gt;whatever-star cases of splice now implemented&lt;/li&gt;
&lt;li&gt;can now import multis with the same name from different modules, provided all dispatchers are onlystar&lt;/li&gt;
&lt;p&gt;This release also contains a range of bug fixes, improvements to error reporting&lt;br /&gt;
and better failure modes.&lt;/p&gt;
&lt;p&gt;The following features have been deprecated or modified from previous&lt;br /&gt;
releases due to changes in the Perl 6 specification, and are being removed&lt;br /&gt;
or changed as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;postcircumfix:&amp;lt;[ ]&amp;gt; and postcircumfix:&amp;lt;{ }&amp;gt; will become multi-subs rather than multi-methods. Both at_pos and at_key will remain methods.&lt;/li&gt;
&lt;li&gt; Unary hyper ops currently descend into nested arrays and hashes.  This will change to make them equivalent to a one-level map.&lt;/li&gt;
&lt;li&gt;The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc.&lt;/li&gt;
&lt;li&gt; Leading whitespace in rules and under :sigspace will no longer be&lt;br /&gt;
converted to &amp;lt;.ws&amp;gt; .  For existing regexes that expect this conversion, add a &amp;lt;?&amp;gt; in front of leading whitespace to make it meta again.&lt;/li&gt;
&lt;li&gt; The ?-quantifier on captures in regexes currently binds the capture slot to a List containing either zero or one Match objects; i.e., it is equivalent to “** 0..1″.  In the future, the ?-quantifier will bind the slot directly to a captured Match or to Nil.  Existing code can manage the transition by changing existing ?-quantifiers to use “** 0..1″, which will continue to return a List of matches.&lt;/li&gt;
&lt;p&gt;There are some key features of Perl 6 that Rakudo Star does not&lt;br /&gt;
yet handle appropriately, although they will appear in upcoming&lt;br /&gt;
releases.  Some of the not-quite-there features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;advanced macros&lt;/li&gt;
&lt;li&gt;threads and concurrency&lt;/li&gt;
&lt;li&gt;Unicode strings at levels other than codepoints&lt;/li&gt;
&lt;li&gt;interactive readline that understands Unicode&lt;/li&gt;
&lt;li&gt;non-blocking I/O&lt;/li&gt;
&lt;li&gt;much of Synopsis 9&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is an online resource at http://perl6.org/compilers/features&lt;br /&gt;
that lists the known implemented and missing features of Rakudo&lt;br /&gt;
and other Perl 6 implementations.&lt;/p&gt;
&lt;p&gt;In many places we’ve tried to make Rakudo smart enough to inform the&lt;br /&gt;
programmer that a given feature isn’t implemented, but there are&lt;br /&gt;
many that we’ve missed.  Bug reports about missing and broken&lt;br /&gt;
features are welcomed at .&lt;/p&gt;
&lt;p&gt;See http://perl6.org/ for links to much more information about&lt;br /&gt;
Perl 6, including documentation, example code, tutorials, reference&lt;br /&gt;
materials, specification documents, and other supporting resources.&lt;br /&gt;
A draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf&lt;br /&gt;
in the release tarball.&lt;/p&gt;
&lt;p&gt;The development team thanks all of the contributors and sponsors&lt;br /&gt;
for making Rakudo Star possible.  If you would like to contribute,&lt;br /&gt;
see http://rakudo.org/how-to-help, ask on the perl6-compiler@perl.org&lt;br /&gt;
mailing list, or join us on IRC #perl6 on freenode.&lt;/p&gt;
&lt;p&gt;[0] https://github.com/rakudo/rakudo/blob/nom/docs/announce/2013.01&lt;br /&gt;
[1] http://github.com/rakudo/rakudo&lt;br /&gt;
[2] http://parrot.org/&lt;/p&gt;&lt;/ul&gt;&lt;/ul&gt;</description>
	<pubDate>Wed, 30 Jan 2013 18:51:44 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W04</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W04.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W04.html</link>
	<description>&lt;p&gt;Today, the main features is &lt;code&gt;.delta&lt;/code&gt; method in &lt;code&gt;DateTime&lt;/code&gt; and &lt;code&gt;Date&lt;/code&gt;. And as usually, bug fixes that make language do what you mean.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;DateTime.delta&lt;/code&gt; and &lt;code&gt;Date.delta&lt;/code&gt; to the specification.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;s///&lt;/code&gt; resets &lt;code&gt;$/&lt;/code&gt; on failure.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;s///&lt;/code&gt; returns &lt;code&gt;False&lt;/code&gt; on failure.&lt;/li&gt;

&lt;li&gt;Regular expressions allow &lt;code&gt;$()&lt;/code&gt; syntax for arbitrary expressions.&lt;/li&gt;

&lt;li&gt;Socket functions work better with non-ASCII characters.&lt;/li&gt;

&lt;li&gt;Errors about function only taking positional arguments now specify name of function that was called.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;DateTime.truncated-to&lt;/code&gt; now takes &lt;code&gt;TimeUnit&lt;/code&gt; enum as argument.&lt;/li&gt;

&lt;li&gt;Implemented &lt;code&gt;DateTime.delta&lt;/code&gt; and &lt;code&gt;Date.delta&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Names are suggested for &lt;code&gt;--&amp;gt; Type&lt;/code&gt; (subroutine return type).&lt;/li&gt;

&lt;li&gt;&lt;code&gt;/&amp;lt; hello &amp;gt;/&lt;/code&gt; now works correctly (matching &lt;code&gt;hello&lt;/code&gt;), just like &lt;code&gt;/&amp;lt; hello world &amp;gt;/&lt;/code&gt; already did.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 26 Jan 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: Helpful error messages</title>
	<guid>http://glitchmr.github.com/helpful-error-messages.html</guid>
	<link>http://glitchmr.github.com/helpful-error-messages.html</link>
	<description>&lt;p&gt;Rakudo lately got an interesting change. Consider following buggy code (for array binary search), written in functional style (I’m using recursion). The bug is that it doesn’t work because of two different identifiers &lt;code&gt;binary-search&lt;/code&gt; and &lt;code&gt;binary_search&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Trying to run it shows compile time error message. The compile part is important. If you would remove &lt;code&gt;binary-search&lt;/code&gt; call at end, it still would report an error, unlike Python.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;===SORRY!===
Undeclared routine:
    binary_search used at lines 2, 8, 9. Did you mean '&amp;amp;binary-search'?&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now you know what’s wrong and you can easily fix it. Unlike let’s say, Jekyll that I use for my blog. Not only it doesn’t work on my PC for some reason, but also &lt;a href=&quot;https://github.com/GlitchMr/glitchmr.github.com/commits/master/_posts/2013-01-20-helpful-error-messages.md&quot; title=&quot;GitHub: GlitchMr/glitchmr.github.com (history for this post&quot;&gt;refused to highlight my code&lt;/a&gt; - it gave some sort of XML error (it simply said “REXML could not parse this XML/HTML”). I gave up and put it on Gist. And the first attempt was failed, because embed code is &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and Jekyll self-closed the tag (XML-style, but this is HTML). This is annoying.&lt;/p&gt;</description>
	<pubDate>Sun, 20 Jan 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: The Perl 6 Coding Contest (2012 edition) is now closed</title>
	<guid>tag:strangelyconsistent.org,2013-01-19:blog/the-perl-6-coding-contest-2012-edition-is-now-closed</guid>
	<link>http://strangelyconsistent.org/blog/the-perl-6-coding-contest-2012-edition-is-now-closed</link>
	<description>&lt;div style=&quot;background: #ded; margin: 1em; padding: 1em;&quot;&gt;&lt;code&gt;&quot;I've found this year the tasks were harder, but I've also spend more time thinking about the problems and less worrying about bugs in the interpreter... which is definitely good.&quot;&lt;br /&gt;        — a contestant&lt;/code&gt;&lt;/div&gt;

&lt;div style=&quot;background: #ded; margin: 1em; padding: 1em;&quot;&gt;&lt;code&gt;&quot;This year's problems were a lot more approachable to me and motivated me to learn more perl6.&quot;&lt;br /&gt;        — another contestant&lt;/code&gt;&lt;/div&gt;

&lt;p&gt;...aaaand we're done. The five weeks are up.&lt;/p&gt;

&lt;p&gt;I'm now all caught up processing submissions sent to me. So let's summarize, as usual:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;32 people signed up as contestants this year.&lt;/li&gt;
&lt;li&gt;8 contestants submitted solutions.&lt;/li&gt;
&lt;li&gt;24 submissions passed a &lt;code&gt;base-test&lt;/code&gt; run and were accepted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These figures during p6cc2010 and p6cc2011 were (18, 5, 26) and (35, 6, 27), respectively. So all in all, it seems that we've entered a steady state both in terms of contestants and submissions. I'm grateful to get so much interesting Perl 6 code to read through and review.&lt;/p&gt;

&lt;p&gt;Many people told me this year that they had noble plans to send in lots of solutions, but in the end didn't find the time for it. I'm assuming many contestants I haven't heard from have similar stories. That's fine; the contest is designed to encourage you to do the tasks, but not to force you to. If the contest made you take a look at the tasks, or at Perl 6, then in some sense that's a win, too.&lt;/p&gt;

&lt;p&gt;My plan is, just like previous years, to go through the five tasks in order, publish all the reviews and an appropriately thoughtful blog post that summarizes the tasks and its solutions. With luck, we'll all learn something together.&lt;/p&gt;

&lt;p&gt;It takes time to do these reviews. Sometimes a lot of time. That said, I hope to get through these submissions quickly. Expect something like a post each week. That's the goal.&lt;/p&gt;

&lt;p&gt;After which I'll sum up and select a winner, also in a blog post. Exciting!&lt;/p&gt;

&lt;p&gt;So, expect the next blog post to be about the first task: &quot;Tell knights from knaves based on what they say.&quot; Onwards!&lt;/p&gt;</description>
	<pubDate>Sat, 19 Jan 2013 17:24:06 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W03</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W03.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W03.html</link>
	<description>&lt;p&gt;It’s another Perl 6 changes article (at this point I wonder why I still do that). But as long the changes are impressive (and the cake is the lie), I guess mentioning changes is worth it.&lt;/p&gt;&lt;p&gt;Rakudo 2013.01 was tagged in the Git repository. It wasn’t yet released, but it’s really close to the releease (and frozen).&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;rakudo_perl_in_rakudo_201301&quot;&gt;Rakudo Perl (in Rakudo 2013.01)&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;** 0&lt;/code&gt; in regexpes works correctly matching nothing.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl_post_rakudo_201301&quot;&gt;Rakudo Perl (post Rakudo 2013.01)&amp;gt;&lt;ul&gt;
&lt;li&gt;Compiler hints invalid variable names. For example, typing &lt;code&gt;$variabel&lt;/code&gt; when you already have &lt;code&gt;$variable&lt;/code&gt; declared hints that variable.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;More meaningful error message is thrown when &lt;code&gt;printf&lt;/code&gt; tries to consume more arguments than available.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 19 Jan 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jonathan Worthington (6guts): A quick JVM backend update</title>
	<guid>http://6guts.wordpress.com/?p=261</guid>
	<link>http://6guts.wordpress.com/2013/01/18/a-quick-jvm-backend-update/</link>
	<description>&lt;p&gt;Things have been moving along quite rapidly on the JVM backend since my last post. Sadly, I’m too sick to hack on anything much this evening (hopefully, this turns out to be a very temporary affliction…) but I can at least just about write English, so I figured I’d provide a little update. :-)&lt;/p&gt;
&lt;p&gt;Last time I blogged here, I was able to compile various QAST trees down to JVM bytecode and had a growing test suite for this. My hope was that, by some inductive handwaving, being able to compile a bunch of QAST nodes and operations correctly would mean that programs made up of a whole range of them would also compile correctly. In the last week or so, that has come to pass.&lt;/p&gt;
&lt;p&gt;Having reached the point of having coverage of quite a lot of QAST, I decided to look into getting an NQP frontend plugged into my QAST to JVM backend. In the process, I found that NQP lacked the odd VM abstraction here and there in the common prelude that it includes with every QAST tree it produces. Thankfully, this was easily rectified. Even better, I got rid of a couple of old hacks that were no longer required. With those things out of the way, I found that this common prelude depended on a couple of operations that I’d not got around to implementing in the JVM backend. These were also simple to add. And…here endeth the integration story. Yup, that was it: I now had a fledgling NQP cross-compiler. An NQP compiler running on Parrot, but producing output for the JVM.&lt;/p&gt;
&lt;p&gt;This result is rather exciting, because…&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It’s using exactly the same parse and action stages as when we’re targeting Parrot. No hacks, no fork. The QAST tree we get from the NQP source code that goes in is exactly the one we get when targeting Parrot. Everything that happens differently happens is beyond that stage, in the backend. This is an extremely positive sign, architecturally.&lt;/li&gt;
&lt;li&gt;With a couple of small additions to handle the prelude, I was immediately able to cross-compile simple NQP programs and run them on the JVM. There’s no setting or MOP yet, but the basics (variables, loops, subroutines with parameters, even closures) Just Worked.&lt;/li&gt;
&lt;li&gt;The program I wrote to glue the JVM backend work and the existing NQP frontend together was about 30 lines of NQP code.&lt;/li&gt;
&lt;li&gt;This whole integration process was about an afternoon’s worth of work.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since I got that working, my focus has been on getting nqp-mo (the NQP meta-objects) to cross-compile. This is where classes and roles are implemented, and thus is a prerequisite for cross-compiling the NQP setting, which is in turn a prerequisite for being able to start cross-compiling and running the NQP test suite. The NQP MOP is about 1500 lines of NQP code, and at this point I’ve got about 1400 of them to cross-compile. So I’m almost there with it? Well, not quite. Turns out that the next thing I need to port is the bounded serialization stuff. That’s a rather hairy chunk of work.&lt;/p&gt;
&lt;p&gt;Anyway, things are moving along nicely. The immediate roadmap is to get the bounded serialization to the point where it’s enough for the NQP MOP, then move on to getting a minimal setting cross compiling. Beyond that, it’ll be working through the test suite, porting the regex compilation and seeing what else is needed to cross-compile the rest of NQP.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/261/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/261/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=261&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Fri, 18 Jan 2013 00:44:00 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W02</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W02.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W02.html</link>
	<description>&lt;p&gt;I’m going to show another Perl 6 changes article. I’m so lazy, that I really don’t know what to put here, so I guess I’ll now show the list of new features.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--&amp;gt;&lt;/code&gt; (return type) acts more like a normal subroutine parameter.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;squish&lt;/code&gt; method, working like &lt;code&gt;uniq&lt;/code&gt; utility in UNIX - it only removes elements if it is duplicate of previous element.&lt;/li&gt;

&lt;li&gt;Adjusted precedence of set operators.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;Adjusted precedence of set operators.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Implemented &lt;code&gt;require ::($module) 'something'&lt;/code&gt; syntax.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;$socket.read($bytes)&lt;/code&gt; now returns &lt;code&gt;$bytes&lt;/code&gt; bytes, if possible. Previously it only read only 256 bytes.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;$object.My::Role::method()&lt;/code&gt; works correctly and uses correct &lt;code&gt;self&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;try&lt;/code&gt; with &lt;code&gt;CATCH&lt;/code&gt; returns &lt;code&gt;Nil&lt;/code&gt; on exception, like it did without explicit &lt;code&gt;CATCH&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Failures in sink context won’t throw if they were handled.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;splice&lt;/code&gt; supports whatever star (&lt;code&gt;*&lt;/code&gt;).&lt;/li&gt;

&lt;li&gt;Adjusted precedence of set operators.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;Junction.Str&lt;/code&gt; now gives string, instead of junction with every element converted to the string.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Adjusted precedence of set operators.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 12 Jan 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jonathan Worthington (6guts): A Bunch of Rakudo News</title>
	<guid>http://6guts.wordpress.com/?p=259</guid>
	<link>http://6guts.wordpress.com/2013/01/10/a-bunch-of-rakudo-news/</link>
	<description>&lt;p&gt;Seems it’s high time for some news here. It’s not that I didn’t do any blogging about Perl 6 in December; it’s just that all of those posts were over on the &lt;a href=&quot;https://perl6advent.wordpress.com/&quot;&gt;Perl 6 advent calendar&lt;/a&gt;. Anyway, now it’s a new year, and I’m digging back into things after an enjoyable Christmas and New Year’s break in the UK with family and friends. Here’s a bunch of things that already happened but I didn’t get around to talking about here yet, and some things that will be coming up.&lt;/p&gt;
&lt;h3&gt;Better Parse Errors In 2012.12&lt;/h3&gt;
&lt;p&gt;Ever had Rakudo tell you there’s a problem on line 1, when it’s really on line 50? Or wished that even in the common case where it gets the line right, it would tell you exactly where on the line things went wrong? Or how about the time it told you “Confused” because you got a closing paren too many?&lt;/p&gt;
&lt;p&gt;Many of my contributions to the 2012.12 Rakudo release centered around improving its reporting of parse errors. STD, the standard Perl 6 grammar, has had much better error reporting than Rakudo for a while. Therefore, I spent a bunch of time aligning our error reporting more closely with what STD does. Some of this is cosmetic: you get the colored output and the indication of the parse location. But while these cosmetic changes will be the most immediately visible thing, the changes go far deeper. Of note, a high water mark is kept so we can be a lot more accurate in reporting where things came unstuck, and we track what was expected so we can produce better errors. Just doing the cosmetic stuff without being able to give it a better location to report wouldn’t have helped so much. :-)&lt;/p&gt;
&lt;p&gt;One other change is that we don’t bail out on the first thing that’s wrong when it’s possible to survive and continue parsing. When this is possible, up to 10 errors will be reported (since that’s typically a screen worth). Of course, some things just hose the parse and we can’t continue in any sensible way.&lt;/p&gt;
&lt;p&gt;Hopefully, these improvements will make using Rakudo feel a lot nicer. Already on channel, I can feel the feedback we’re giving about parse errors when people use the evalbot is often a lot more pleasant and informative. Of course, there’ll be more improvements in the future too, but this is a big step forward.&lt;/p&gt;
&lt;h3&gt;Faster Auto-Threading&lt;/h3&gt;
&lt;p&gt;The junction auto-threader could sometimes be insanely slow. As in, ridiculously so. After hearing a bunch of reports about this, I decided to dig in and work out why. A rewrite later, the little benchmark I was using with it ran almost 30 times faster. Not so bad… :-) This change also made it into the 2012.12 release.&lt;/p&gt;
&lt;h3&gt;JVM Backend Preparations Underway&lt;/h3&gt;
&lt;p&gt;I’ve talked plenty about plans for NQP and Rakudo to run on things besides Parrot for a while now. Over the last year or two, we’ve laid a lot of the groundwork for this. What’s been especially pleasing is that it’s also made Rakudo a better quality Perl 6 implementation on Parrot, thanks to the many architectural improvements. Of note, in many places we’ve closed semantic gaps between what Perl 6 wants and the primitives we were building it out of; the new QAST (Q Abstract Syntax Tree) is a great example.&lt;/p&gt;
&lt;p&gt;Anyway, with NQP now being written pretty much entirely in NQP, and many of the right abstractions in place, it felt like time to start slowly picking away at getting 6model ported to the JVM and work on turning QAST trees into Java bytecode. I quietly started on this in November, and mentioned the existence of the work on #perl6 in December. I was delighted to see Coke++ jump in and start working through the &lt;a href=&quot;https://github.com/jnthn/nqp-jvm-prep/blob/master/docs/LHF.md&quot;&gt;Low Hanging Fruit&lt;/a&gt; – a file where I’m putting tasks that should be relatively easy to pick off. I actually had to re-fill it, after the last round were depleted. ;-) By now, quite a few bits of QAST are supported and the 6model on JVM implementation is coming along nicely. Yes, this means it’s already capable of doing basic meta-programming stuff.&lt;/p&gt;
&lt;p&gt;Note that this work isn’t at the stage where it’s of use for anything yet. You can’t even write a say(“hello world”) in NQP and have it run on the JVM yet, since all the work so far is just about turning QAST trees into JVM bytecode and building the runtime support it needs. That may seem like a curious way to work, but once you do enough compiler stuff you find yourself thinking quite naturally in trees. It meant I didn’t have to worry about creating some stripped-down NQP that could emit super-simple trees to be able to test really simple things. After all, the goal is to run NQP itself on the JVM, and then Rakudo, and only then will things be interesting to the everyday user.&lt;/p&gt;
&lt;p&gt;To address a couple of immediate concerns that some may have…&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No, this is not a case of “stop running on Parrot, start running on JVM”. It’s adding an additional backend, much like pmurias++ has been working on adding a JavaScript backend for NQP. Of course, I expect resource allocation in the future to be driven by which backends users desire most. For some, the JVM is “that evil Oracle thing” and they don’t want to touch it. For others, the JVM is “the only thing our company will deploy on”. Thus I expect this work to matter more to some people than others. That’s fine.&lt;/li&gt;
&lt;li&gt;No, targeting multiple backends doesn’t mean performance-sucking abstractions everywhere. It’s a pretty typical thing for a compiler to do. As usual, it’s about picking the right abstractions. The debugger was implemented as an additional Rakudo frontend without a single addition to Rakudo or NQP or anything anywhere in the stack. That was possible because things were designed well. I’m sure the process of getting things running on the JVM will flag up a few places where things aren’t designed as well as they need to be, but already I’m seeing a lot of places where things are mapping over very nicely indeed.&lt;/li&gt;
&lt;li&gt;No, this doesn’t mean that all other Rakudo development will grind to a halt. I’ve been working on the JVM backend stuff in November and December; both months saw a huge amount of Rakudo progress too. Things will go on that way.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Type System Improvements&lt;/h3&gt;
&lt;p&gt;Rakudo does a lot of things well when it comes to supporting the various kinds of types Perl 6 offers, but there are some weak areas. Here are some of the things I plan to focus on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Getting the definedness constraint stuff working better (the :D and :U annotations). At the moment, they’re supported as a special case in multiple dispatch and the signature binder. In reality, they’re meant to be first class and work everywhere. You may not think you care about these much. Actually, you probably at least indirectly do, because once the optimizer is able to analyze them, it’ll be able to do a bunch more inlining of things than it can today. :-)&lt;/li&gt;
&lt;li&gt;Getting coercion types in place. Again, this is turning the special-cased “as” syntax into the much more general coercion type syntax (for example, Int(Str) is the type that accepts a Str and coerces it into an Int).&lt;/li&gt;
&lt;li&gt;Getting native types much better supported. At the moment, you can use them but…there are pitfalls. Having them available has been a huge win for us in the CORE setting, where we’ve used them in the built-ins. But they’re still a bit “handle with great care”. I want to change that.&lt;/li&gt;
&lt;li&gt;Implementing compact arrays.&lt;/li&gt;
&lt;li&gt;Improving our parametric type and type variable support. Many things work, but there are some fragile spots and some bugs that want some attention.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I intend to have some of these things in the January release, and a bunch more in the February one. We’ll see how I get along. :-)&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/259/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/259/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=259&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 10 Jan 2013 01:59:04 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2013W01</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2013W01.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2013W01.html</link>
	<description>&lt;p&gt;I have finally updated the number before ‘W’. Well, we have the new year - 2013. And because of that I would like to say ‘Happy new year!’.&lt;/p&gt;&lt;p&gt;This is yet another article in “Perl 6 changes”. I lately don’t put articles other than those, but I don’t have many ideas for those, really.&lt;/p&gt;&lt;p&gt;By the way, I find it interesting that no new posts on Planet Six appeared between my previous Perl 6 changes article and current Perl 6 changes article.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;“SAFE” setting is now removed. You’re supposed to use “RESTRICTED” setting now.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Using non-associative operators when association is needed throws typed error message.&lt;/li&gt;

&lt;li&gt;Compile time optimizations for &lt;code&gt;(|)&lt;/code&gt; signature (accepting anything), It’s worth handling because it’s commonly used for &lt;code&gt;proto&lt;/code&gt;s.&lt;/li&gt;

&lt;li&gt;Fixed typos in &lt;code&gt;X::Import::Redeclaration&lt;/code&gt; error message.&lt;/li&gt;

&lt;li&gt;Removed old &lt;code&gt;perl6doc&lt;/code&gt; documentation.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;DateTime.Date&lt;/code&gt; now works correctly.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;.pick&lt;/code&gt; now randomizes better on large ranges.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;infix:&amp;lt;-&amp;gt;(Instant, Instant)&lt;/code&gt; now supported.&lt;/li&gt;

&lt;li&gt;Bitwise operations support big integers.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 05 Jan 2013 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W52</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W52.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W52.html</link>
	<description>&lt;p&gt;This is last “Perl 6 changes” update in this year. Enjoy.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uniq&lt;/code&gt; method/subroutine, existing for long time in implementations is now mentioned in specification (with &lt;code&gt;===&lt;/code&gt; semantics).&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Use of suffix regex modifiers (P5-ism) in &lt;code&gt;s///&lt;/code&gt;, like &lt;code&gt;s////g&lt;/code&gt; is now detected.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 29 Dec 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>rakudo.org: Rakudo Star 2012.12 released</title>
	<guid>http://rakudo.org/?p=237</guid>
	<link>http://rakudo.org/2012/12/27/rakudo-star-2012-12-released/</link>
	<description>&lt;p&gt;On behalf of the Rakudo and Perl 6 development teams, I’m happy to announce the December 2012 release of “Rakudo Star”, a useful and usable distribution of Perl 6.  The tarball for the  December 2012 release is available from &lt;a href=&quot;http://rakudo.org/downloads/star/&quot;&gt;the download section.&lt;/a&gt; A Windows .MSI version of Rakudo star will usually appear in the downloads area shortly after the tarball release.&lt;/p&gt;
&lt;p&gt;In the Perl 6 world, we make a distinction between the language (“Perl 6″) and specific implementations of the language such as “Rakudo Perl”.  This Star release includes release &lt;a href=&quot;https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.12&quot;&gt;2012.12&lt;/a&gt; of the &lt;a href=&quot;http://github.com/rakudo/rakudo&quot;&gt;Rakudo Perl 6 compiler&lt;/a&gt;, version 4.10.0 of the &lt;a href=&quot;http://parrot.org/&quot;&gt;Parrot Virtual Machine&lt;/a&gt;, and various modules, documentation, and other resources collected from the Perl 6 community.&lt;/p&gt;
&lt;p&gt;Some of the new features added to this release include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; Parse errors are much improved, and follow STD, the standard parser,&lt;br /&gt;
  much more closely; they are more accurate and more information is given&lt;/li&gt;
&lt;li&gt; Rakudo now keeps parsing after some less serious errors&lt;/li&gt;
&lt;li&gt; Better errors for various parse failures&lt;/li&gt;
&lt;li&gt; The junction autothreader is now an order of magnitude faster&lt;/li&gt;
&lt;li&gt; Texas (ASCII) versions of the Set and Bag operators implemented&lt;/li&gt;
&lt;li&gt; Nested Pairs now give correct .perl output&lt;/li&gt;
&lt;li&gt; &lt;code&gt;{ a =&amp;gt; $_ }&lt;/code&gt; now correctly considered a block, not a hash as&lt;br /&gt;
before&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This release also contains a range of performance improvements, bug fixes, improvements to error reporting and better failure modes. &lt;/p&gt;
&lt;p&gt;The following features have been deprecated or modified from previous releases due to changes in the Perl 6 specification, and are being removed or changed as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; ‘for’-loops will become lazy, and are only evaluated eagerly in eager or sink (void) context. This means that if a for-loop is the last statement in a routine, it will usually run after the routine has returned, so it cannot call return() anymore.&lt;/li&gt;
&lt;li&gt; Unary hyper ops currently descend into nested arrays and hashes.  This will change to make them equivalent to a one-level map.&lt;/li&gt;
&lt;li&gt; The Str.ucfirst builtin is deprecated; it will be replaced by&lt;br /&gt;
Str.tc.&lt;/li&gt;
&lt;li&gt; Leading whitespace in rules and under :sigspace will no longer be converted to &amp;lt;.ws&amp;gt; .  For existing regexes that expect this conversion, add a &amp;lt;?&amp;gt; in front of leading whitespace to make it meta again.&lt;/li&gt;
&lt;li&gt; The ?-quantifier on captures in regexes currently binds the capture slot to a List containing either zero or one Match objects; i.e., it is equivalent to “** 0..1″.  In the future, the ?-quantifier will bind the slot directly to a captured Match or to Nil.  Existing code can manage the transition by changing existing ?-quantifiers to use “** 0..1″, which will continue to return a List of matches.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are some key features of Perl 6 that Rakudo Star does not&lt;br /&gt;
yet handle appropriately, although they will appear in upcoming&lt;br /&gt;
releases.  Some of the not-quite-there features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;advanced macros&lt;/li&gt;
&lt;li&gt;threads and concurrency&lt;/li&gt;
&lt;li&gt;Unicode strings at levels other than codepoints&lt;/li&gt;
&lt;li&gt;interactive readline that understands Unicode&lt;/li&gt;
&lt;li&gt;non-blocking I/O&lt;/li&gt;
&lt;li&gt;much of Synopsis 9&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is an &lt;a href=&quot;http://perl6.org/compilers/features&quot;&gt;online resource that lists the known implemented and missing features of Rakudo and other Perl 6 implementations&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In many places we’ve tried to make Rakudo smart enough to inform the programmer that a given feature isn’t implemented, but there are many that we’ve missed.  Bug reports about missing and broken features are welcomed at rakudobug@perl.org.&lt;/p&gt;
&lt;p&gt;See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources.  A draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball.&lt;/p&gt;
&lt;p&gt;The development team thanks all of the contributors and sponsors for making Rakudo Star possible.  If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compiler@perl.org mailing list, or join us on IRC #perl6 on freenode.&lt;/p&gt;</description>
	<pubDate>Thu, 27 Dec 2012 19:53:53 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 24 – An Advent Calendar</title>
	<guid>http://perl6advent.wordpress.com/?p=1841</guid>
	<link>https://perl6advent.wordpress.com/2012/12/24/day-24-an-advent-calendar/</link>
	<description>&lt;p&gt;Recently I was unpacking some boxes of books and came across a book entitled &quot;&lt;a href=&quot;http://www.amazon.com/Basic-Computer-Programs-Charles-Sternberg/dp/0810451549&quot;&gt;BASIC Computer Programs for the Home&lt;/a&gt;&quot; by Charles D. Sternberg. Apparently my father had purchased this book in the early 1980s and had given it to me. In any case, my name was scrawled in the front cover in the manner an adolescent me would have done.&lt;/p&gt;
&lt;p&gt;Mostly this book is filled with simple BASIC programs that manage simple databases of various things: recipes, household budget, address book, music collections, book collections, school grades, etc. But the program that caught my eye and made me think of the Perl 6 Advent Calendar was one for printing a calendar starting at a particular month.&lt;/p&gt;
&lt;p&gt;Now, the version in this book is a little simple in that it asks for the starting month, year, the day of the week that the first month starts on, and how many months to print. I wanted something a little more like the Unix utility cal(1) program. Luckily, Perl 6 has date handling classes as part of the &lt;a href=&quot;http://perlcabal.org/syn/S32/Temporal.html&quot;&gt;specification&lt;/a&gt; and both major implemenations, &lt;a href=&quot;https://github.com/rakudo&quot;&gt;Rakudo and &lt;/a&gt;&lt;a&gt;Niecza&lt;/a&gt;, have actual implementations of these which should make creating the calendar quite easy.&lt;/p&gt;
&lt;p&gt;For reference, the output of the Unix cal(1) utility looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;       December 2012
    Su Mo Tu We Th Fr Sa
                       1
     2  3  4  5  6  7  8
     9 10 11 12 13 14 15
    16 17 18 19 20 21 22
    23 24 25 26 27 28 29
    30 31                 &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It also has some options to change the output in various ways, but I just want to focus on reproducing the above basic output.&lt;/p&gt;
&lt;p&gt;I'll need a list of month names and weekday abbreviations:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    constant @months = &amp;lt;January February March April May June July
                        August September October November December&amp;gt;;
    constant @days = &amp;lt;Su Mo Tu We Th Fr Sa&amp;gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And it looks like the month and year are centered above the days of the week. Generating a calendar for May shows this to be the case, so I'll need a routine that centers text:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    sub center(Str $text, Int $width) {
        my $prefix = ' ' x ($width - $text.chars) div 2;
        my $suffix = ' ' x $width - $text.chars - $prefix.chars;
        return $prefix ~ $text ~ $suffix;
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, the mainline code needs two things: a month and a year. From this it should be able to generate an appropriate calendar. But, we should have a reasonable default for these values I think. Today's month and year seem reasonable to me:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    sub MAIN(:$year = Date.today.year, :$month = Date.today.month) {&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but if it's not today's month and year, then it's some arbitrary month and year we need info about. To do this we construct a new Date object from the month and year given.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        my $dt = Date.new(:year($year), :month($month), :day(1) );&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Looking at the calendar generated for December, it seems like we may actually output up to 6 rows of numbers since the month can start and end on a partial week. In order to implement this, I think I'll need some &quot;slots&quot; for each day. Each slot will either be empty or will contain the day of the month. The number of empty slots at the beginning of the month correspond to the day of the week that the first of the month occurs on. If the first is on Sunday, there will be 0 empty slots, if the first is on a Monday there will be 1 empty slot, if the first is on a Tuesday, there will be 2 empty slots, etc. This is remarkably similar to the number we get when we interrogate a Date object for the day of the week. The only wrinkle is that it returns 7 for Sunday when we actually need a 0. That's easily remedied with a modulus operator however:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        my $dt = Date.new(:year($year), :month($month), :day(1) );
        my $ss = $dt.day-of-week % 7;
        my @slots = ''.fmt(&quot;%2s&quot;) xx $ss;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That gives us the empty slots at the beginning, but what about the ones that actually contain the days of the month? Easy enough, we'll just generate a number for each day of the month using the Date object we created earlier.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        my $days-in-month = $dt.days-in-month;
        for $ss ..^ $ss + $days-in-month {
            @slots[$_] = $dt.day.fmt(&quot;%2d&quot;);
            $dt++
        }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we've got an array with appropriate values in the appropriate positions, all that's left is to actually output the calendar. Using the header line for our weekdays as a metric for the width of the calendar, and the routine we created for centering text, we can output the header portion of the calendar:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        my $weekdays = @days.fmt(&quot;%2s&quot;).join: &quot; &quot;;
        say center(@months[$month-1] ~ &quot; &quot; ~ $year, $weekdays.chars);
        say $weekdays;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then we iterate over each slot and output the appropriate values. If we've reached the end of the week or the end of the month, we output a newline:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        for @slots.kv -&amp;gt; $k, $v {
            print &quot;$v &quot;;
            print &quot;\n&quot; if ($k+1) %% 7 or $v == $days-in-month;
        }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Putting it all together, here is the final program:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    #!/usr/bin/env perl6

    constant @months = &amp;lt;January February March April May June July
                        August September October November December&amp;gt;;
    constant @days = &amp;lt;Su Mo Tu We Th Fr Sa&amp;gt;;


    sub center(Str $text, Int $width) {
        my $prefix = ' ' x ($width - $text.chars) div 2;
        my $suffix = ' ' x $width - $text.chars - $prefix.chars;
        return $prefix ~ $text ~ $suffix;
    }

    sub MAIN(:$year = Date.today.year, :$month = Date.today.month) {
        my $dt = Date.new(:year($year), :month($month), :day(1) );
        my $ss = $dt.day-of-week % 7;
        my @slots = ''.fmt(&quot;%2s&quot;) xx $ss;

        my $days-in-month = $dt.days-in-month;
        for $ss ..^ $ss + $days-in-month {
            @slots[$_] = $dt.day.fmt(&quot;%2d&quot;);
            $dt++
        }

        my $weekdays = @days.fmt(&quot;%2s&quot;).join: &quot; &quot;;
        say center(@months[$month-1] ~ &quot; &quot; ~ $year, $weekdays.chars);
        say $weekdays;
        for @slots.kv -&amp;gt; $k, $v {
            print &quot;$v &quot;;
            print &quot;\n&quot; if ($k+1) %% 7 or $v == $days-in-month;
        }
    }&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Normally, cal(1) will highlight today's date on the calendar. That's a feature I left out of my calendar implementation but it could easily be added with &lt;a href=&quot;https://github.com/tadzik/perl6-Term-ANSIColor/&quot;&gt;Term::ANSIColor&lt;/a&gt;. Also, there's a little bit of coupling between the data being generated in the slots and the output processing (the slots are all formatted to be 2 characters wide in anticipation of the output). There are some other improvements that could be done, but for a first cut at a calendar in Perl 6, I'm happy. :-)&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1841/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1841/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1841&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Mon, 24 Dec 2012 00:00:47 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 23 – Macros</title>
	<guid>http://perl6advent.wordpress.com/?p=1856</guid>
	<link>https://perl6advent.wordpress.com/2012/12/23/day-23-macros/</link>
	<description>&lt;p&gt;Syntactic macros. The Lisp gods of yore provided humanity with this invention, essentially making Lisp a programmable programming language. Lisp adherents often look at the rest of the programming world with pity, seeing them fighting to invent wheels that were wrought and polished back in the sixties when giants walked the Earth and people wrote code in all-caps.&lt;/p&gt;
&lt;p&gt;And the Lisp adherents see that the rest of us haven’t even gotten to the best part yet, the part with syntactic macros. We’re starting to get the hang of automatic memory management, continuations, and useful first-class functions. But macros are still absent from this picture.&lt;/p&gt;
&lt;p&gt;In part, this is because in order to have proper syntactic macros, you basically have to look like Lisp. You know, with the parentheses and all. Lisp ends up having almost no syntax at all, making every program a very close representation of a syntax tree. Which really helps when you have macros starting to manipulate those same trees. Other languages, not really wanting to look like Lisp, find it difficult-to-impossible to pull off the same trick.&lt;/p&gt;
&lt;p&gt;The Perl languages love the difficult-to-impossible. Perl programmers publish half a dozen difficult-to-impossible solutions to CPAN &lt;em&gt;before&lt;/em&gt; breakfast. And, because Perl 6 is awesome and syntactic macros are awesome, Perl 6 has syntactic macros.&lt;/p&gt;
&lt;p&gt;It is known, Khaleesi.&lt;/p&gt;
&lt;h2&gt;What are macros?&lt;/h2&gt;
&lt;p&gt;For reasons even I don’t fully understand, I’ve put myself in charge of implementing syntactic macros in Rakudo. Implementing macros means understanding them. Understanding them means my brain melts regularly. Unless it fries. It’s about 50-50.&lt;/p&gt;
&lt;p&gt;I have this habit where I come into the &lt;code&gt;#perl6&lt;/code&gt; channel, and exclaiming “macros are just X!” for various values of X. Here are some samples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Macros are just syntax tree manipulators.&lt;/li&gt;
&lt;li&gt;Macros are just “little compilers”.&lt;/li&gt;
&lt;li&gt;Macros are just a kind of templates.&lt;/li&gt;
&lt;li&gt;Macros are just routines that do code substitution.&lt;/li&gt;
&lt;li&gt;Macros allow you to safely hand values back and forth between the compile-time world and the runtime world.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But the definition that I finally found that I like best of all comes from &lt;a href=&quot;http://scalamacros.org/&quot;&gt;scalamacros.org&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Macros are functions that are called by the compiler during compilation. Within these functions the programmer has access to compiler APIs. For example, it is possible to generate, analyze and typecheck code.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;While we only cover the “generate” part of it yet in Perl 6, there’s every expectation we’ll be getting to the “analyze and typecheck” parts as well.&lt;/p&gt;
&lt;h2&gt;Some examples, please?&lt;/h2&gt;
&lt;p&gt;Coming right up.&lt;/p&gt;
&lt;pre&gt;macro checkpoint {
  my $i = ++(state $n);
  quasi { say &quot;CHECKPOINT $i&quot;; }
}

checkpoint;
for ^5 { checkpoint; }
checkpoint;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;quasi&lt;/code&gt; block is Perl 6′s way of saying “a piece of code, coming right up!”. You just put your code in the &lt;code&gt;quasi&lt;/code&gt; block, and return it from the macro routine.&lt;/p&gt;
&lt;p&gt;This code inserts “checkpoints” in our code, like little debugging messages. There’s only three checkpoints in the code, so the output we’ll get looks like this:&lt;/p&gt;
&lt;pre&gt;CHECKPOINT 1
CHECKPOINT 2
CHECKPOINT 2
CHECKPOINT 2
CHECKPOINT 2
CHECKPOINT 2
CHECKPOINT 3&lt;/pre&gt;
&lt;p&gt;Note that the “code insertion” happens at compile time. That’s why we get five copies of the &lt;code&gt;CHECKPOINT 2&lt;/code&gt; line, because it’s the same checkpoint running five times. If we had had a subroutine instead:&lt;/p&gt;
&lt;pre&gt;sub checkpoint {
  my $i = ++(state $n);
  say &quot;CHECKPOINT $i&quot;;
}&lt;/pre&gt;
&lt;p&gt;Then the program would print 7 distinct checkpoints.&lt;/p&gt;
&lt;pre&gt;CHECKPOINT 1
CHECKPOINT 2
CHECKPOINT 3
CHECKPOINT 4
CHECKPOINT 5
CHECKPOINT 6
CHECKPOINT 7&lt;/pre&gt;
&lt;p&gt;As a more practical example, let’s say you have logging output in your program, but you want to be able to switch it off completely. The problem with an ordinary logging subroutine is that with something like:&lt;/p&gt;
&lt;pre&gt;LOG &quot;The answer is { time-consuming-computation() }&quot;;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;time-consuming-computation()&lt;/code&gt; will run and take a lot of time even if &lt;code&gt;LOG&lt;/code&gt; subsequently finds that logging was turned off. (That’s just how argument evaluation works in a non-lazy language.)&lt;/p&gt;
&lt;p&gt;A macro fixes this:&lt;/p&gt;
&lt;pre&gt;constant LOGGING = True;

macro LOG($message) {
  if LOGGING {
    quasi { say {{{$message}}} };
  }
}&lt;/pre&gt;
&lt;p&gt;Here we see a new feature: the &lt;code&gt;{{{ }}}&lt;/code&gt; triple-block. (Syntax is likely to change in the near future, see below.) It’s our way to mix template code in the &lt;code&gt;quasi&lt;/code&gt; block with code coming in from other places. Doing &lt;code&gt;say $message;&lt;/code&gt; would have been wrong, because &lt;code&gt;$message&lt;/code&gt; is a syntax tree of the message to be logged. We need to inject that syntax tree right into the &lt;code&gt;quasi&lt;/code&gt;, and we do that with a triple-block.&lt;/p&gt;
&lt;p&gt;The macro &lt;em&gt;conditionally&lt;/em&gt; generates logging code in your program. If the constant &lt;code&gt;LOGGING&lt;/code&gt; is switched on, the appropriate logging code will replace each &lt;code&gt;LOG&lt;/code&gt; macro invocation. If &lt;code&gt;LOGGING&lt;/code&gt; is off, each macro invocation will be replaced by literally nothing.&lt;/p&gt;
&lt;p&gt;Experience shows that running no code at all is very efficient.&lt;/p&gt;
&lt;h2&gt;What are syntactic macros?&lt;/h2&gt;
&lt;p&gt;A lot of things are called “macros” in this world. In programming languages, there are two big categories:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Textual macros.&lt;/strong&gt; They substitute code on the level of the source code text. C’s macros, or Perl 5′s source filters, are examples.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Syntactic macros.&lt;/strong&gt; They substitute code on the level of the source code syntax tree. Lisp macros are an example.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Textual macros are very powerful, but they represent the kind of power that is just as likely to shoot half your leg off as it is to get you to your destination. Using them requires great care, of the same kind needed for a janitor gig at Jurassic Park.&lt;/p&gt;
&lt;p&gt;The problem is that textual macros don’t &lt;em&gt;compose&lt;/em&gt; all that well. Bring in more than one of them to work on the same bit of source code, and… all bets are off. This puts severe limits on modularity. Textual macros, being what they are, leak internal details all over the place. This is the big lesson from Perl 5′s source filters, as far as I understand.&lt;/p&gt;
&lt;p&gt;Syntactic macros compose wonderfully. The compiler is &lt;em&gt;already&lt;/em&gt; a pipeline handing off syntax trees between various processing steps, and syntactic macros are simply more such steps. It’s as if you and the compiler were two children, with the compiler going “Hey, you want to play in my sandbox? Jump right in. Here’s a shovel. We’ve got work to do.” A macro is a shovel.&lt;/p&gt;
&lt;p&gt;And syntactic macros allow us to be &lt;em&gt;hygienic&lt;/em&gt;, meaning that code in the macro and code outside of the macro don’t step on each other’s toes. In practice, this is done by carefully keeping track of the macros context and the mainline’s context, and making sure wires don’t cross. This is necessary for safe and large-scale composition. Textual macros don’t give us this option at all.&lt;/p&gt;
&lt;h2&gt;Future&lt;/h2&gt;
&lt;p&gt;Both of the examples in this post work already in Rakudo. But it might also be useful to know where we’re heading with macros in the next year or so. The list is in the approximate order I expect to tackle things.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Un-hygiene.&lt;/strong&gt; While hygienic macros are the sane and preferable default, sometimes you &lt;em&gt;want&lt;/em&gt; to step on the toes of the mainline code. There should be an opt-out, and escape hatch. This is next up.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Introspection.&lt;/strong&gt; In order to analyze and typecheck code, not just generate it, we need to be able to take syntax trees coming in as macro arguments, and look inside of them. There are no tools for that yet, and there’s no spec to guide us here. But I’m fairly sure people will want this. The trick is to come up with something that doesn’t tie us down to one compiler’s internal syntax-tree format. Both for the sake of compiler interoperability and future compatibility.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Deferred declarations.&lt;/strong&gt; The sandbox analogy isn’t so frivolous, really. If you declare a class inside a &lt;code&gt;quasi&lt;/code&gt; block, that declaration is limited (“sandboxed”) to within that &lt;code&gt;quasi&lt;/code&gt; block. Then, when the code is injected somewhere in the mainline because of a macro invocation, it should actually run. Fortunately, as it happens, the Rakudo internals are factored in such a way that this will be fairly straightforward to implement.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Better syntax.&lt;/strong&gt; The triple-block syntax is probably going away in favor of something better. The problem isn’t the syntax so much as the fact that it currently only works for terms. We want it to work for basically all syntactic categories. A solid proposal for this is yet to materialize, though.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With each of these steps, I expect us to find new and fruitful uses of macros. Knowing my fellow Perl 6 developers, we’ll probably find some uses that will shock and disgust us all, too.&lt;/p&gt;
&lt;h2&gt;In conclusion&lt;/h2&gt;
&lt;p&gt;Perl 6 is awesome because it puts &lt;em&gt;you&lt;/em&gt;, the programmer, in the driver seat. Macros are simply more of that.&lt;/p&gt;
&lt;p&gt;Implementing macros makes your brain melt. However, using them is relatively straightforward.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1856/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1856/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1856&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sun, 23 Dec 2012 17:07:05 +0000</pubDate>
</item>
<item>
	<title>Tadeusz Sośnierz (tadzik): Threads for Rakudo Perl 6</title>
	<guid>http://ttjjss.wordpress.com/?p=207</guid>
	<link>http://ttjjss.wordpress.com/2012/12/22/threads-for-rakudo-perl-6/</link>
	<description>&lt;p&gt;So it has come to this. &lt;a href=&quot;https://github.com/tadzik/Threads&quot;&gt;Threads.pm&lt;/a&gt; is up and running, bringing the ever-wanted threaded execution to the most popular Perl 6 implementation.&lt;/p&gt;
&lt;p&gt;You’re looking for TL;DR, aren’t you? Here’s what it’s capable of:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;use Threads;
use Semaphore;

my @elements;
my $free-slots = Semaphore.new(value =&amp;gt; 10);
my $full-slots = Semaphore.new(value =&amp;gt; 0);

sub produce($id) {
    my $i = 0;
    loop {
        $free-slots.wait;
        @elements.push: $i;
        $i++;
        $full-slots.post;
    }
}

sub consume($id) {
    loop {
        $full-slots.wait;
        my $a = @elements.shift;
        $free-slots.post;
    }
}

for 1..5 -&amp;gt; $i {
    async sub { produce($i)  }
}

for 5..10 -&amp;gt; $i {
    async sub { consume($i) }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Doesn’t look &lt;em&gt;that&lt;/em&gt; awesome. I mean, it’s just a producer-consumer problem, what’s the big deal? Let me repeat:&lt;/p&gt;
&lt;p&gt;OMG, RAKUDO HAS WORKING THREADS.&lt;/p&gt;
&lt;p&gt;So, once we’re done celebrating and dancing macarena all around, there’ll always be someone to ask “hold on, there’s gotta be a caveat. Something surely is missing, explain yourself!”&lt;/p&gt;
&lt;p&gt;I’ll be delighted to say “nope, everything’s there!”, but that’d make me a liar. Yeah, there are missing pieces. First, those aren’t really native threads – just green threads. Native OS threads are already implemented in Parrot VM, but NQP (the language that Rakudo is based on) still doesn’t support them, so before some volunteer comes along to fix them, you’ll still have to build parrot &lt;code&gt;--without-threads&lt;/code&gt; (which means: use green threads, not OS threads) for Threads.pm to work. But fear not! The API is exactly the same, so once native threads are there, both Threads.pm and the code you write with it should work without any changes.&lt;/p&gt;
&lt;p&gt;But green threads are fine too! Except for one minor detail: whenever any of them blocks on IO, the entire Parrot comes to a halt. The plan is for Parrot threads scheduler to handle it nicely, but it’s not there yet, so if you expected nice and easy async IO, sorry, but you’re stuck on &lt;a href=&quot;https://github.com/tadzik/MuEvent&quot; title=&quot;MuEvent on github&quot;&gt;MuEvent&lt;/a&gt; :)&lt;/p&gt;
&lt;p&gt;Yep, we’re not &lt;em&gt;really&lt;/em&gt; there yet. But I claim it’s closer than ever. We have working threads implementation. You can write code with that, and it’s not a PITA. Go for it! There’s a lot of room to improve it. I didn’t try really hard for Threads.pm to follow the concurrency synopsis (in my defense, I think niecza doesn’t follow it either :)), and I think that once we unleash a wolfpack of developers which can work towards something that we’ll all love to use.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/ttjjss.wordpress.com/207/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/ttjjss.wordpress.com/207/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=ttjjss.wordpress.com&amp;amp;blog=15099040&amp;amp;post=207&amp;amp;subd=ttjjss&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 22 Dec 2012 10:36:54 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W51</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W51.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W51.html</link>
	<description>&lt;p&gt;TODO: Insert the description of changes. Also, mention that Rakudo 2012.12 (Warszawa) was released and that Rakudo isn’t Rakudo Star.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;rakudo_perl_in_rakudo_201212&quot;&gt;Rakudo Perl (in Rakudo 2012.12)&amp;gt;&lt;ul&gt;
&lt;li&gt;When disambiguating hash/block, and &lt;code&gt;$_&lt;/code&gt; variable is used, Rakudo assumes block. This could break your code if you were expecting a hash.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl_post_rakudo_201212&quot;&gt;Rakudo Perl (post Rakudo 2012.12)&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;my $a; { $a; my $a }&lt;/code&gt; is an error.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;for&lt;/code&gt; runs in sink (void) or list context, just like &lt;code&gt;map&lt;/code&gt; (actually, &lt;code&gt;for&lt;/code&gt; does exactly what &lt;code&gt;map&lt;/code&gt; does). If you were depending on it, you can use &lt;code&gt;eager do&lt;/code&gt; before &lt;code&gt;for&lt;/code&gt; to force eager execution.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl_in_rakudo_201212&quot;&gt;Rakudo Perl (in Rakudo 2012.12)&amp;gt;&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;X::Comp::Group&lt;/code&gt; exception. It’s used when compilation can produce multiple issues.&lt;/li&gt;

&lt;li&gt;Added support for warnings. Code like &lt;code&gt;my ($a, $a);&lt;/code&gt; only causes warnings, not fatal errors.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;X::Undeclared::Symbols&lt;/code&gt; exception for variables that weren’t declared, but used.&lt;/li&gt;

&lt;li&gt;You can use &lt;code&gt;.message&lt;/code&gt; on &lt;code&gt;Exception&lt;/code&gt;s.&lt;/li&gt;

&lt;li&gt;Fixed &lt;code&gt;.perl&lt;/code&gt; output for a &lt;code&gt;Pair&lt;/code&gt; that has key that is a &lt;code&gt;Pair&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;X::Item&lt;/code&gt; is thrown for &lt;code&gt;@a[NaN]&lt;/code&gt; or &lt;code&gt;@a[Inf]&lt;/code&gt;. It isn’t incompatible change because it wasn’t working before anyway.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 22 Dec 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 22 – Parsing an IPv4 address</title>
	<guid>http://perl6advent.wordpress.com/?p=1813</guid>
	<link>https://perl6advent.wordpress.com/2012/12/22/day-22-parsing-an-ipv4-address/</link>
	<description>&lt;p&gt;&lt;em&gt;Guest post by Herbert Breunung (lichtkind).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Perl 5 brought regexes to mainstream programming and set a standard, one that is felt as relevant even in Redmond. Perl 6, of course, steps up the game by adding many new features to the regex camp, including &lt;a href=&quot;http://perl6advent.wordpress.com/2009/12/21/day-21-grammars-and-actions&quot;&gt;easy-to-build grammars&lt;/a&gt; for your own complex parsers. But without getting too complex, you can get a lot of joy out of Perl 6′s &lt;code&gt;rx&lt;/code&gt;  (that’s how Perl 6 spells Perl 5′s &lt;code&gt;qr&lt;/code&gt; operator, that enables you to save a Regex in a variable).&lt;/p&gt;
&lt;p&gt;Because the Perl 6 regex syntax is less littered with exceptional cases, Larry Wall also likes to joke that he put the “regular” back into “regular expression”.&lt;/p&gt;
&lt;p&gt;Some of the changes are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;most special variables are gone,&lt;/li&gt;
&lt;li&gt;non-capturing groups and other grouping syntax is easier to type,&lt;/li&gt;
&lt;li&gt;no more single/multi line modes,&lt;/li&gt;
&lt;li&gt;x mode became default, making whitespace non-significant by default.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In summary, regexes are more regular than in Perl 5, confirming Larry’s joke. They try a bit harder to make your life easier when you need to match text. Under the hood, regexes have blossomed out into a complete sub-language within the bigger Perl 6 language. A language with its own parsing rules.&lt;/p&gt;
&lt;p&gt;But don’t fret; not everything has changed. Some things remain the same:&lt;/p&gt;
&lt;pre&gt;/\d+/&lt;/pre&gt;
&lt;p&gt;This regex still matches one or more consecutive digits.&lt;/p&gt;
&lt;p&gt;Similarly, if you want to capture the digits, you can do this, just like you’re used to:&lt;/p&gt;
&lt;pre&gt;/(\d+)/&lt;/pre&gt;
&lt;p&gt;You’ll find the matched digits in &lt;code&gt;$0&lt;/code&gt;, not &lt;code&gt;$1&lt;/code&gt; as in Perl 5. All the special variables &lt;code&gt;$0&lt;/code&gt;, &lt;code&gt;$1&lt;/code&gt;, &lt;code&gt;$2&lt;/code&gt; are really syntactic sugar for indexing the &lt;em&gt;match variable&lt;/em&gt; (&lt;code&gt;$/[0]&lt;/code&gt;, &lt;code&gt;$/[1]&lt;/code&gt;, &lt;code&gt;$/[2]&lt;/code&gt;). Because indices start at 0, it makes sense for the first matched group to be &lt;code&gt;$0&lt;/code&gt;. In Perl 5, &lt;code&gt;$0&lt;/code&gt; contains the name of the script or program, but this has been renamed into &lt;code&gt;$*EXECUTABLE_NAME&lt;/code&gt; in Perl 6.&lt;/p&gt;
&lt;p&gt;Should you be interested in getting all of the captured groups of a regex match, you can use &lt;code&gt;@()&lt;/code&gt;, which is syntactic sugar for &lt;code&gt;@($/)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The object in the &lt;code&gt;$/&lt;/code&gt; variable holds lots of useful information about the last match. For example, &lt;code&gt;$/.from&lt;/code&gt; will give you the starting string position of the match.&lt;/p&gt;
&lt;p&gt;But &lt;code&gt;$0&lt;/code&gt; will get us far enough for this post. We use it to extract individual features from a string.&lt;/p&gt;
&lt;p&gt;Sometimes we want to extract a whole bunch of similar things at once. Then we can use the &lt;code&gt;:g&lt;/code&gt; (or &lt;code&gt;:global&lt;/code&gt;) modifier on the regex:&lt;/p&gt;
&lt;pre&gt;$_ = '1 23 456 78.9';
say .Str for m:g/(\d+)/; # 1 23 456 78 9&lt;/pre&gt;
&lt;p&gt;Note that the &lt;code&gt;:g&lt;/code&gt; — as opposed to prior regex implementations — sits up front, right at the start of the regex. Not at the end. That way, when you read the regex from left to right, you will know from the start how the regex is doing its matching. No more end-heavy regex expressions.&lt;/p&gt;
&lt;p&gt;Matching “all things that look like this” is so useful, that there’s even a dedicated method for that, &lt;code&gt;.comb&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;$str.comb(/\d+/);&lt;/pre&gt;
&lt;p&gt;If you’re familiar with &lt;code&gt;.split&lt;/code&gt;, you can think of &lt;code&gt;.comb&lt;/code&gt; as its cheerful cousin, matching all the things that &lt;code&gt;.split&lt;/code&gt; discards.&lt;/p&gt;
&lt;p&gt;Let’s tackle the matching of an IPv4 address. Coming from a Perl 5 angle, we expect to have to do something like this:&lt;/p&gt;
&lt;pre&gt;/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/&lt;/pre&gt;
&lt;p&gt;This won’t do in Perl 6, though. First of all, the &lt;code&gt;{}&lt;/code&gt; blocks are real blocks in a Perl 6 regex; they contain Perl 6 code. Second, because Perl 6 has lots of error handling to catch p5isms, like this, you’ll get an error saying “Unsupported use of {N,M} as general quantifier; in Perl 6 please use ** N..M (or ** N..*)”.&lt;/p&gt;
&lt;p&gt;So let’s do that. To match between one and three digits in a Perl 6 regex, we should type:&lt;/p&gt;
&lt;pre&gt;/\d ** 1..3/&lt;/pre&gt;
&lt;p&gt;Note how the regex sublanguage re-uses parts from the main Perl 6 language. &lt;code&gt;**&lt;/code&gt; can be seen as a kind of exponentiation (if we squint), in that we’re taking &lt;code&gt;\d&lt;/code&gt; “to the between-first-and-third power”. And the range notation &lt;code&gt;1..3&lt;/code&gt; exists both outside and within regexes.&lt;/p&gt;
&lt;p&gt;Using our new knowledge about the repetition quantifier, we end up with something like this:&lt;/p&gt;
&lt;pre&gt;/(\d**1..3) \. (\d**1..3) \. (\d**1..3) \. (\d**1..3)/&lt;/pre&gt;
&lt;p&gt;That’s still kinda clunky. We might end up wishing that we could use the repetition operator again, but those literal dots in between prevent us from doing that. If only we could specify repetition a given number of times &lt;em&gt;and&lt;/em&gt; a divider.&lt;/p&gt;
&lt;p&gt;In Perl 6 regexes, you can.&lt;/p&gt;
&lt;pre&gt;/ (\d ** 1..3) ** 4 % '.' /&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;%&lt;/code&gt; operator here is a &lt;em&gt;quantifier modifier&lt;/em&gt;, so it can only follow on a quantifier like &lt;code&gt;*&lt;/code&gt; or &lt;code&gt;+&lt;/code&gt; or &lt;code&gt;**&lt;/code&gt;. The choice of &lt;code&gt;%&lt;/code&gt; for this function is relatively new in Perl 6, and you may prefer to read it as “modulo”, just like in the main language. That is, “match four groups of digits, modulo literal dots in between”. Or you could think of the dots in between as the “remainder”, the separators that are left after you’ve parsed the actual elements.&lt;/p&gt;
&lt;p&gt;Oh, and you might’ve noticed that &lt;code&gt;\.&lt;/code&gt; changed to &lt;code&gt;'.'&lt;/code&gt; on the way. We can use either; they mean exactly the same. In Perl 5, there isn’t a simple rule saying which symbols have a magic meaning and which ones simply signify themselves. In Perl 6, it’s easy: word characters (alphanumerics and the underscore) always signify themselves. Everything else has to be escaped or quoted to get its literal meaning.&lt;/p&gt;
&lt;p&gt;Putting it all together, here’s how we would extract IPv4 addresses out of a string:&lt;/p&gt;
&lt;pre&gt;$_ = &quot;Go 127.0.0.1, I said! He went to 173.194.32.32.&quot;;

say .Str for m:g/ (\d ** 1..3) ** 4 % '.' /;
# output: 127.0.0.1 173.194.32.32&lt;/pre&gt;
&lt;p&gt;Or, we could use &lt;code&gt;.comb&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;$_ = &quot;Go 127.0.0.1, I said! He went to 173.194.32.32.&quot;;
my @ip4addrs = .comb(/ (\d ** 1..3) ** 4 % '.' /);&lt;/pre&gt;
&lt;p&gt;If we’re interested in individual integers, we can get those too:&lt;/p&gt;
&lt;pre&gt;$_ = &quot;Go 127.0.0.1, I said! He went to 173.194.32.32.&quot;;
say .list&amp;gt;&amp;gt;.Str.perl for m:g/ (\d ** 1..3) ** 4 % '.' /;
# output: (&quot;127&quot;, &quot;0&quot;, &quot;0&quot;, &quot;1&quot;) (&quot;173&quot;, &quot;194&quot;, &quot;32&quot;, &quot;32&quot;)&lt;/pre&gt;
&lt;p&gt;If you want to know more, read &lt;a href=&quot;http://perlcabal.org/syn/S05.html&quot;&gt;the S05&lt;/a&gt;, or watch me battling with my slide deck and the English language in &lt;a href=&quot;http://www.youtube.com/watch?v=6Q19mbOtk3c&quot;&gt;this presentation about regexes&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1813/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1813/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1813&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 22 Dec 2012 00:01:22 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 21 – Collatz Variations</title>
	<guid>http://perl6advent.wordpress.com/?p=1790</guid>
	<link>https://perl6advent.wordpress.com/2012/12/21/day-21-collatz-variations/</link>
	<description>&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Collatz_conjecture&quot;&gt;Collatz sequence&lt;/a&gt; is one of those interesting “simple” math problems that I’ve run into a number of times.  Most recently a blog post on &lt;a href=&quot;http://blog.racket-lang.org/2012/10/the-3n1-problem_4990.html&quot;&gt;programming it in Racket&lt;/a&gt; showed up on Hacker News.  As happens so often, I instantly wanted to implement it in Perl 6.&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-sequence(Int $start) { 
    $start, { when * %% 2 { $_ / 2 }; when * !%% 2 { 3 * $_ + 1 }; } ... 1;
}

sub MAIN(Int $min, Int $max) {
    say [max] ($min..$max).map({ +collatz-sequence($_) });        
}
&lt;/pre&gt;
&lt;p&gt;This is a very straightforward implementation of the Racket post’s &lt;code&gt;max-cycle-length-range&lt;/code&gt; as a stand-alone p6 script.  &lt;code&gt;collatz-sequence&lt;/code&gt; generates the sequence using the p6 sequence operator.  Start with the given number.  If it is divisible by two, do so: &lt;code&gt;when * %% 2 { $_ / 2 }&lt;/code&gt;.  If it is not, multiply by three and add 1: &lt;code&gt;when * !%% 2 { 3 * $_ + 1 }&lt;/code&gt;.  Repeat this until the sequence reaches 1.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;MAIN(Int $min, Int $max)&lt;/code&gt; sets up our main function to take two integers.  Many times I don’t bother with argument types in p6, but this provides a nice feedback for users:&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;&amp;gt; perl6 collatz.pl blue red
Usage:
  collatz.pl &amp;lt;min&amp;gt; &amp;lt;max&amp;gt; 
&lt;/pre&gt;
&lt;p&gt;The core of it just maps the numbers from &lt;code&gt;$min&lt;/code&gt; to &lt;code&gt;$max&lt;/code&gt; (inclusive) to the length of the sequence (&lt;code&gt;+collatz-sequence&lt;/code&gt;) and then says the max of the resulting list (&lt;code&gt;[max]&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;Personally I’m a big fan of using the sequence operator for tasks like this; it directly represents the algorithm constructing the Collatz sequence in a simple and elegant fashion.  On the other hand, you should be able to memoize the recursive version for a speed increase.  Maybe that would give it an edge over the sequence operator version?&lt;/p&gt;
&lt;p&gt;Well, I was wildly wrong about that.&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-length($start) {
    given $start {
        when 1       { 1 }
        when * !%% 2 { 1 + collatz-length(3 * $_ + 1) } 
        when * %% 2  { 1 + collatz-length($_ / 2) } 
    }
}

sub MAIN($min, $max) {
    say [max] ($min..$max).map({ collatz-length($_) });        
}
&lt;/pre&gt;
&lt;p&gt;This recursive version, which makes no attempt whatsoever to be efficient, is actually better than twice as fast as the sequence operator version.  In retrospect, this makes perfect sense: I was worried about the recursive version making a function call for every iteration, but the sequence version has to make two, one to calculate the next iteration and the other to check and see if the ending condition has been reached.&lt;/p&gt;
&lt;p&gt;Well, once I’d gotten this far, I thought I’d better do things correctly.  I wrote two framing scripts, one for timing all the available scripts, the other for testing them to make sure they work!&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;my @numbers = 1..200, 10000..10200;

sub MAIN(Str $perl6, *@scripts) {
    my %results;
    for @scripts -&amp;gt; $script {
        my $start = now;
        qqx/$perl6 $script { @numbers }/;
        my $end = now;

        %results{$script} = $end - $start;
    }

    for %results.pairs.sort(*.value) -&amp;gt; (:key($script), :value($time)) {
        say &quot;$script: $time seconds&quot;;
    }
}
&lt;/pre&gt;
&lt;p&gt;This script takes as an argument a string that can be used to call a Perl 6 executable and a list of scripts to run.  It runs the scripts using the specified executable, and times them using p6′s &lt;code&gt;now&lt;/code&gt; function.  It then sorts the results into order and prints them.  (A &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/testing-harness.pl&quot;&gt;similar script&lt;/a&gt; I won’t post here tests each of them to make sure they are returning correct results.)&lt;/p&gt;
&lt;p&gt;In the new framework, the Collatz script has changed a bit.  Instead of taking a min and a max value and finding the longest Collatz sequence generated by a number in that range, it takes a series of numbers and generates and reports the length of the sequence for each of them.  Here’s the sequence operator script in its full new version:&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-length(Int $start) { 
    +($start, { when * %% 2 { $_ / 2 }; when * !%% 2 { 3 * $_ + 1 }; } ... 1);
}

sub MAIN(*@numbers) {
    for @numbers -&amp;gt; $n {
        say &quot;$n: &quot; ~ collatz-length($n.Int);
    }
}
&lt;/pre&gt;
&lt;p&gt;For the rest of the scripts I will skip the &lt;code&gt;MAIN&lt;/code&gt; sub, which is exactly the same in each of them.&lt;/p&gt;
&lt;p&gt;Framework established, I redid the recursive version starting from the new sequence operator code.&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-length(Int $n) {
    given $n {
        when 1       { 1 }
        when * %% 2  { 1 + collatz-length($_ div 2) }
        when * !%% 2 { 1 + collatz-length(3 * $_ + 1) }
    } 
}
&lt;/pre&gt;
&lt;p&gt;The sharp-eyed will notice this version is different from the first recursive version above in two significant ways.  This time I made the argument &lt;code&gt;Int $n&lt;/code&gt;, which instantly turned up a bit of a bug in all implementations thus far: because I used &lt;code&gt;$_ / 2&lt;/code&gt;, most of the numbers in the sequence were actually rationals, not integers!  This shouldn’t change the results, but is probably less efficient than using &lt;code&gt;Int&lt;/code&gt;s.  Thus the second difference about, it now uses &lt;code&gt;$_ div 2&lt;/code&gt; to divide by 2.  This version remains a great improvement over the sequence operator version, running in 4.7 seconds instead of 13.3.  Changing &lt;code&gt; when * !%% 2&lt;/code&gt; to a simple &lt;code&gt;default&lt;/code&gt; shaves another .3 seconds off the running time.&lt;/p&gt;
&lt;p&gt;Once I started wondering how much time was getting eaten up by the &lt;code&gt;when&lt;/code&gt; statements, rewriting that bit using the ternary operator was an obvious choice.&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-length(Int $start) { 
    +($start, { $_ %% 2 ?? $_ div 2 !! 3 * $_ + 1 } ... 1);
}
&lt;/pre&gt;
&lt;p&gt;Timing results: Basic sequence 13.4 seconds.  Sequence with &lt;code&gt;div&lt;/code&gt; 11.5 seconds.  Sequence with &lt;code&gt;div&lt;/code&gt; and ternary 9.7 seconds.&lt;/p&gt;
&lt;p&gt;That made me wonder what kind of performance I could get from a handcoded loop.&lt;/p&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot;&gt;sub collatz-length(Int $n is copy) {
    my $length = 1;
    while $n != 1 {
        $n = $n %% 2 ?? $n div 2 !! 3 * $n + 1;
        $length++;
    }
    $length;
}
&lt;/pre&gt;
&lt;p&gt;That’s by far the least elegant of these, I think, but it gets great performance: 3 seconds.&lt;/p&gt;
&lt;p&gt;Switching back to the recursive approach, how about using the ternary operator there?&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-length(Int $n) {
    return 1 if $n == 1;
    1 + ($n %% 2 ?? collatz-length($n div 2) !! collatz-length(3 * $n + 1));
}
&lt;/pre&gt;
&lt;p&gt;This one just edges out the handcoded loop, 2.9 seconds.&lt;/p&gt;
&lt;p&gt;Can we do better than that?  How about memoization?  &lt;code&gt;is cached&lt;/code&gt; is supposed to be part of Perl 6; neither implementation has it yet, but last year’s &lt;a href=&quot;http://perl6advent.wordpress.com/2011/12/04/traits-meta-data-with-character/&quot;&gt;Advent calendar has a Rakudo implementation&lt;/a&gt; that still works.  Using the last version changed to &lt;code&gt;sub collatz-length(Int $n) is cached {&lt;/code&gt; works nicely, but takes 3.4 seconds to execute.  Apparently the overhead of caching slows it down a bit.  Interestingly, the non-ternary recursive version does speed up with &lt;code&gt;is cached&lt;/code&gt;, from 4.4 seconds to 3.6 seconds.&lt;/p&gt;
&lt;p&gt;Okay, instead of using a generic memoization, how about hand-coding one?&lt;/p&gt;
&lt;pre class=&quot;brush: plain; light: true; title: ; notranslate&quot;&gt;sub collatz-length(Int $n) {
    return 1 if $n == 1;
    state %lengths;
    return %lengths{$n} if %lengths.exists($n);
    %lengths{$n} = 1 + ($n %% 2 ?? collatz-length($n div 2) !! collatz-length(3 * $n + 1));
}
&lt;/pre&gt;
&lt;p&gt;Bingo!  2.7 seconds.&lt;/p&gt;
&lt;p&gt;I’m sure there are lots of other interesting approaches for solving this problem, and encourage people to send them in.  In the meantime, here’s my summary of results so far:&lt;/p&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot;&gt;
&lt;tbody&gt;&lt;tr&gt;
&lt;td&gt;Script&lt;/td&gt;
&lt;td&gt;Rakudo&lt;/td&gt;
&lt;td&gt;Niecza&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-recursive-ternary-hand-cached.pl&quot;&gt; bin/collatz-recursive-ternary-hand-cached.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 2.5 &lt;/td&gt;
&lt;td&gt; 1.7 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-recursive-ternary.pl&quot;&gt; bin/collatz-recursive-ternary.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 3 &lt;/td&gt;
&lt;td&gt; 1.7 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-loop.pl&quot;&gt; bin/collatz-loop.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 3.1 &lt;/td&gt;
&lt;td&gt; 1.7 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-recursive-ternary-cached.pl&quot;&gt; bin/collatz-recursive-ternary-cached.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 3.2 &lt;/td&gt;
&lt;td&gt; N/A &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-recursive-default-cached.pl&quot;&gt; bin/collatz-recursive-default-cached.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 3.5 &lt;/td&gt;
&lt;td&gt; N/A &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-recursive-default.pl&quot;&gt; bin/collatz-recursive-default.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 4.4 &lt;/td&gt;
&lt;td&gt; 1.8 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-recursive.pl&quot;&gt; bin/collatz-recursive.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 4.9 &lt;/td&gt;
&lt;td&gt; 1.9 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-sequence-ternary.pl&quot;&gt; bin/collatz-sequence-ternary.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 9.9 &lt;/td&gt;
&lt;td&gt; 3.3 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-sequence-div.pl&quot;&gt; bin/collatz-sequence-div.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 11.6 &lt;/td&gt;
&lt;td&gt; 3.5 &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt; &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/collatz-sequence.pl&quot;&gt; bin/collatz-sequence.pl &lt;/a&gt; &lt;/td&gt;
&lt;td&gt; 13.5 &lt;/td&gt;
&lt;td&gt; 3.8 &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The table was generated from &lt;a href=&quot;https://github.com/colomon/perl6-collatz/blob/master/bin/timing-table-generator.pl&quot;&gt;timing-table-generator.pl&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1790/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1790/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1790&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Fri, 21 Dec 2012 12:25:40 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 20 – Dynamic variables and DSL-y things</title>
	<guid>http://perl6advent.wordpress.com/?p=1783</guid>
	<link>https://perl6advent.wordpress.com/2012/12/20/day-20-dynamic-variables-and-dsl-y-things/</link>
	<description>&lt;p&gt;Today, let’s talk about DSLs.&lt;/p&gt;
&lt;h2&gt;Post from the past: a motivating example&lt;/h2&gt;
&lt;p&gt;Two years ago I wrote &lt;a href=&quot;http://strangelyconsistent.org/blog/the-thing-with-nim&quot;&gt;a blog post about Nim&lt;/a&gt;, a game played with piles of stones. I just put in ASCII diagrams of the actual Nim stone piles, telling myself that if I had time, I would put in fancy SVG diagrams, generated with Perl 6.&lt;/p&gt;
&lt;p&gt;Naturally, I didn’t have time. My self-imposed deadline ran out, and I published the post with simple ASCII diagrams.&lt;/p&gt;
&lt;p&gt;But time is ever-regenerative, and there for people who want it. So, let’s generate some fancy SVG diagrams with Perl 6.&lt;/p&gt;
&lt;h2&gt;Have bit array, want SVG&lt;/h2&gt;
&lt;p&gt;What do we need, exactly? Well, a subroutine that takes an array of piles as input and generates an SVG file would be a really good start.&lt;/p&gt;
&lt;p&gt;Let’s take the last “image” in &lt;a href=&quot;http://strangelyconsistent.org/blog/the-thing-with-nim&quot;&gt;the post&lt;/a&gt; as an example:&lt;/p&gt;
&lt;pre&gt;3      OO O
4 OOOO
5 OOOO    O&lt;/pre&gt;
&lt;p&gt;For the moment, let’s ignore the numbers at the left margin; they’re just counting stones. We summarize the piles themselves as a kind of bitmap, which also forms the input to the function:&lt;/p&gt;
&lt;pre&gt;my @piles =
    [0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 1, 1, 1, 0, 1, 1, 0, 1],
    [1, 1, 1, 1, 0, 0, 0, 0, 1];

nim-svg(@piles);&lt;/pre&gt;
&lt;p&gt;At this point, we need only create the &lt;code&gt;nim-svg&lt;/code&gt; function itself, and make it render SVG from this bitmap. Since I’ve long since tired of outputting SVG by hand, I use the &lt;a href=&quot;https://github.com/moritz/svg&quot;&gt;SVG module&lt;/a&gt;, which comes bundled with Rakudo Star.&lt;/p&gt;
&lt;pre&gt;use SVG;

sub nim-svg(@piles) {
    my $width = max map *.elems, @piles;
    my $height = @piles.elems;

    my @elements = gather for @piles.kv -&amp;gt; $row, @pile {
        for @pile.kv -&amp;gt; $column, $is_filled {
            if $is_filled {
                take 'circle' =&amp;gt; [
                    :cx($column + 0.5),
                    :cy($row + 0.5),
                    :r(0.4)
                ];
            }
        }
    }
    
    say SVG.serialize('svg' =&amp;gt; [ :$width, :$height, @elements ]);
}&lt;/pre&gt;
&lt;p&gt;I think you can follow the logic in there. The subroutine simply iterates over the bitmap, turning 1s into circles with appropriate coordinates.&lt;/p&gt;
&lt;h2&gt;That’s it?&lt;/h2&gt;
&lt;p&gt;Well, this will indeed generate an SVG image for us, with the stones correctly placed. But let’s look again at the input that helped create this image:&lt;/p&gt;
&lt;pre&gt;    [0, 0, 0, 0, 0, 0, 0, 0, 1],
    [1, 1, 1, 1, 0, 1, 1, 0, 1],
    [1, 1, 1, 1, 0, 0, 0, 0, 1];&lt;/pre&gt;
&lt;p&gt;Clearly, though we can discern the stones and gaps in there if we squint in a bit-aware programmer’s fashion, the input isn’t… visually attractive. (The zeroes even look like stones, even though they’re gaps!)&lt;/p&gt;
&lt;h2&gt;We can do better&lt;/h2&gt;
&lt;p&gt;Instead of using a bit array, let’s start from the desired SVG image and try to make the input look like that.&lt;/p&gt;
&lt;p&gt;So, this is what I would prefer to write instead of a bitmask:&lt;/p&gt;
&lt;pre&gt;nim {
  _ _ _ _ _ _ _ _ o;
  o o o o _ o o _ o;
  o o o o _ _ _ _ o;
}&lt;/pre&gt;
&lt;p&gt;That’s better. That looks more like my original ASCII diagram, while still being syntactic Perl 6 code.&lt;/p&gt;
&lt;h2&gt;Making a DSL&lt;/h2&gt;
&lt;p&gt;Wikipedia talks about a DSL as a language “dedicated to a particular problem domain”. Well, the above way of specifying the input would be a DSL dedicated to solving the draw-SVG-images-of-Nim-positions domain. (Admittedly a fairly narrow domain. But I’m mostly out to show the potential of DSLs in Perl 6, not to change the world with this particular DSL.)&lt;/p&gt;
&lt;p&gt;Now that we have the desired end state, how do we connect the wires and make the above work? Clearly we need to declare three subroutines: &lt;code&gt;nim&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;, &lt;code&gt;o&lt;/code&gt;. (Yes, you can name a subroutine &lt;code&gt;_&lt;/code&gt;, no sweat.)&lt;/p&gt;
&lt;pre&gt;sub nim(&amp;amp;block) {
    my @*piles;
    my @*current-pile;

    &amp;amp;block();
    finish-last-pile();
    
    nim-svg(@*piles);
}

sub _(@rest?) {
    unless @rest {
        finish-last-pile();
    }
    @*current-pile = 0, @rest;
    return @*current-pile;
}

sub o(@rest?) {
    unless @rest {
        finish-last-pile();
    }
    @*current-pile = 1, @rest;
    return @*current-pile;
}&lt;/pre&gt;
&lt;h2&gt;Ok… explain, please?&lt;/h2&gt;
&lt;p&gt;A couple of things are going on here.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The two variables &lt;code&gt;@*piles&lt;/code&gt; and &lt;code&gt;@*current-pile&lt;/code&gt; are &lt;em&gt;dynamic variables&lt;/em&gt; which means that they are visible not just in the current lexical scope, but also in all subroutines called before the current scope has finished. Notably, the two subroutines &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;o&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The two subroutines &lt;code&gt;_&lt;/code&gt; and &lt;code&gt;o&lt;/code&gt; take an optional parameter. On each row, the rightmost &lt;code&gt;_&lt;/code&gt; or &lt;code&gt;o&lt;/code&gt; acts as a silent “start of pile” marker, taking the time to do a bit of bookkeeping with the piles, storing away the last pile and starting on a new one.&lt;/li&gt;
&lt;li&gt;Each row in the DSL-y input basically forms a chain of subroutine calls. We take this into account by both incrementally building the &lt;code&gt;@*current-pile&lt;/code&gt; array at each step, all the while returning it as (possible) input for the next subroutine call in the chain.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And that’s it. Oh yeah, we need the bookkeeping routine &lt;code&gt;finish-last-pile&lt;/code&gt;, too:&lt;/p&gt;
&lt;pre&gt;sub finish-last-pile() {
    if @*current-pile {
        push @*piles, [@*current-pile];
    }
    @*current-pile = ();
}&lt;/pre&gt;
&lt;h2&gt;So, it works?&lt;/h2&gt;
&lt;p&gt;Now, the whole thing works. We can turn this DSL-y input:&lt;/p&gt;
&lt;pre&gt;nim {
  _ _ _ _ _ _ _ _ o;
  o o o o _ o o _ o;
  o o o o _ _ _ _ o;
}&lt;/pre&gt;
&lt;p&gt;…into this SVG output:&lt;/p&gt;
&lt;pre&gt;&amp;lt;svg
  xmlns=&quot;http://www.w3.org/2000/svg&quot;
  xmlns:svg=&quot;http://www.w3.org/2000/svg&quot;
  xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;
  width=&quot;9&quot; height=&quot;3&quot;&amp;gt;

  &amp;lt;circle cx=&quot;8.5&quot; cy=&quot;0.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;0.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;1.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;2.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;3.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;5.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;6.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;8.5&quot; cy=&quot;1.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;0.5&quot; cy=&quot;2.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;1.5&quot; cy=&quot;2.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;2.5&quot; cy=&quot;2.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;3.5&quot; cy=&quot;2.5&quot; r=&quot;0.4&quot; /&amp;gt;
  &amp;lt;circle cx=&quot;8.5&quot; cy=&quot;2.5&quot; r=&quot;0.4&quot; /&amp;gt;
&amp;lt;/svg&amp;gt;&lt;/pre&gt;
&lt;p&gt;Yay!&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;The principles I used in this post are fairly easy to generalize. Start from your desired DSL, and create the subroutines to make it happen. Have dynamic variables handle the communication between separate subroutines.&lt;/p&gt;
&lt;p&gt;DSLs are nice because they allow us to shape the code we’re writing around the problem we’re solving. Using relatively little “adapter code”, we’re left to focus on describing and solving problems in a natural way, making the programming language rise to our needs instead of lowering ourselves down to its needs.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1783/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1783/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1783&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 20 Dec 2012 00:01:06 +0000</pubDate>
</item>
<item>
	<title>perl6.announce: Parrot 4.11.0 &quot;All together - Happy Birthday Lovebird&quot; Released! by Reini Urban</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2012/12/msg690.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2012/12/msg690.html</link>
	<description>On behalf of the Parrot team, I'm proud to announce Parrot 4.11.0, also known&lt;br /&gt;as &quot;All together - Happy Birthday Lovebird&quot;.&lt;br /&gt;Parrot (http://parrot.org/) is a virtual machine aimed at running all&lt;br /&gt;dynamic languages.&lt;br /&gt;&lt;br /&gt;Parrot 4.11.0 is available on Parrot's FTP site&lt;br /&gt;(ftp://ftp.parrot.org/pub/parrot/releases/devel/4.11.0/),&lt;br /&gt;or by following the download instructions at http://parrot.org/download.&lt;br /&gt;For those who would like to develop on Parrot, or help develop Parrot&lt;br /&gt;itself, we recommend using&lt;br /&gt;Git to retrieve the source code to get the latest and best Parrot code.&lt;br /&gt;&lt;br /&gt;Threads are considered experimental. There are a known GC bugs when&lt;br /&gt;running large threads&lt;br /&gt;on darwin and sometimes linux. There are no known problems when&lt;br /&gt;running large single-threaded programs.&lt;br /&gt;Reading from shared variables is transparent, writing must be done via&lt;br /&gt;scheduled updater subs&lt;br /&gt;on the owner thread.&lt;br /&gt;You can use the API without using native OS threads by configuring&lt;br /&gt;--without-threads.&lt;br /&gt;&lt;br /&gt;Parrot 4.11.0 News:&lt;br /&gt;    - Core&lt;br /&gt;        + Parrot now supports fast and lightweight OS threads, based&lt;br /&gt;on Nat Tucks's&lt;br /&gt;          initial GSoC work on green threads and then Stefan Seifert's extension&lt;br /&gt;          to true parallel OS threads as hybrid threads.&lt;br /&gt;          See http://wknight8111.blogspot.co.at/2010/08/gsoc-threads-chandons-results.html&lt;br /&gt;          and http://niner.name/Hybrid_Threads_for_the_Parrot_VM.pdf&lt;br /&gt;          Summary:&lt;br /&gt;http://perl6advent.wordpress.com/2012/12/11/day-11-parrot-threads/&lt;br /&gt;        + New parrot cmdline option --numthreads&lt;br /&gt;        + Export new dynpmc_class_&amp;lt;ClassName&amp;gt; types [GH #870].&lt;br /&gt;        + Changed core_ops library format and ops2c to contain the&lt;br /&gt;PBC_COMPAT only,&lt;br /&gt;          not the parrot version triple. Removed the duplicate&lt;br /&gt;PARROT_DYNOP_CORE_INIT&lt;br /&gt;          cpp definition in include/parrot/oplib/core_ops.h, use only&lt;br /&gt;          PARROT_CORE_OPLIB_INIT from config.h&lt;br /&gt;        + Store PBC_MAJOR and PBC_MINOR in the config hash, stored by&lt;br /&gt;auto::revision&lt;br /&gt;        + Added getprotobyname method to the Socket PMC&lt;br /&gt;    - Documentation&lt;br /&gt;        + Marked unused API parameters&lt;br /&gt;        + Install man pages for all binaries&lt;br /&gt;    - Languages&lt;br /&gt;        + nqp-rx tests updated from perl6/nqp-rx.git, and enabled to&lt;br /&gt;run on make test&lt;br /&gt;    - Platforms&lt;br /&gt;        + More compilation fixes on Windows without working mt.exe or&lt;br /&gt;ranlib=rem,&lt;br /&gt;          enable smoking without git binary.&lt;br /&gt;    - Tools&lt;br /&gt;        + Re-enabled pbc_dump -h --header-only&lt;br /&gt;        + Improved pmc2c, added more UNUSED(arg) macros [GH #836].&lt;br /&gt;Parrot is now almost&lt;br /&gt;          -Wunused-parameters safe.&lt;br /&gt;    - Tests&lt;br /&gt;        + failing Pod::Simple pod_todo.t tests are now skipped&lt;br /&gt;        + added nqp-rx tests&lt;br /&gt;        + removed duplicate ext/nqp-rx/t/p6regex tests&lt;br /&gt;        + rewrote and enabled native_pbc tests [GH #394],&lt;br /&gt;          renamed native_pbc testfiles&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SHA256 message digests for the downloadable tarballs are:&lt;br /&gt;46de72022dfe521fb8c5d95453e1d091d4d20d8f7ca4f2ed0cd1420b682f20dc&lt;br /&gt;parrot-4.11.0.tar.gz&lt;br /&gt;0632ad0ca9557df391088bddbbc2608a4503adb5679dcbe62c065a73d4ce49de&lt;br /&gt;parrot-4.11.0.tar.bz2&lt;br /&gt;&lt;br /&gt;Many thanks to all our contributors for making this possible, and our sponsors&lt;br /&gt;for supporting this project.  Our next supported release is 15 January 2013.&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br /&gt;-- &lt;br /&gt;Reini Urban&lt;br /&gt;http://cpanel.net/   http://www.perl-compiler.org/&lt;br /&gt;</description>
	<pubDate>Wed, 19 Dec 2012 01:49:52 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 19 – Gather and/or Coroutines</title>
	<guid>http://perl6advent.wordpress.com/?p=1775</guid>
	<link>https://perl6advent.wordpress.com/2012/12/19/gather-andor-coroutines/</link>
	<description>&lt;p&gt;Today I’ll write about coroutines, gather-take and why they are as much fun as one another. But since it’s all about manipulating control flow, I took the liberty to reorganize the control flow of this advent post, so coroutines will finally appear somewhere at the end of it. In the meantime I’ll introduce the backstory, the problems that coroutines solved and how it looks from the Perl 6 kitchen.&lt;/p&gt;
&lt;p&gt;LWP::Simple is all fun and games, but sometimes you can’t afford to wait for the result to come. It would make sense to say “fetch me this webpage and drop me a note when you’re done with it”. That’s non trivial though; LWP::Simple is a black box, which we tell “get() this, get() that” and it gives us the result back. There is no possible way to intercept the internal data it sends there and around. Or is there?&lt;/p&gt;
&lt;p&gt;If you look at Perl 5′s AnyEvent::HTTP, you’ll see that it reimplemented the entire HTTP client to have it non-blocking. Let’s see if we can do better than that.&lt;/p&gt;
&lt;p&gt;First thing, where does LWP::Simple actually block? Behind our backs it uses the built-in IO::Socket::INET class. When it wants data from it, it calls .read() or .recv() and patiently waits until they’re done. If only we could somehow make it not rely on those two directly, hmm…&lt;/p&gt;
&lt;p&gt;„I know!”, a gemstone-fascinated person would say, „We can monkey-patch IO::Socket::INET”. And then we have two problems. No, we’ll go the other way, and follow the glorious path of Dependency Injection.&lt;/p&gt;
&lt;p&gt;That sounds a bit scary. I’ve heard about as many definitions of Dependency Injection as many people I know. The general idea is to not create objects inside other objects directly; it should be possible to supply them from the outside. I like to compare it to elimination of „magic constants”. No one likes those; if you think of classes as another kind of magic constants which may appear in somebody else’s code, this is pretty much what this is about. In our case it looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# LWP::Simple make_request
my IO::Socket::INET $sock .= new(:$host, :$port);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There we go. “IO::Socket::INET” is the magic constant here; if you want to use a different thing, you’re doomed. Let’s mangle it for a bit and allow the socket class to come from the outside.&lt;/p&gt;
&lt;p&gt;We’ll add an attribute to LWP::Simple, let’s call it $!socketclass&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;has $.socketclass = IO::Socket::INET;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If we don’t supply any, it will just fallback to IO::Socket::INET, which is a sensible default. Then, instead of the previous .new() call, we do&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;my $sock = $!socketclass.new(:$host, :$port);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The actual patch (&lt;a href=&quot;https://github.com/tadzik/perl6-lwp-simple/commit/93c182ac2&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tadzik/perl6-lwp-simple/commit/93c182ac2&lt;/a&gt;) is a bit more complicated, as LWP::Simple supports calling get() not only on constructed objects but also on type objects, which have no attributes set, but we only care about the part shown above. We have an attribute $!socketclass, which defaults to IO::Socket::INET but we’re free to supply another class – dependency-inject it. Cool! So in the end it’ll look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Fakesocket is IO::Socket::INET {
    method recv($) {
        note 'We intercepted recv()';
        callsame;
    }

    method read($) {
        note 'We intercepted read()';
        callsame;
    }
}

# later
my $lwp = LWP::Simple.new(socketclass =&amp;gt; Fakesocket);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And so our $lwp is a fine-crafted LWP::Simple which could, theorically, give the control flow back to us while it waits for read() and recv() to finish. So, how about we put theory into practice?&lt;/p&gt;
&lt;h3&gt;Here start the actual coroutines, sorry for being late :)&lt;/h3&gt;
&lt;p&gt;What do we really need in our modified recv() and read()? We need a way to say „yeah, if you could just stop executing and give time to someone else, that would be great.” Oh no, but we have no threads! Luckily, we don’t need any. Remember lazy lists?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;my @a := gather { for 1..* -&amp;gt; $n { take $n } }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So on one hand we run an infinite for loop, and on the other we have a way to say „give back what you’ve come up with, I’ll catch up with you later”. That’s what take() does: it temporarily jumps out of the gather block, and is ready to get back to it whenever you want it. Do I hear the sound of puzzles clicking together? That’s exactly what we need! Jump out of the execution flow and wait until we’re asked to continue.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Fakesocket is IO::Socket::INET {
    method recv($) {
        take 1;
        callsame;
    }

    method read($) {
        take 1;
        callsame;
    }
}

# later
my @a := gather {
    $lwp.get(&quot;http://jigsaw.w3.org/HTTP/300/301.html&quot;);
    take &quot;done&quot;;
}

# give time to LWP::Simple, piece by piece
while ~@a.shift ne &quot;done&quot; {
    say &quot;The coroutine is still running&quot;
}
say &quot;Yay, done!&quot;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There we go! We just turned LWP::Simple into a non-blocking beast, using almost no black magic at all! Ain’t that cool.&lt;/p&gt;
&lt;p&gt;We now know enough to create some syntactic sugar around it all. Everyone likes sugar.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;module Coroutines;
my @coroutines;
enum CoroStatus &amp;lt;still_going done&amp;gt;;

sub async(&amp;amp;coroutine) is export {
    @coroutines.push($(gather {
        &amp;amp;coroutine();
        take CoroStatus::done;
    }));
}

#= must be called from inside a coroutine
sub yield is export {
    take CoroStatus::still_going;
}

#= should be called from mainline code
sub schedule is export {
    return unless +@coroutines;
    my $r = @coroutines.shift;
    if $r.shift ~~ CoroStatus::still_going {
        @coroutines.push($r);
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We maintain a list of coroutines currently running. Our async() sub just puts a block of code in the execution queue. Then every call to yield() will make it jump back to the mainline code. schedule(), on the other hand, will pick the first available coroutine to be run and will give it some time to do whatever it wants.&lt;/p&gt;
&lt;p&gt;Now, let us wait for the beginning of the post to catch up.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1775/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1775/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1775&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 19 Dec 2012 00:01:43 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 18 – Formulas: resistance is futile</title>
	<guid>http://perl6advent.wordpress.com/?p=1745</guid>
	<link>https://perl6advent.wordpress.com/2012/12/18/day-18-formulas-resistance-is-futile/</link>
	<description>&lt;p&gt;Today, Perl turns 25: happy birthday Perl! There’s too much to say about this language, its philosophy, its culture, … So here, I would just thank all people who make Perl a success, for such a long time.&lt;/p&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;A formula is “an entity constructed using the &lt;em&gt;symbols&lt;/em&gt; and formation &lt;em&gt;rules&lt;/em&gt; of a given &lt;em&gt;language&lt;/em&gt;“, according to &lt;a href=&quot;http://en.wikipedia.org/wiki/Formula&quot;&gt;Wikipedia&lt;/a&gt; as of this writing. These words sound really familiar for any Perl 6 users who have already played with &lt;a href=&quot;http://perl6advent.wordpress.com/2009/12/24/day-24-the-perl-6-standard-grammar/&quot;&gt;grammars&lt;/a&gt;, however this is not the purpose of this article. Instead, the aim is to demonstrate how the &lt;a href=&quot;http://perl6.org/&quot;&gt;Perl 6&lt;/a&gt; language can be easily extended in order to use formulas &lt;strong&gt;literally&lt;/strong&gt; in the code.&lt;/p&gt;
&lt;p&gt;There are many domains, like Mathematics, Physics, finance, etc., that use their own specific languages. When writing programs for such a domain, it could be less error-prone and simpler to use its specific language instead of using a specific API. For example, someone who has knowledge in electronic may find the formula below:&lt;/p&gt;
&lt;pre&gt;4.7kΩ ± 5%&lt;/pre&gt;
&lt;p&gt;far more understandable than the following piece of code:&lt;/p&gt;
&lt;pre&gt;my $factory MeasureFactory.getSharedInstance();
my $resistance = $factory.createMeasure(value     =&amp;gt; 4700,
                                        unit      =&amp;gt; Unit::ohm,
                                        precision =&amp;gt; 5);&lt;/pre&gt;
&lt;p&gt;The formula &lt;code&gt;4.7kΩ ± 5%&lt;/code&gt; will be used all along this article as an example.&lt;/p&gt;
&lt;h2&gt;Symbol &lt;code&gt;k&lt;/code&gt;: return a modified value&lt;/h2&gt;
&lt;p&gt;Let’s start with the simplest symbol: &lt;code&gt;k&lt;/code&gt;. Basically this is just a multiplier placed after a numeric value. To make the Perl 6 language support this new operator, there’s no need to know much about Perl 6 guts: operators are just funny looking sub-routines:&lt;/p&gt;
&lt;pre&gt;sub postfix:&amp;lt;k&amp;gt; ($a) is tighter(&amp;amp;infix:&amp;lt;*&amp;gt;) { $a * 1000 }&lt;/pre&gt;
&lt;p&gt;This just makes &lt;code&gt;4.7k&lt;/code&gt; return &lt;code&gt;4.7 * 1000&lt;/code&gt;, for example. To be a little bit picky, such kind of multiplier should not be used without a unit (ex. &lt;code&gt;Ω&lt;/code&gt;) and not be coupled to another multiplier (ex. &lt;code&gt;μ&lt;/code&gt;). This would have made this article a little bit more complex, so this is left as an exercise to the reader :) Regarding the &lt;code&gt;tighter&lt;/code&gt; trait, it is already well explained in &lt;a href=&quot;http://perl6advent.wordpress.com/2009/12/22/day-22-operator-overloading/&quot;&gt;three&lt;/a&gt; &lt;a href=&quot;http://perl6advent.wordpress.com/2011/12/22/day-22-operator-overloading-revisited/&quot;&gt;other &lt;/a&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/16/day-16-operator-precedence/&quot;&gt;articles&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Symbols &lt;code&gt;%&lt;/code&gt;: return a closure&lt;/h2&gt;
&lt;p&gt;The next symbol is &lt;code&gt;%&lt;/code&gt;: it is commonly used to compute a ratio of &lt;em&gt;something&lt;/em&gt;, that’s why &lt;code&gt;5%&lt;/code&gt; shouldn’t naively be transformed into &lt;code&gt;0.05&lt;/code&gt;. Instead, it creates a closure that computes the given percent of &lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/03/day-3-whatever-the-layout-manager-is/&quot;&gt;whatever&lt;/a&gt; you want:&lt;/p&gt;
&lt;pre&gt;sub postfix:&amp;lt;%&amp;gt; ($a) is tighter(&amp;amp;infix:&amp;lt;*&amp;gt;) { * * $a / 100 }&lt;/pre&gt;
&lt;p&gt;It’s now possible to write &lt;code&gt;$f = 5%; $f(42)&lt;/code&gt; or &lt;code&gt;5%(42)&lt;/code&gt; directly, and this returns &lt;code&gt;2.1&lt;/code&gt;. It is worth saying this doesn’t conflict with the &lt;code&gt;infix:&amp;lt;%&amp;gt;&lt;/code&gt; operator (modulo), that is, &lt;code&gt;5 % 42&lt;/code&gt; still returns &lt;code&gt;5&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;Symbol &lt;code&gt;Ω&lt;/code&gt;: create a new &lt;code&gt;Measure&lt;/code&gt; object&lt;/h2&gt;
&lt;p&gt;Let’s go on with the &lt;code&gt;Ω&lt;/code&gt; symbol. One possibility is to tie the unit and the value in the same object, as in the &lt;code&gt;Measure&lt;/code&gt; class defined below. The &lt;code&gt;ACCEPTS&lt;/code&gt; method is explained later but the idea in this case is that two &lt;code&gt;Measure&lt;/code&gt; objects with two different units can’t match together:&lt;/p&gt;
&lt;pre&gt;enum Unit &amp;lt;volt ampere ohm&amp;gt;;

class Measure {
    has Unit $.unit;
    has $.value;

    method ACCEPTS (Measure:D $a) {
        $!unit == $a.unit &amp;amp;&amp;amp; $!value.ACCEPTS($a.value);
    }
}&lt;/pre&gt;
&lt;p&gt;Then, one operator per unit can be defined in order to &lt;em&gt;hide&lt;/em&gt; the underlying API, that is, to allow &lt;code&gt;4.7kΩ&lt;/code&gt; as an equivalent of &lt;code&gt;Measure.new(value =&amp;gt; 4.7k, unit =&amp;gt; ohm)&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;sub postfix:&amp;lt;V&amp;gt; (Real:D $a) is looser(&amp;amp;postfix:&amp;lt;k&amp;gt;) {
    Measure.new(value =&amp;gt; $a, unit =&amp;gt; volt)
}
sub postfix:&amp;lt;A&amp;gt; (Real:D $a) is looser(&amp;amp;postfix:&amp;lt;k&amp;gt;) {
    Measure.new(value =&amp;gt; $a, unit =&amp;gt; ampere)
}
sub postfix:&amp;lt;Ω&amp;gt; (Real:D $a) is looser(&amp;amp;postfix:&amp;lt;k&amp;gt;) {
     Measure.new(value =&amp;gt; $a, unit =&amp;gt; ohm)
}&lt;/pre&gt;
&lt;p&gt;Regarding the &lt;code&gt;ACCEPTS&lt;/code&gt; method, it is used by &lt;code&gt;~~&lt;/code&gt;, the smartmatch operator, to check if the left operand can &lt;em&gt;match&lt;/em&gt; the right operand, the one with the &lt;code&gt;ACCEPTS&lt;/code&gt; method. In other terms, &lt;code&gt;$a ~~ $b&lt;/code&gt; is equivalent to &lt;code&gt;$b.ACCEPTS($a)&lt;/code&gt;. Typically, this allows the &lt;em&gt;intuitive&lt;/em&gt; comparison between two different types, like scalars and containers for example.&lt;/p&gt;
&lt;p&gt;In this example, this method is overloaded to ensure two &lt;code&gt;Measure &lt;/code&gt;objects can match only if they have the same unit and if their values match. That means &lt;code&gt;4kΩ ~~ 4.0kΩ&lt;/code&gt; is &lt;code&gt;True&lt;/code&gt; whereas &lt;code&gt;4kΩ ~~ 4kV&lt;/code&gt; is &lt;code&gt;False&lt;/code&gt;. Actually, there are many units that &lt;em&gt;can&lt;/em&gt; mix altogether, typically currencies (¥€$) and the ones &lt;a href=&quot;http://en.wikipedia.org/wiki/SI_derived_unit&quot;&gt;derived&lt;/a&gt; from the &lt;cite&gt;International System of Unit&lt;/cite&gt;. But as usual, when something is a little bit more complex, it is left as an exercise to the reader ;)&lt;/p&gt;
&lt;h2&gt;Symbol &lt;code&gt;±&lt;/code&gt;: create a &lt;code&gt;Range&lt;/code&gt; object&lt;/h2&gt;
&lt;p&gt;There’s only one symbol left so far: &lt;code&gt;±&lt;/code&gt;. In the example, it is used to indicate the &lt;a href=&quot;http://en.wikipedia.org/wiki/Electronic_color_code&quot;&gt;tolerance&lt;/a&gt; of the resistance. This tolerance could be either absolute (expressed in &lt;code&gt;Ω&lt;/code&gt;) or relative (expressed in &lt;code&gt;%&lt;/code&gt;), thus the new &lt;code&gt;infix:&amp;lt;±&amp;gt;&lt;/code&gt; operator has several signatures and have to be declared with a &lt;code&gt;multi&lt;/code&gt; keyword. In both cases, the &lt;code&gt;value&lt;/code&gt; is a new &lt;code&gt;Range&lt;/code&gt; objects with the right bounds:&lt;/p&gt;
&lt;pre&gt;multi sub infix:&amp;lt;±&amp;gt; (Measure:D $a, Measure:D $b) is looser(&amp;amp;postfix:&amp;lt;Ω&amp;gt;) {
    die if $a.unit != $b.unit;
    Measure.new(value =&amp;gt; Range.new($a.value - $b.value,
                                   $a.value + $b.value),
                unit =&amp;gt; $a.unit);
}

multi sub infix:&amp;lt;±&amp;gt; (Measure:D $a, Callable:D $b) is looser(&amp;amp;postfix:&amp;lt;Ω&amp;gt;) {
    Measure.new(value =&amp;gt; Range.new($a.value - $b($a.value),
                                   $a.value + $b($a.value)),
                unit =&amp;gt; $a.unit);
}&lt;/pre&gt;
&lt;p&gt;Actually, any &lt;code&gt;Callable&lt;/code&gt; object could be used in the second variant, not only the closures created by the &lt;code&gt;%&lt;/code&gt; operators.&lt;/p&gt;
&lt;p&gt;So far, so good! It’s time to check in the Perl6 REPL interface if everything works fine:&lt;/p&gt;
&lt;pre&gt;&amp;gt; 4.7kΩ ± 1kΩ
Measure.new(unit =&amp;gt; Unit::ohm, value =&amp;gt; 3700/1..5700/1)

&amp;gt; 4.7kΩ ± 5%
Measure.new(unit =&amp;gt; Unit::ohm, value =&amp;gt; 4465/1..4935/1)&lt;/pre&gt;
&lt;p&gt;It looks good, so all the code above ought to be moved into a dedicated &lt;a href=&quot;http://perl6advent.wordpress.com/2009/12/12/day-12-modules-and-exporting/&quot;&gt;module&lt;/a&gt; in order to be re-used at will. Then, a customer could load it and write literally:&lt;/p&gt;
&lt;pre&gt;my $resistance = 4321Ω;
die &quot;resistance is futile&quot; if !($resistance ~~ 4.7kΩ ± 5%);&lt;/pre&gt;
&lt;p&gt;As of this writing, this works both in &lt;a href=&quot;https://github.com/sorear/niecza&quot;&gt;Niecza&lt;/a&gt; and &lt;a href=&quot;http://rakudo.org/&quot;&gt;Rakudo&lt;/a&gt;, the two most advanced implementations of Perl 6.&lt;/p&gt;
&lt;h2&gt;Symbols that aren’t operators&lt;/h2&gt;
&lt;p&gt;Symbols in a formula are not always operators, they can be symbolic constants too, like π. In many languages, constants are just &lt;em&gt;read-only variables&lt;/em&gt;, which sounds definitely weird: a variable isn’t supposed to be … variable? In Perl 6, a constant can be a read-only variable too (hmm) or a &lt;em&gt;read-only term&lt;/em&gt; (this sounds better). For example, to define the constant term &lt;code&gt;φ&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;constant φ = (1 + sqrt(5)) / 2;&lt;/pre&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this article the Perl 6 language was slightly extended with several new &lt;em&gt;symbols&lt;/em&gt; in order to embed simple formulas. Although it is possible to go further by changing the Perl 6 grammar in order to embed more specific languages, that is, languages that don’t have the same grammar rules. Indeed, there are already two such languages supported by Perl 6: regexp and &lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/10/day-10-dont-quote-me-on-it/&quot;&gt;quotes&lt;/a&gt;. The same way, Niecza use a &lt;a href=&quot;https://github.com/sorear/niecza/blob/v24/docs/nam.pod&quot;&gt;custom&lt;/a&gt; language to connect its portable parts to the unportable.&lt;/p&gt;
&lt;h2&gt;Bonus: How to type these exotic symbols?&lt;/h2&gt;
&lt;p&gt;Most of the Unicode symbols can be type in Xorg — the most used interface system on Linux — thanks to the &lt;code&gt;Compose&lt;/code&gt; key, also named &lt;code&gt;Multi&lt;/code&gt; key. When this special key is pressed, all the following key-strokes are somewhat merged in order to &lt;a href=&quot;http://en.wikipedia.org/wiki/Compose_key&quot;&gt;compose&lt;/a&gt; a symbol.&lt;/p&gt;
&lt;p&gt;There’s plenty of documentation about this support elsewhere on Internet, so only the minimal information is provided here. First, to map the &lt;code&gt;Compose&lt;/code&gt; key to the &lt;code&gt;Caps Lock&lt;/code&gt; key, write in a X terminal:&lt;/p&gt;
&lt;pre&gt;sh&amp;gt; setxkbmap -option compose:caps&lt;/pre&gt;
&lt;p&gt;Some compositions are likely already defined, for instance &lt;code&gt;&amp;lt;caps&amp;gt;&lt;/code&gt; followed by &lt;code&gt;+&lt;/code&gt; then &lt;code&gt;-&lt;/code&gt; should now produce &lt;code&gt;±&lt;/code&gt;, but both &lt;code&gt;Ω&lt;/code&gt; and &lt;code&gt;φ&lt;/code&gt; are likely not defined. One solution is to write a&lt;br /&gt;
&lt;code&gt;~/.XCompose&lt;/code&gt; file with the following content:&lt;/p&gt;
&lt;pre&gt;include &quot;%L&quot; # Don't discard the current locale setting.

&amp;lt;Multi_key&amp;gt; &amp;lt;o&amp;gt; &amp;lt;h&amp;gt; &amp;lt;m&amp;gt;      : &quot;Ω&quot;  U03A9
&amp;lt;Multi_key&amp;gt; &amp;lt;O&amp;gt; &amp;lt;underscore&amp;gt; : &quot;Ω&quot;  U03A9
&amp;lt;Multi_key&amp;gt; &amp;lt;underscore&amp;gt; &amp;lt;O&amp;gt; : &quot;Ω&quot;  U03A9

&amp;lt;Multi_key&amp;gt; &amp;lt;p&amp;gt; &amp;lt;h&amp;gt; &amp;lt;y&amp;gt; : &quot;φ&quot;  U03C6
&amp;lt;Multi_key&amp;gt; &amp;lt;o&amp;gt; &amp;lt;bar&amp;gt;   : &quot;φ&quot;  U03C6
&amp;lt;Multi_key&amp;gt; &amp;lt;bar&amp;gt; &amp;lt;o&amp;gt;   : &quot;φ&quot;  U03C6&lt;/pre&gt;
&lt;p&gt;This takes effect for each newly started applications. Feel free to leave a comment if you know how to add such a support on other&lt;br /&gt;
systems.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1745/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1745/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1745&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Tue, 18 Dec 2012 00:01:24 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 17 – Perl 6 from 30,000 feet</title>
	<guid>http://perl6advent.wordpress.com/?p=1709</guid>
	<link>https://perl6advent.wordpress.com/2012/12/17/day-17-perl-6-from-30000-feet/</link>
	<description>&lt;p&gt;Many people have heard of Perl 6, especially in the greater Perl community.  However, Perl 6 has a complicated ecosystem which can be a littled daunting, so as a newcomer to the Perl 6 community myself, I thought I would share what I’ve learned.&lt;/p&gt;
&lt;h2&gt;How do I install Perl 6?&lt;/h2&gt;
&lt;p&gt;It’s simple; you can just download one of the existing implementations of the language (as Perl 6 is a specification), build it, and install it!  There are several implementations out there right now, in various states of completion. &lt;a href=&quot;http://www.rakudo.org/&quot;&gt;Rakudo&lt;/a&gt; is an implementation that targets Parrot, and is the implementation that I will discuss most in this post. Niecza is another implementation that targets the CLR (the .NET runtime). For more information on these implementations and on other implementations, please see &lt;a href=&quot;http://www.perl6.org/compilers/&quot;&gt;Perl 6 Compilers&lt;/a&gt;.  Perl 6 is an ever-evolving language, and any compiler that passes the official test suite can be considered a Perl 6 implementation.&lt;/p&gt;
&lt;h2&gt;You mentioned “Parrot”; what’s that?&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.parrot.org/&quot;&gt;Parrot&lt;/a&gt; is a virtual machine that is designed to run dynamically typed languages.  Along with the virtual machine, it includes tools for generating virtual machine code from intermediate languages (named PIR and PASM), as well as a suite of tools to make writing compilers easier.&lt;/p&gt;
&lt;h2&gt;What is Rakudo written in?&lt;/h2&gt;
&lt;p&gt;Rakudo itself is written primarly in Perl 6, with some bits of C for some of the lower-level operations, like binding method arguments and adding additional opcodes to the Parrot VM.  It may seem strange to implement a Perl 6 compiler in Perl 6 itself; Rakudo uses NQP for building itself.&lt;/p&gt;
&lt;h2&gt;What’s NQP?&lt;/h2&gt;
&lt;p&gt;NQP (or Not Quite Perl 6) is an implementation of Perl 6 that is focused on creating compilers for the Parrot Compiler Toolkit.  It is currently focused on targetting Parrot, but in the future, it may support various compilation targets, so you will be able to use Rakudo to compile your Perl 6 programs to Parrot opcodes, a JVM class file, or perhaps Javascript so you can run it in the browser.  NQP is written in NQP, and uses a pre-compiled version of NQP to compile itself.&lt;/p&gt;
&lt;p&gt;I hope that this information was useful to you, dear reader, and that it helps to clarify the different pieces of the Perl 6 ecosystem.  As I learn more about each piece, I intend to write blog posts that will hopefully help others to get started contributing to Perl 6!&lt;/p&gt;
&lt;p&gt;-Rob&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1709/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1709/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1709&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Mon, 17 Dec 2012 00:00:25 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 16 – Operator precedence</title>
	<guid>http://perl6advent.wordpress.com/?p=1728</guid>
	<link>https://perl6advent.wordpress.com/2012/12/16/day-16-operator-precedence/</link>
	<description>&lt;h2&gt;All the precedence men&lt;/h2&gt;
&lt;p&gt;As I was taking a walk today, I realized one of the reasons why I like Perl. Five as well as six. I often hear praise such as “Perl fits the way I think”. And I have that feeling too sometimes.&lt;/p&gt;
&lt;p&gt;If I were the president (or prime minister, as I’m Swedish), and had a bunch of advisers, maybe some of them would be yes-men, trying to give me advice that they think I will want to hear, instead of advice that would be useful to me. Some languages are like that, presenting us with an incomplete subset of the necessary tools. The Perl languages, if they were advisers, wouldn’t be yes-men. They’d give me an accurate view of the world, even if that view would be a bit messy and hairy sometimes.&lt;/p&gt;
&lt;p&gt;Which, I guess, is why Perl five and six are so often used in handling messy data and turning it into something useful.&lt;/p&gt;
&lt;p&gt;To give a few specific examples:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Perl 5 takes quotes and quoting &lt;em&gt;very&lt;/em&gt; seriously. Not just strings but lists of strings, too. (See the &lt;code&gt;qw&lt;/code&gt; keyword.) Perl 6 does the same, but takes quoting further. See &lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/10/day-10-dont-quote-me-on-it/&quot;&gt;see the recent post on quoting&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;jnthn shows in &lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/15/day-15-phasers-set-to-stun/&quot;&gt;yesterday’s advent post&lt;/a&gt; that Perl 6 takes compiler phases seriously, and allows us to bundle together code that belongs together conceptually but not temporally. We need to do this because the world is gnarly and running a program happens in phases.&lt;/li&gt;
&lt;li&gt;Grammars in Perl 6 are not just powerful, but in some sense honest, too. They don’t oversimplify the task for the programmer, because then they would also limit the expressibility. Even though grammars are complicated and intricate, they &lt;em&gt;should&lt;/em&gt; be, because they describe a process (parsing) that is complicated and intricate.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Operators&lt;/h2&gt;
&lt;p&gt;Perl is known for its many operators. Some would describe it as an “operator-oriented” language. Where many other language will try to guess how you want your operators to behave on your values, or perhaps demand that you pre-declare all your types so that there’ll be no doubt, Perl 6 carries much of the typing information in its operators:&lt;/p&gt;
&lt;pre&gt;my $a = 5;
my $b = 6;

say $a + $b;      # 11 (numeric addition)
say $a * $b;      # 30 (numeric multiplication)

say $a ~ $b;      # &quot;56&quot; (string concatenation)
say $a x $b;      # &quot;555555&quot; (string repetition)

say $a || $b;     # 5 (boolean disjunction)
say $a &amp;amp;&amp;amp; $b;     # 6 (boolean conjunction)
&lt;/pre&gt;
&lt;p&gt;Other languages will want to bunch together some of these for us, using the &lt;code&gt;+&lt;/code&gt; operator for both numeric addition and string concatenation, for example. Not so Perl. You’re meant to choose yourself, because the choice matters. In return, Perl will care a little less about the types of the operands, and just deliver the appropriate result for you.&lt;/p&gt;
&lt;p&gt;“The appropriate result” is most often a number if you used a numeric operator, and a string if you used a string operator. But sometimes it’s more subtle than that. Note that the boolean operators above actually preserved the numbers 5 and 6 for us, even though internally it treated them both as true values. In C, if we do the same, C will unhelpfully “flatten” these results down to the value 1, its spelling of the value &lt;code&gt;true&lt;/code&gt;. Perl knows that truthiness comes in many flavors, and retains the particular flavor for you.&lt;/p&gt;
&lt;h2&gt;Operator precedence&lt;/h2&gt;
&lt;p&gt;“All operators are equal, but some operators are more equal than others.” It is when we combine operators that we realize that the operators have different “tightness”.&lt;/p&gt;
&lt;pre&gt;say 2 * 3 + 1;      # 7, because (2 * 3) + 1
say 1 + 2 * 3;      # 7, because 1 + (2 * 3), not 9
&lt;/pre&gt;
&lt;p&gt;We can always be 100% explicit and surround enough of our operations with parentheses… but when we don’t, the operators seem to order themselves in some order, which is not just simple left-to-right evaluation. This ordering between operators is what we refer to as “precedence”.&lt;/p&gt;
&lt;p&gt;No doubt you were taught in math class in school that multiplications should be evaluated before additions in the way we see above. It’s as if factors group together closer than terms do. The fact that this difference in precedence is useful is backed up by centuries of algebra notation. Most programming languages, Perl 6 included, incorporates this into the language.&lt;/p&gt;
&lt;p&gt;By the way, this difference in precedence is found between other pairs of operators, even outside the realm of mathematics:&lt;/p&gt;
&lt;pre&gt;      Additive (loose)    Multiplicative (tight)
      ================    ======================
number      +                       *
string      ~                       x
bool        ||                      &amp;amp;&amp;amp;&lt;/pre&gt;
&lt;p&gt;It turns out that they make as much sense for other types as they do for numbers. And group theory bears this out: these other operators can be seen as a kind of addition and multiplication, if we squint.&lt;/p&gt;
&lt;h2&gt;Operator precedence parser&lt;/h2&gt;
&lt;p&gt;Deep in the bowels of the Perl 6 parser sits a smaller parser which is very good at parsing expressions. The bigger parser which parses your Perl 6 program is a really good &lt;em&gt;recursive-descent&lt;/em&gt; parser. It works great for creating syntax trees out of the larger program structure. It works less well on the level of expressions. Essentially, what trips up a recursive-descent parser is that it always has to create AST nodes for all the possible precedence levels, whether they’re present or not.&lt;/p&gt;
&lt;p&gt;So this smaller parser is an &lt;em&gt;operator-table&lt;/em&gt; parser. It knows what to do with each type of operator (prefix, infix, postfix…), and kind of weaves all the terms and operators into a syntax tree. Only the precedence levels actually used show up in the tree.&lt;/p&gt;
&lt;p&gt;The optable parser works by comparing each new operator to the top operator on a stack of operators. So when it sees an expression like this:&lt;/p&gt;
&lt;pre&gt;$x ** 2 + 3 * $x - 5&lt;/pre&gt;
&lt;p&gt;it will first compare &lt;code&gt;**&lt;/code&gt; against &lt;code&gt;+&lt;/code&gt; and decide that the former is tighter, and thus &lt;code&gt;$x ** 2&lt;/code&gt; should be put together into a small tree. Later, it compares &lt;code&gt;+&lt;/code&gt; against &lt;code&gt;*&lt;/code&gt;, and decides to turn &lt;code&gt;3 * $x&lt;/code&gt; into a small tree. It goes on like this, eventually ending up with this tree structure:&lt;/p&gt;
&lt;pre&gt;infix:&amp;lt;-&amp;gt;
 +-- infix:&amp;lt;+&amp;gt;
      +-- infix:&amp;lt;**&amp;gt;
      |    +-- term:&amp;lt;$x&amp;gt;
      |    +-- term:&amp;lt;2&amp;gt;
      +-- infix:&amp;lt;*&amp;gt;
           +-- term:&amp;lt;3&amp;gt;
           +-- term:&amp;lt;$x&amp;gt;&lt;/pre&gt;
&lt;p&gt;Because leaf nodes are evaluated first and the root node last, this tree structure determines the order of evaluation for the expression. The order ends up being the same as if the expression had these parentheses:&lt;/p&gt;
&lt;pre&gt;(($x ** 2) + (3 * $x)) - 5&lt;/pre&gt;
&lt;p&gt;Which, again, is what we’ve learned to expect.&lt;/p&gt;
&lt;h2&gt;Associativity&lt;/h2&gt;
&lt;p&gt;Another factor also governs how these invisible parentheses are to be distributed: operator &lt;em&gt;associativity&lt;/em&gt;. It’s the concern of how the operator combines with multiple copies of itself, or other sufficiently similar operators on the same precedence level.&lt;/p&gt;
&lt;p&gt;Some examples serve to explain the difference:&lt;/p&gt;
&lt;pre&gt;$x = $y = $z;     # becomes $x = ($y = $z)
$x / $y / $z;     # becomes ($x / $y) / $z&lt;/pre&gt;
&lt;p&gt;In both of these cases, we may look at the way the parentheses are doled out, and say “well, of course”. Of course we must first assign to &lt;code&gt;$y&lt;/code&gt; and only then to &lt;code&gt;$x&lt;/code&gt;. And of course we first divide by &lt;code&gt;$y&lt;/code&gt; and only then by &lt;code&gt;$z&lt;/code&gt;. So operators naturally have different associativity.&lt;/p&gt;
&lt;p&gt;The optable parser compares not just the precedence of two operators but also, when needed, their associativity. And it puts the parentheses in the right place, just as above.&lt;/p&gt;
&lt;h2&gt;User-defined operators&lt;/h2&gt;
&lt;p&gt;Now we come back to Perl not being a yes-man, and working hard to give you the appropriate tools for the job.&lt;/p&gt;
&lt;p&gt;Perl 6 allows you to define operators. See &lt;a href=&quot;http://perl6advent.wordpress.com/2011/12/22/day-22-operator-overloading-revisited/&quot;&gt;my post from last year&lt;/a&gt; on the details of how. But it also allows you to specify precedence and associativity of each new operator.&lt;/p&gt;
&lt;p&gt;As you specify a new operator, a new Perl 6 parser is automatically constructed for you behind the scenes, which contains your new operator. In this sense, the optable parser is open and extensible. And Perl 6 gives you exactly the same tools for talking about precedence and associativity as the compiler itself uses internally.&lt;/p&gt;
&lt;p&gt;Perl treats you like a grown-up, and expects you to make good decisions based on a thorough understanding of the problem space. I like that.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1728/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1728/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1728&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sun, 16 Dec 2012 00:01:04 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 15 – Phasers set to stun</title>
	<guid>http://perl6advent.wordpress.com/?p=1706</guid>
	<link>https://perl6advent.wordpress.com/2012/12/15/day-15-phasers-set-to-stun/</link>
	<description>&lt;p&gt;When writing programs, it’s important not only to separate the concerns that need separating, but also to try and keep related things close to each other. This gives the program a sense of cohesion, and helps to avoid the inevitable problems that arise when updating one part of a program demands an update in another far-away part. One especially tricky problem can be when the things we want to do are distributed over time. This can cause us to move related things apart in order to get them to happen at the times we want.&lt;/p&gt;
&lt;p&gt;Phasers in Perl 6 help you keep related concepts together in your code, while also indicating that certain aspects of them should happen at different points during the lifetime of the current program, invocation or loop construct. Let’s take a look at some of them.&lt;/p&gt;
&lt;h3&gt;ENTER and LEAVE&lt;/h3&gt;
&lt;p&gt;One of the things I had most fun writing in Perl 6 recently was the debugger. There are various things that need a little care. For example, the debugger needs to look out for exceptions and, when they are thrown, give the user a prompt to let them debug why the exception was thrown. However, there is also a feature where, at the prompt, you can evaluate an expression. The debugger shouldn’t re-enter itself if this expression throws, so we need to keep track of if we’re already showing the prompt. This meant setting and clearing a flag. Thing is, the prompt method is relatively lengthy; it has a given/when to identify the various different commands. I could, of course, have set the prompt flag at the start and cleared it at the end. But that would have spread out the concern of maintaining the flag. Here’s what I did instead:&lt;/p&gt;
&lt;pre&gt;method issue_prompt($ctx, $cur_file) {
    ENTER $in_prompt = True;
    LEAVE $in_prompt = False;

    # Lots of stuff here
}&lt;/pre&gt;
&lt;p&gt;This ensures the flag is set when we enter the method, cleared when we leave the method – and lets me keep the two together.&lt;/p&gt;
&lt;h3&gt;INIT and END&lt;/h3&gt;
&lt;p&gt;We’re writing a small utility and want to log what happens as we run it. Time wise, we want to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open the log file at the start of the program, creating it if needed and overwriting an existing one otherwise&lt;/li&gt;
&lt;li&gt;Write log entries at various points during the program’s execution&lt;/li&gt;
&lt;li&gt;Close the log file at the end&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those three actions are fairly spread out in time, but we’d like to collect them together. This time, the INIT and END phasers come to the rescue.&lt;/p&gt;
&lt;pre&gt;sub log($msg) {
    my $fh = INIT open(&quot;logfile&quot;, :w);
    $fh.say($msg);
    END $fh.close;
}&lt;/pre&gt;
&lt;p&gt;Here, we use INIT to perform an action at program start time. It turns out that INIT also keeps around the value produced by the expression following it, meaning it can be used as an r-value. This means we have the file handle available to us, and can write to it during the program. Then, at the END of the program, we close the file handle. All of these have block forms, should you wish to do something more involved:&lt;/p&gt;
&lt;pre&gt;sub log($msg) {
    my $fh = INIT open(&quot;logfile&quot;, :w);
    $fh.say($msg);
    END {
        $fh.say(&quot;Ran in {now - INIT now} seconds&quot;);
        $fh.close;
    }
}&lt;/pre&gt;
&lt;p&gt;Note the second use of INIT in this example, to compute and remember the program start time so we can use it in the subtraction later on.&lt;/p&gt;
&lt;h3&gt;FIRST, NEXT and LAST&lt;/h3&gt;
&lt;p&gt;These phasers work with loops. They fire the first time the loop body executes, at the end of every loop body execution, and after the last loop body execution. FIRST and LAST are especially powerful in so far as they let us move code that wants to special-case the first and last time the loop body runs inside of the loop construct itself. This makes the relationship between these bits of code and the loop especially clear, and lessens the chance somebody moves or copies the loop and forgets the related bits it has.&lt;/p&gt;
&lt;p&gt;As an example, let’s imagine we are rendering a table of scores from a game. We want to write a header row, and also do a little ASCII art to denote the start and end of the table. Furthermore, we’d like to keep track of the best score each time around the loop, and then at the end print out the best score. Here’s how we could write it.&lt;/p&gt;
&lt;pre&gt;for %scores.kv -&amp;gt; $player, $score {
    FIRST say &quot;Score\tPlayer&quot;;
    FIRST say &quot;-----\t------&quot;;
    LAST  say &quot;-----\t------&quot;;

    NEXT (state $best_score) max= $score;
    LAST say &quot;BEST SCORE: $best_score&quot;;

    say &quot;$score\t$player&quot;;
}&lt;/pre&gt;
&lt;p&gt;Notice how we keep the header/footer code together, as well as being able to keep the best score tracking code together. It’s also all inside the loop, making its relationship to the loop clear. Note how the state variable also comes in useful here. It too is a construct that lets us keep a variable scoped inside a block even if its usage spans multiple invocations of the block.&lt;/p&gt;
&lt;h3&gt;KEEP and UNDO&lt;/h3&gt;
&lt;p&gt;These are variants of LEAVE that trigger conditional on the block being successful (KEEP) or not (UNDO). A successful block completes without unhandled exceptions and returns a defined value. An unsuccessful block exits due to an exception or because it returns an undefined value. Say we were processing a bunch of files and want to build up arrays of successful files and failed files. We could write something like:&lt;/p&gt;
&lt;pre&gt;sub process($file) {
    KEEP push @success, $file;
    UNDO push @failure, $file;

    my $fh = open($file);
    # ...
}&lt;/pre&gt;
&lt;p&gt;There are probably a bunch of transaction-like constructs that can also be very neatly implemented with these two.&lt;/p&gt;
&lt;h3&gt;And there’s more!&lt;/h3&gt;
&lt;p&gt;While I’ve covered a bunch of the phasers here, there are some others. For example, there’s also BEGIN, which lets you do some computation at compile time. Hopefully, though, this set of examples gives you some inspiration in how phasers can be used effectively, as well as a better grasp of the motivation for them. Bringing related things together and setting unrelated things apart is something we need to think carefully about every day as developers, and phasers help us keep related concerns together, even if they should take place at different phases of our program’s execution.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1706/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1706/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;https://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1706&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 15 Dec 2012 13:28:07 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W50</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W50.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W50.html</link>
	<description>&lt;p&gt;So, this is yet another article in Perl 6 Changes series. (I know, those introductions are really boring, but would you like to see Lorem Ipsum Dolor instead)? As in previous week, Rakudo mainly improves Perl 6 parsing.&lt;/p&gt;&lt;p&gt;By the way, if you don’t know about &lt;a href=&quot;http://strangelyconsistent.org/blog/the-2012-perl-6-coding-contest&quot; title=&quot;Strangely Consistent - The 2012 Perl 6 Coding Contest&quot;&gt;Perl 6 Coding Contest&lt;/a&gt;, check it out. The challenges are rather easy if you had any programming language experience (if you don’t know Perl 6, check out &lt;a href=&quot;https://github.com/perl6/book/downloads&quot; title=&quot;GitHub: perl6/book (Downloads&quot;&gt;Using Perl 6&lt;/a&gt; book). If you still have questions, people in &lt;a href=&quot;irc://chat.freenode.net/perl6&quot; title=&quot;Freenode: #perl6&quot;&gt;#perl6&lt;/a&gt; can help you.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;uniq&lt;/code&gt; has &lt;code&gt;===&lt;/code&gt; semantics. It could break your programs if you for example were using &lt;code&gt;uniq&lt;/code&gt; to remove identical arrays (previously they were converted to strings which did what you wanted, as long the strings in array didn’t contained space or you didn’t have array in array.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;“Two terms in a row” error message.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Information about what was expected, if possible.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ perl6 -e '2 2'
===SORRY!===
Two terms in a row
at -e:1
------&amp;gt; 2 ⏏2
    expecting any of:
        postfix
        infix or meta-infix
        infix stopper
        statement end
        statement modifier
        statement modifier loop&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;code&gt;for 1..10 { say so 9999 == any(1..2000) }&lt;/code&gt; is 30 times faster (huge junctions are faster).&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Added Texas versions of the Set and Bag operators, used in &lt;a href=&quot;https://perl6advent.wordpress.com/2012/12/13/day-13-bags-and-sets/&quot; title=&quot;Perl 6 Advent: Day 13 - Bags and Sets&quot;&gt;Bags and Sets&lt;/a&gt; article in Perl 6 Advent Calendar.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Rakudo Perl now informs about obsolete use of &lt;code&gt;.&lt;/code&gt; to concatenate strings.&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;Implemented &lt;code&gt;sub term:&amp;lt;foo&amp;gt;&lt;/code&gt;. Now &lt;code&gt;2 + 2 == 5&lt;/code&gt; can be true for sufficiently huge values of 2 (not like it should be).&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;
&lt;p&gt;&lt;code&gt;qww&lt;/code&gt; now works.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;slurp&lt;/code&gt; now works without arguments.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 15 Dec 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: The 2012 Perl 6 Coding Contest</title>
	<guid>tag:strangelyconsistent.org,2012-12-14:blog/the-2012-perl-6-coding-contest</guid>
	<link>http://strangelyconsistent.org/blog/the-2012-perl-6-coding-contest</link>
	<description>&lt;p&gt;For the third year in a row, let's write some Perl 6 contest code!&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;center&gt;&lt;strong&gt;The 2012 Perl 6 Coding Contest&lt;/strong&gt;&lt;/center&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Perl 6 has had a great year, with its two major implementations growing increasingly mature. Sometimes it's easy to forget all the progress that happens each month. Features and performance have improved all through the year. I think that will show in this year's entries.&lt;/p&gt;

&lt;p&gt;So here's what's happening:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;&lt;center&gt;&lt;strong&gt;do five tasks, and you might win Amazon books worth €100!&lt;/strong&gt;&lt;/center&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Addendum:&lt;/strong&gt; Thanks to an anonymous donor, we're proud to announce a &lt;em&gt;second&lt;/em&gt; prize as well: Amazon books worth 100 USD! (Redeemable within a year of winning.)&lt;/p&gt;

&lt;p&gt;The contest starts &lt;em&gt;now&lt;/em&gt;, today on 2012-12-14. It ends five weeks later, on 2013-01-18. Registration is open for two weeks, starting &lt;em&gt;now&lt;/em&gt;. Just send an email to &lt;code&gt;cmasak@gmail.com&lt;/code&gt; — saying &quot;sign me up!&quot; or even sending your Amazon wishlist so I'll know which books to buy you if you win.&lt;/p&gt;

&lt;p&gt;You might be curious about what you need to do to win. Here's an extract from the file &lt;a href=&quot;https://github.com/masak/p6cc2012/blob/master/rules.md&quot;&gt;&lt;code&gt;rules.md&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Since &quot;code quality&quot; is a slightly subjective measure, let us provide a few
hints of what we'll be looking for:

* Correctness.
* Readability.
* Consistency.
* Clarity of intent.
* Algorithmic efficiency.
* Idiomatic use of Perl 6.
* Brevity.

In short, what we're looking for is top-quality code. That's how you win.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here are the five tasks. Write Perl 6 programs to...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tell knights from knaves based on what they say. &lt;a href=&quot;http://github.com/masak/p6cc2012/blob/master/t1/description.md&quot;&gt;(more)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Generate rectangle haikus. &lt;a href=&quot;http://github.com/masak/p6cc2012/blob/master/t2/description.md&quot;&gt;(more)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Arrange wire crossings to rearrange wires. &lt;a href=&quot;http://github.com/masak/p6cc2012/blob/master/t3/description.md&quot;&gt;(more)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Simulate rain in a world of cubes. &lt;a href=&quot;http://github.com/masak/p6cc2012/blob/master/t4/description.md&quot;&gt;(more)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Distribute weights in bags evenly. &lt;a href=&quot;http://github.com/masak/p6cc2012/blob/master/t5/description.md&quot;&gt;(more)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've chosen the problems so that they're easy to explain, but allow contestants
quite a bit of freedom to play around with various solutions.&lt;/p&gt;

&lt;p&gt;This time, the whole contest is running as a &lt;a href=&quot;http://github.com/masak/p6cc2012&quot;&gt;GitHub repository&lt;/a&gt;. Easier than hosting zip files.&lt;/p&gt;

&lt;p&gt;Now sign up — you've nothing to lose, and books to win! Also, this is your chance to finally take a look at Perl 6. 哈哈&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Looking for previous years' tasks and solutions? Here they are: &lt;a href=&quot;http://strangelyconsistent.org/blog/masaks-perl-6-coding-contest&quot;&gt;2010 tasks&lt;/a&gt; and &lt;a href=&quot;http://strangelyconsistent.org/p6cc2010/&quot;&gt;2010 solutions&lt;/a&gt;. &lt;a href=&quot;http://strangelyconsistent.org/blog/the-2011-perl-6-coding-contest&quot;&gt;2011 tasks&lt;/a&gt; and &lt;a href=&quot;http://strangelyconsistent.org/p6cc2011/&quot;&gt;2011 solutions&lt;/a&gt;.)&lt;/em&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 14 Dec 2012 20:21:30 +0000</pubDate>
</item>
<item>
	<title>Perl 6 Advent Calendar: Day 10 – Don’t quote me on it…</title>
	<guid>http://perl6advent.wordpress.com/?p=1616</guid>
	<link>https://perl6advent.wordpress.com/2012/12/10/day-10-dont-quote-me-on-it/</link>
	<description>&lt;p&gt;In many areas, Perl 6 provides you with a range of sane defaults for the common cases along with the power to do something a little more interesting when you need it. Quoting is no exception.&lt;/p&gt;
&lt;h3&gt;The Basics&lt;/h3&gt;
&lt;p&gt;The two most common quoting constructs are the single and double quotes. Single quotes are simplest: they let you quote a string and just about the only “magic” they provide is being able to stick a backslash before a single quote, which escapes it. Since backslash has this special meaning, you can write an explicit backslash with \\. However, you don’t even need to do that, since any other backslashes just pass on straight through. Here’s some examples.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say 'Everybody loves Magical Trevor'&lt;/strong&gt;
Everybody loves Magical Trevor
&lt;strong&gt;&amp;gt; say 'Oh wow, it\'s backslashed!'&lt;/strong&gt;
Oh wow, it's backslashed!
&lt;strong&gt;&amp;gt; say 'You can include a \\ like this'&lt;/strong&gt;
You can include a \ like this
&lt;strong&gt;&amp;gt; say 'Nothing like \n is available'&lt;/strong&gt;
Nothing like \n is available
&lt;strong&gt;&amp;gt; say 'And a \ on its own is no problem'&lt;/strong&gt;
And a \ on its own is no problem&lt;/pre&gt;
&lt;p&gt;Double quotes are, naturally, twice as powerful. :-) They support a range of backslash escapes, but more importantly they allow for interpolation. This means that variables and closures can be placed within them, saving you from having to use the concatenation operator or other string formatting constructs so often. Here are some simple examples.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say &quot;Ooh look!\nLine breaks!&quot;&lt;/strong&gt;
Ooh look!
Line breaks!
&lt;strong&gt;&amp;gt; my $who = 'Ninochka'; say &quot;Hello, dear $who&quot;&lt;/strong&gt;
Hello, dear Ninochka
&lt;strong&gt;&amp;gt; say &quot;Hello, { prompt 'Enter your name: ' }!&quot;&lt;/strong&gt;
Enter your name: &lt;em&gt;Jonathan&lt;/em&gt;
Hello, Jonathan!&lt;/pre&gt;
&lt;p&gt;The second example shows the interpolation of a scalar, and the third shows how closures can be placed inside double quoted strings also. The value the closure produces will be stringified and interpolated into the string. But what about all the other sigils besides “$”? The rule is that you can interpolate all of them, but only if they are followed by some kind of postcircumfix (that is, an array or hash subscript, parentheses to make an invocation, or a method call). In fact, you can put all of these on a scalar too.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; my @beer = &amp;lt;Chimay Hobgoblin Yeti&amp;gt;;&lt;/strong&gt;
Chimay Hobgoblin Yeti
&lt;strong&gt;&amp;gt; say &quot;First up, a @beer[0]&quot;&lt;/strong&gt;
First up, a Chimay
&lt;strong&gt;&amp;gt; say &quot;Then @beer[1,2].join(' and ')!&quot;&lt;/strong&gt;
Then Hobgoblin and Yeti!
&lt;strong&gt;&amp;gt; say &quot;Tu je &amp;amp;prompt('Ktore pivo chces? ')&quot;&lt;/strong&gt;
Ktore pivo chces? &lt;em&gt;Starobrno&lt;/em&gt;
Tu je Starobrno&lt;/pre&gt;
&lt;p&gt;Here you can see interpolation of an array element, a slice that we then call a method on and even a function call. The postcircumfix rule happily means that we don’t go screwing up your email address any more.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say &quot;Please spam me at blackhole@jnthn.net&quot;&lt;/strong&gt;
Please spam me at blackhole@jnthn.net&lt;/pre&gt;
&lt;h3&gt;Choose Your Own Delimiters&lt;/h3&gt;
&lt;p&gt;The single and double quotes are suitable for a bunch of cases, but what if you want to use a bunch of single or double quotes inside the string? Escaping them would rather suck. Thing is, you could probably make that argument about any choice of quoting characters. So instead of making the choice for you, Perl 6 lets you pick. The q and qq quote constructs expect to be followed by a delimiter. If it’s something with a matching closer, it will look for that (for example, if you use an opening curly then your string is terminated by a closing curly; note that there’s only a finite set of these, and no, it doesn’t include having a comet be terminated by a snowman). Otherwise it looks for the same thing to terminate the string. Note you can also use multi-character openers and closers too (but only by repeating the same character). Otherwise, the q gives you the same semantics as single quotes, and qq gives you the same semantics as double quotes.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say q{C'est la vie}&lt;/strong&gt;
C'est la vie
&lt;strong&gt;&amp;gt; say q{{Unmatched } and { are { OK } in { here}}&lt;/strong&gt;
Unmatched } and { are { OK } in { here
&lt;strong&gt;&amp;gt; say qq!Lottery results: {(1..49).roll(6).sort}!&lt;/strong&gt;
Lottery results: 12 13 26 34 36 46&lt;/pre&gt;
&lt;h3&gt;Heredocs&lt;/h3&gt;
&lt;p&gt;All of the quoting constructs demonstrated so far allow you to include multiple lines of content. However, for that there’s usually a better way: here documents. There can be started with either q or qq, and then with the :to adverb being used to specify the string we expect to find, on a line of its own, at the end of the quoted text. Let’s see how this works, illustrated by a touching story.&lt;/p&gt;
&lt;pre&gt;print q:to/THE END/
    Once upon a time, there was a pub. The pub had
    lots of awesome beer. One day, a Perl workshop
    was held near to the pub. The hackers drank
    the pub dry. The pub owner could finally afford
    a vacation.
    THE END&lt;/pre&gt;
&lt;p&gt;The output of this script is as follows:&lt;/p&gt;
&lt;pre&gt;Once upon a time, there was a pub. The pub had
lots of awesome beer. One day, a Perl workshop
was held near to the pub. The hackers drank
the pub dry. The pub owner could finally afford
a vacation.&lt;/pre&gt;
&lt;p&gt;Notice how the text is not indented like in the program source. Heredocs remove indentation automatically, up to the indentation level of the terminator. If we’d used qq, we could have interpolated things into the heredoc. Note that this is all implemented by using the indent method on strings, but if your string doesn’t do any interpolation we do the call to indent at compile time as an optimization.&lt;/p&gt;
&lt;p&gt;You can also have multiple heredocs, and even call methods on the data that will be located in the heredoc (note the call to lines in the following program).&lt;/p&gt;
&lt;pre&gt;my ($input, @searches) = q:to/INPUT/, q:to/SEARCHES/.lines;
    Once upon a time, there was a pub. The pub had
    lots of awesome beer. One day, a Perl workshop
    was held near to the pub. The hackers drank
    the pub dry. The pub owner could finally afford
    a vacation.
    INPUT
    beer
    masak
    vacation
    whisky
    SEARCHES

for @searches -&amp;gt; $s {
    say $input ~~ /$s/
        ?? &quot;Found $s&quot;
        !! &quot;Didn't find $s&quot;;
}&lt;/pre&gt;
&lt;p&gt;The output of this program is:&lt;/p&gt;
&lt;pre&gt;Found beer
Didn't find masak
Found vacation
Didn't find whisky&lt;/pre&gt;
&lt;h3&gt;Quote Adverbs for Custom Quoting Constructs&lt;/h3&gt;
&lt;p&gt;The single and double quote semantics, also available through q and qq, cover most cases. But what if you have a situation where you want to, say, interpolate closures but not scalars? This is where quote adverbs come in. They allow you to turn certain quoting features on and off. Here’s an example.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say qq:!s&quot;It costs $10 to {&amp;lt;eat nom&amp;gt;.pick} here.&quot;&lt;/strong&gt;
It costs $10 to eat here.&lt;/pre&gt;
&lt;p&gt;Here, we use the semantics of qq, but then turn off scalar interpolation. This means we can write the price without worrying about it trying to interpolate the 11th capture of the last regex. Note that this is just using the standard colonpair syntax. If you want to start from a quote construct that supports basically nothing, and then just turn on some options, you can use the Q construct.&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say Q{$*OS\n&amp;amp;sin(3)}&lt;/strong&gt;
$*OS\n&amp;amp;sin(3)
&lt;strong&gt;&amp;gt; say Q:s{$*OS\n&amp;amp;sin(3)}&lt;/strong&gt;
MSWin32\n&amp;amp;sin(3)
&lt;strong&gt;&amp;gt; say Q:s:b{$*OS\n&amp;amp;sin(3)}&lt;/strong&gt;
MSWin32
&amp;amp;sin(3)
&lt;strong&gt;&amp;gt; say Q:s:b:f{$*OS\n&amp;amp;sin(3)}&lt;/strong&gt;
MSWin32
0.141120008059867&lt;/pre&gt;
&lt;p&gt;Here we start with a featureless quoting construct, then turn on extra features: first scalar interpolation, then backslash escapes, then function interpolation. Note that we could have chosen any delimiter we wished too.&lt;/p&gt;
&lt;h3&gt;Quote Constructs are Languages&lt;/h3&gt;
&lt;p&gt;Finally, it’s worth mentioning that when the parser enters a quoting construct, really it is switching to parsing a different language. When we build up quoting constructs from adverbs, really this is just mixing extra roles into the base quoting language to turn on extra features. For the curious, here’s &lt;a href=&quot;https://github.com/rakudo/rakudo/blob/a8d2cc29320344a3e693df3df88dbba43eb84eec/src/Perl6/Grammar.pm#L3237&quot;&gt;how Rakudo does it&lt;/a&gt;. Whenever we hit a closure or some other interpolation, the language is temporarily switched back to the main language. This is why you can do things like:&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;&amp;gt; say &quot;Hello, { prompt &quot;Enter your name: &quot; }!&quot;&lt;/strong&gt;
Enter your name: Jonathan
Hello, Jonathan!&lt;/pre&gt;
&lt;p&gt;And the parser doesn’t get terribly confused about the fact that the closure being interpolated contains another double quoted string. That is, we’re parsing the main language, then slip into a quoting language, then recurse into the main language again, and finally recurse into the quoting language again to parse the string in the closure in the string in the program. It’s like the Perl 6 parser wants to give us all matryoshka dolls for Christmas. :-)&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1616/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1616/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1616&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Mon, 10 Dec 2012 00:01:34 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W49</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W49.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W49.html</link>
	<description>&lt;p&gt;To begin with, I’ve made &lt;a href=&quot;https://perl6advent.wordpress.com/2012/12/08/day-8-panda-package-manager/&quot; title=&quot;Perl 6 Advent Calendar: Day 8 - Panda package manager&quot;&gt;a post for Perl 6 Advent Calendar&lt;/a&gt;. If you were wondering why it was late, I will tell you - it’s actually early. Somebody else has claimed article for eighth day and forgot to upload it, so somebody had to put replacement article. I’ve moved my article from 12th day to 8th day, just so Perl 6 Advent Calendar could be continued. Moritz, to protect against that, put the just-in-case article about exceptions (it’s exceptional), if that would happen again.&lt;/p&gt;&lt;p&gt;Enough talking about Perl 6 Advent Calendar, as obviously this blog post isn’t about it. Every week, I describe changes in Perl 6 and its implementations. This is yet another article about changes.&lt;/p&gt;&lt;p&gt;Jonathan Worthington lately was working on improving syntax errors messages in Rakudo Perl. Now they are better and more accurate, just like they’re already in STD.pm6 or Niecza.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Syntax errors now provide context using ⏏ symbol, just like STD.pm6 does.&lt;/li&gt;

&lt;li&gt;Rakudo is now more accurate about error locations and doesn’t inform about errors on line 1 (like missing semicolon) that actually are on line 777.&lt;/li&gt;

&lt;li&gt;Syntax errors now have colors.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;.join&lt;/code&gt; method isn’t O(N&lt;sup&gt;4&lt;/sup&gt;) anymore.&lt;/li&gt;

&lt;li&gt;A &lt;code&gt;~&lt;/code&gt; infix operator is faster.&lt;/li&gt;

&lt;li&gt;Numeric ranges are faster.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 08 Dec 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Perl 6 Advent Calendar: Perl 6 Advent Calendar 2012: Table of Contents</title>
	<guid>http://perl6advent.wordpress.com/?p=1121</guid>
	<link>https://perl6advent.wordpress.com/2012/12/01/perl-6-advent-calendar-2012-table-of-contents/</link>
	<description>&lt;p&gt;This post serves as a table of contents for the 2012 Perl 6 advent calendar. Links to new posts will appear here during the course of this month.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/01/state-of-perl-6-in-2012/&quot;&gt;Day 1: State of Perl 6 in 2012&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/02/anonymous-functions-for-great-good/&quot;&gt;Day 2: Anonymous functions for great good&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/03/day-3-whatever-the-layout-manager-is/&quot;&gt;Day 3: Whatever the layout manager is&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/04/day-4-having-fun-with-rakudo-and-project-euler/&quot;&gt;Day 4: Having Fun with Rakudo and Project Euler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/05/a-perl-6-debugger/&quot;&gt;Day 5: A Perl 6 Debugger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/06/day-6-lexical-imports/&quot;&gt;Day 6: Lexical imports&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/07/day-7-mimebase64-on-encoded-strings/&quot;&gt;Day 7: MIME::Base64 – On encoded strings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/08/day-8-panda-package-manager/&quot;&gt;Day 8: Panda package manager&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://perl6advent.wordpress.com/2012/12/09/day-9-longest-token-matching/&quot;&gt;Day 9 – Longest Token Matching&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See also: &lt;a href=&quot;http://perl6advent.wordpress.com/2011/12/01/perl-6-advent-calendar-2011/&quot;&gt;table of contents for 2011&lt;/a&gt;, &lt;a href=&quot;http://perl6advent.wordpress.com/2010/12/25/merry-christmas-2/&quot;&gt;2010&lt;/a&gt;, &lt;a href=&quot;http://perl6advent.wordpress.com/2009/12/01/perl-6-advent-calendar/&quot;&gt;2009&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/perl6advent.wordpress.com/1121/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/perl6advent.wordpress.com/1121/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=perl6advent.wordpress.com&amp;amp;blog=10740073&amp;amp;post=1121&amp;amp;subd=perl6advent&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Sat, 01 Dec 2012 11:59:59 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W48</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W48.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W48.html</link>
	<description>&lt;p&gt;Rakudo Star 2012.11 was released with new impressive improvements (check my previous posts for more information). If you’re reading this, please check out the &lt;a href=&quot;http://perl6advent.wordpress.com/&quot; title=&quot;Perl 6 Advent Calendar&quot;&gt;Perl 6 Advent Calendar&lt;/a&gt; - new posts are added daily.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;rakudo_star_post_rakudo_star_201211&quot;&gt;Rakudo Star (post Rakudo Star 2012.11)&amp;gt;&lt;ul&gt;
&lt;li&gt;Removed &lt;code&gt;~/.perl6/lib&lt;/code&gt; from &lt;code&gt;@*INC&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Str.indent&lt;/code&gt; ignores empty lines.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl_in_rakudo_star_201211&quot;&gt;Rakudo Perl (in Rakudo Star 2012.11)&amp;gt;&lt;ul&gt;
&lt;li&gt;Unknown metacharacters in regexp throw &lt;code&gt;X::Syntax::Regex::UnrecognizedMetachar&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Null regexp throws &lt;code&gt;X::Syntax::Regex::NullRegex&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Unrecognized backslash sequence throws &lt;code&gt;X::Backslash::UnrecognizedSequence&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Non-variable dollar throws &lt;code&gt;X::Backslash::NonVariableDollar&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl_post_rakudo_star_201211&quot;&gt;Rakudo Perl (post Rakudo Star 2012.11)&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--doc&lt;/code&gt; option now works.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;Str.indent&lt;/code&gt; ignores empty lines.&lt;/li&gt;

&lt;li&gt;Added &lt;code&gt;Signature.ACCEPTS&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;make install&lt;/code&gt; now works.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 01 Dec 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: -2 6</title>
	<guid>http://glitchmr.github.com/2-6.html</guid>
	<link>http://glitchmr.github.com/2-6.html</link>
	<description>&lt;p&gt;You know, -2 is highly connected to Perl 6. It’s valid syntax for &lt;code&gt;-(2)&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://encrypted.google.com/search?hl=en&amp;amp;q=%2D2%206&quot;&gt;&lt;img /&gt;&lt;/a&gt;&lt;/p&gt;</description>
	<pubDate>Fri, 30 Nov 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>rakudo.org: Rakudo Star 2012.11 released</title>
	<guid>http://rakudo.org/?p=231</guid>
	<link>http://rakudo.org/2012/11/28/rakudo-star-2012-11-released/</link>
	<description>&lt;p&gt;On behalf of the Rakudo and Perl 6 development teams, I’m happy to announce the November 2012 release of “Rakudo Star”, a useful and usable distribution of Perl 6.  The tarball for the November 2012 release is &lt;a href=&quot;http://github.com/rakudo/star/downloads&quot;&gt;available for download&lt;/a&gt;.  A Windows .MSI version of Rakudo star will usually appear in the downloads area shortly after the tarball release.&lt;/p&gt;
&lt;p&gt;In the Perl 6 world, we make a distinction between the language (“Perl 6″) and specific implementations of the language such as “Rakudo Perl”.  This Star release includes &lt;a href=&quot;https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.11&quot;&gt;release 2012.11&lt;/a&gt;of the &lt;a href=&quot;http://github.com/rakudo/rakudo&quot;&gt;Rakudo Perl 6 compiler&lt;/a&gt;, version 4.6.0 of the &lt;a href=&quot;http://parrot.org/&quot;&gt;Parrot Virtual Machine&lt;/a&gt;, and various modules, documentation, and other resources collected from the Perl 6 community.&lt;/p&gt;
&lt;p&gt;Some of the new features added to this release include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;heredocs&lt;/li&gt;
&lt;li&gt;quote adverbs (like q:w//)&lt;/li&gt;
&lt;li&gt;implemented precedence related traits (equiv, looser, tighter, assoc)&lt;/li&gt;
&lt;li&gt;Perl 6 grammar NFAs are pre-computed, saving some work on each  invocation; this shaved around 10% off the time needed to run the spectests&lt;/li&gt;
&lt;li&gt;regexes and quotes have better support for user-selected delimiters&lt;/li&gt;
&lt;li&gt;FIRST/NEXT/LAST can now be used in all types of loop (previously limited to for)&lt;/li&gt;
&lt;li&gt;several fixes related to module precompilation. This should make working with larger code bases much less painful.&lt;/li&gt;
&lt;p&gt;This release also contains a range of performance improvements, bug fixes, improvements to error reporting and better failure modes. &lt;/p&gt;
&lt;p&gt;The following features have been deprecated or modified from previous releases due to changes in the Perl 6 specification, and are being removed or changed as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; at present, a reference to an &amp;amp;foo that does not exist evalutes to Nil. This will become a CHECK-time failure, in line with STD.&lt;/li&gt;
&lt;li&gt;Unary hyper ops currently descend into nested arrays and hashes.  This will change to make them equivalent to a one-level map.&lt;/li&gt;
&lt;li&gt;~/.perl6/lib will go away from the default include path (@*INC).&lt;br /&gt;
  Instead %*CUSTOM_LIB now holds paths to four library locations:&lt;p&gt;&lt;/p&gt;
&lt;pre&gt;perl    Rakudo installs its core modules here
vendor  OS-level package managers should install their modules here
site    for local module installations (e.g. with panda or ufo)
home    like site, but always under the user's home directory.
        fallback if site isn't writable.
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc.&lt;/li&gt;
&lt;li&gt; Leading whitespace in rules and under :sigspace will no longer be converted to &amp;lt;.ws&amp;gt; .  For existing regexes that expect this conversion, add a &amp;lt;?&amp;gt; in front of leading whitespace to make it meta again.&lt;/li&gt;
&lt;li&gt;The ?-quantifier on captures in regexes currently binds the capture  slot to a List containing either zero or one Match objects; i.e., it is equivalent to “** 0..1″.  In the future, the ?-quantifier will bind the slot directly to a captured Match or to Nil.  Existing code can manage the transition by changing existing ?-quantifiers to use “** 0..1″, which will continue to return a List of matches.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases.  Some of the not-quite-there features include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;advanced macros&lt;/li&gt;
&lt;li&gt;threads and concurrency&lt;/li&gt;
&lt;li&gt;Unicode strings at levels other than codepoints&lt;/li&gt;
&lt;li&gt;interactive readline that understands Unicode&lt;/li&gt;
&lt;li&gt;non-blocking I/O&lt;/li&gt;
&lt;li&gt;much of Synopsis 9&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is an online resource at http://perl6.org/compilers/features that lists the known implemented and missing features of Rakudo and other Perl 6 implementations.&lt;/p&gt;
&lt;p&gt;In many places we’ve tried to make Rakudo smart enough to inform the programmer that a given feature isn’t implemented, but there are many that we’ve missed.  Bug reports about missing and broken features are welcomed at .&lt;/p&gt;
&lt;p&gt;See http://perl6.org/ for links to much more information about Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources.  A draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf in the release tarball.&lt;/p&gt;
&lt;p&gt;The development team thanks all of the contributors and sponsors for making Rakudo Star possible.  If you would like to contribute, see http://rakudo.org/how-to-help, ask on the perl6-compiler@perl.org mailing list, or join us on IRC #perl6 on freenode.&lt;/p&gt;&lt;/ul&gt;</description>
	<pubDate>Wed, 28 Nov 2012 19:12:18 +0000</pubDate>
</item>
<item>
	<title>perl6.announce: Announce: Niecza Perl 6 v24 by Stefan O'Rear</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2012/11/msg689.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2012/11/msg689.html</link>
	<description>&lt;br /&gt;    Announce: Niecza Perl 6 v24&lt;br /&gt;&lt;br /&gt;This is release number 24 of Niecza Perl 6, marking 24 months since the first&lt;br /&gt;public release.  How time flies.&lt;br /&gt;&lt;br /&gt;You can obtain a build of Niecza from [1].  This build contains a&lt;br /&gt;working compiler as a set of .exe and .dll files suitable for use with&lt;br /&gt;Mono or Microsoft .NET.  If you wish to follow latest developments,&lt;br /&gt;you can obtain the source from [2]; however, you still need a&lt;br /&gt;binary for bootstrapping.&lt;br /&gt;&lt;br /&gt;Niecza is a Perl 6 compiler project studying questions about the&lt;br /&gt;efficient implementability of Perl 6 features.  It currently targets&lt;br /&gt;the Common Language Runtime; both Mono and Microsoft .NET are known to&lt;br /&gt;work.  On Windows, Cygwin is required for source builds only; see the&lt;br /&gt;README for details.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    List of changes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[Bug fixes]&lt;br /&gt;&lt;br /&gt;.classify and .categorize now return hashes.  (Solomon Foster)&lt;br /&gt;&lt;br /&gt;qx// is now sandboxed.  (Solomon Foster)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[Features]&lt;br /&gt;&lt;br /&gt;Added special functions gamma, expm1, log1p, erf, lgamma.  (Solomon Foster,&lt;br /&gt;using library code by John D. Cook)&lt;br /&gt;&lt;br /&gt;Export $*CUSTOM-LIB for panda's use.  (Solomon Foster)&lt;br /&gt;&lt;br /&gt;Added Parcel.Array and List.Array.  (Solomon Foster)&lt;br /&gt;&lt;br /&gt;Postfix operaters which mimic methods can now be used.  (Larry Wall)&lt;br /&gt;&lt;br /&gt;Added functionality for a &quot;precompiled system modules&quot; folder, eliminating&lt;br /&gt;the need for each user to separately compile the setting in a multi-user&lt;br /&gt;install.&lt;br /&gt;&lt;br /&gt;Added line editing to the REPL.&lt;br /&gt;&lt;br /&gt;Added an install target for *nixes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[Internal]&lt;br /&gt;&lt;br /&gt;Niecza has been significantly refactored to use a single instance of the&lt;br /&gt;kernel during compilation, opening the door to direct object sharing&lt;br /&gt;between the compiler and the runtime and significantly simplifying the&lt;br /&gt;bootstrap procedure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Getting involved&lt;br /&gt;&lt;br /&gt;Contact sorear in irc.freenode.net #perl6 or via the sender address of&lt;br /&gt;this mailing.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1] https://github.com/downloads/sorear/niecza/niecza-24.zip&lt;br /&gt;[2] https://github.com/sorear/niecza&lt;br /&gt;&lt;br /&gt;</description>
	<pubDate>Mon, 26 Nov 2012 23:18:27 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W47</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W47.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W47.html</link>
	<description>&lt;p&gt;So, well, now that my code compiles (well, C code, not Perl 6 code :-)) I’ve time to describe Perl 6 changes, instead of simply doing what &lt;a href=&quot;http://xkcd.com/303/&quot; title=&quot;XKCD: #303 - Compiling&quot;&gt;XKCD says&lt;/a&gt; - I shouldn’t waste time.&lt;/p&gt;&lt;p&gt;Rakudo Perl 2012.11 is now released. The change mentioned in this article is already in.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;perl_6_specification&quot;&gt;Perl 6 specification&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;NativeCall&lt;/code&gt; module is now part of specification.&lt;/li&gt;

&lt;li&gt;Calls to &lt;code&gt;trait_mod&lt;/code&gt; routines are evaluated in sink context.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--&amp;gt;&lt;/code&gt; (return type) acts more like a normal subroutine parameter.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:($a, $b) := \(1, 2)&lt;/code&gt; updates &lt;code&gt;$a&lt;/code&gt; and &lt;code&gt;$b&lt;/code&gt; instead of doing nothing.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 24 Nov 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jan Ingvoldstad: No such pipe, or this pipe has been deleted</title>
	<guid>http://pipes.yahoo.com/pipes/c30fa6b5be32693af535b6e46c4fabd6_b3b091b756e161113ae36142ad212cac</guid>
	<link></link>
	<description>This data comes from pipes.yahoo.com but the Pipe does not exist or has been deleted.</description>
	<pubDate>Fri, 23 Nov 2012 08:42:40 +0000</pubDate>
</item>
<item>
	<title>(lue): The Rakudo Codebase: Visualized! (Partially)</title>
	<guid>http://rdstar.wordpress.com/?p=152</guid>
	<link>http://rdstar.wordpress.com/2012/11/22/the-rakudo-codebase-visualized-partially/</link>
	<description>&lt;p&gt;Yesterday I stumbled upon &lt;a href=&quot;http://www.nntp.perl.org/group/perl.perl6.compiler/2009/09/msg4885.html&quot;&gt;this old perl6-compiler mailing list message&lt;/a&gt; which inspired me to actually try to split up the compilation of CORE.setting into smaller, saner pieces. &lt;a href=&quot;https://github.com/lue/rakudo&quot;&gt;I’ve started work on this already&lt;/a&gt; (so far having just modified the Makefile).&lt;/p&gt;
&lt;p&gt;The one and only response to that post suggested using the stub syntax to resolve missing class issues. Sadly, that does not work, because perl6 needs to see the stubbed class in full sometime later in the file.&lt;/p&gt;
&lt;p&gt;So, the best option I’ve seen is to include the files containing needed classes and roles into files that need them (through either use or require). This requires knowing what to include (as including everything everywhere ruins the point), and I’ve started to try to grasp what’s going on in the rakudo codebase, specifically src/core, in terms of dependencies.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/lue/rakudo-analyze&quot;&gt;Here’s what I have so far.&lt;/a&gt; It’s right now just one, single script. This single script graphs the inheritance chain of all the classes and roles in src/core (what classes and roles “is” and “does”). You need the modules Term::ANSIColor, Term::ProgressBar, and IO::Capture::Simple (at this time pulled in, but apparently unused, by Term::ProgressBar). You also need &lt;a href=&quot;http://betterthangrep.com/&quot;&gt;ack&lt;/a&gt; and &lt;a href=&quot;http://graphviz.org/&quot;&gt;graphviz&lt;/a&gt; (which is not used in the script, but needed to process the resulting core.dot file).&lt;/p&gt;
&lt;p&gt;Wanna see the graph for nom commit bf472b0, the latest as of this writing? Here you go (click to embiggen, clearly):&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://rdstar.files.wordpress.com/2012/11/core.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-medium wp-image-154&quot; height=&quot;5&quot; src=&quot;http://rdstar.files.wordpress.com/2012/11/core.png?w=300&amp;amp;h=5&quot; title=&quot;core&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The arrows point towards what a particular box is inheriting, and the one or two white boxes mean that the class or role doesn’t exist within the src/core files. Yellow denotes classes, red denotes roles. And each box contains the name of the class/role, and the file it was found in and the line number of its definition.&lt;/p&gt;
&lt;p&gt;This, however, doesn’t even begin to deal with all the dependencies abound in the src/core files. See all those abandoned colored blocks? Those aren’t inherited by anything in src/core, but they most certainly are utilized (e.g. the Pod::Config block, though not inherited, could easily be utilized as a variable type in the Pod code). I have a lot more work to do before I have a clear picture on how to separate CORE.setting into smaller pieces. (I might even need to utilize STD.pm6 or similar to do all the parsing I’ll eventually be doing!)&lt;/p&gt;
&lt;p&gt;Just to finish off, Here are a couple more graphs of the same data. The first graph above was generated with GraphViz’s “dot”. This one (generated by their “twopi” program) I think looks hilarious:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://rdstar.files.wordpress.com/2012/11/core_twopi.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-medium wp-image-156&quot; height=&quot;265&quot; src=&quot;http://rdstar.files.wordpress.com/2012/11/core_twopi.png?w=300&amp;amp;h=265&quot; title=&quot;core_twopi&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And this picture was generated by GraphViz’s “fdp”. I think this one is the easiest to follow.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://rdstar.files.wordpress.com/2012/11/core_fdp.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;alignnone size-medium wp-image-157&quot; height=&quot;300&quot; src=&quot;http://rdstar.files.wordpress.com/2012/11/core_fdp.png?w=258&amp;amp;h=300&quot; title=&quot;core_fdp&quot; width=&quot;258&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Happy viewing!&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/rdstar.wordpress.com/152/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/rdstar.wordpress.com/152/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=rdstar.wordpress.com&amp;amp;blog=13482955&amp;amp;post=152&amp;amp;subd=rdstar&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Thu, 22 Nov 2012 08:59:05 +0000</pubDate>
</item>
<item>
	<title>perl6.announce: Parrot 4.10.0 &quot;Red-eared Parakeet&quot; Released by Reini Urban</title>
	<guid>http://www.nntp.perl.org/group/perl.perl6.announce/2012/11/msg688.html</guid>
	<link>http://www.nntp.perl.org/group/perl.perl6.announce/2012/11/msg688.html</link>
	<description>On behalf of the Parrot team, I'm proud to announce Parrot 4.10.0, also known&lt;br /&gt;as &quot;Red-eared Parakeet&quot;.  Parrot (http://parrot.org/) is a virtual machine aimed&lt;br /&gt;at running all dynamic languages.&lt;br /&gt;&lt;br /&gt;Parrot 4.10.0 is available on Parrot's FTP site&lt;br /&gt;(ftp://ftp.parrot.org/pub/parrot/releases/devel/4.10.0/), or by following the&lt;br /&gt;download instructions at http://parrot.org/download.  For those who would like&lt;br /&gt;to develop on Parrot, or help develop Parrot itself, we recommend using Git to&lt;br /&gt;retrieve the source code to get the latest and best Parrot code.&lt;br /&gt;&lt;br /&gt;Parrot 4.10.0 News:&lt;br /&gt;    - Core&lt;br /&gt;        + Add PMCNULL check to result_info op&lt;br /&gt;        + Fixed record separator bug on io handles&lt;br /&gt;    - Build&lt;br /&gt;        + Add -fpermissive so that nqp builds under gcc 4.7.2&lt;br /&gt;        + Fixed warnings for old ICU 4.4&lt;br /&gt;    - Platforms&lt;br /&gt;        + More VMS fixes, but not yet done&lt;br /&gt;    - Branches&lt;br /&gt;        + The threads branch is ready to be merged, but nqp needs some changes,&lt;br /&gt;          so it will be merged with 4.11.0.&lt;br /&gt;    - Examples&lt;br /&gt;        + Parrot mini-web server fixes&lt;br /&gt;&lt;br /&gt;The SHA256 message digests for the downloadable tarballs are:&lt;br /&gt;82f38e6e596ab101c52313ad3e3560d2c8a72985362b54d9898619ab17a6f17d&lt;br /&gt;parrot-4.10.0.tar.gz&lt;br /&gt;7d6a592c386d25bcee429a269cc571ae81c5c080b15d14a884401a27fe3f5d4b&lt;br /&gt;parrot-4.10.0.tar.bz2&lt;br /&gt;&lt;br /&gt;Many thanks to all our contributors for making this possible, and our sponsors&lt;br /&gt;for supporting this project.  Our next scheduled release is 18 December 2012.&lt;br /&gt;&lt;br /&gt;The release is a day late. I apologize for the lateness.&lt;br /&gt;--&lt;br /&gt;Reini Urban&lt;br /&gt;http://cpanel.net/   http://www.perl-compiler.org/&lt;br /&gt;</description>
	<pubDate>Wed, 21 Nov 2012 17:27:35 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W46</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W46.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W46.html</link>
	<description>&lt;p&gt;I’m already aware that my blog looks spammy because of all those Perl 6 changes posts. I would like to remove all that garbage, so I’m thinking about separate site for those posts (of course with proper redirects of my old URLs).&lt;/p&gt; id='deprecations'&amp;gt;Deprecations&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;In Rakudo Perl 2012.12, &lt;code&gt;&amp;amp;foo&lt;/code&gt; when &lt;code&gt;sub foo&lt;/code&gt; isn’t declared will make CHECK-time exception instead of returning &lt;code&gt;Nil&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;When &lt;code&gt;&amp;lt;infix&amp;gt;&amp;lt;prefix&amp;gt;&amp;lt;space&amp;gt;&lt;/code&gt; sequence appears, user gets warning. This helps avoiding code like &lt;code&gt;$a ~~~ $b&lt;/code&gt; which actually means &lt;code&gt;$a ~~ (~$b)&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Empty infix operator (&lt;code&gt;sub infix:[&quot;&quot;]&lt;/code&gt;) isn’t allowed anymore.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;BOM (Byte Order Mark) at beginning of file is ignored.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;--optimize&lt;/code&gt; isn’t passed by default to Parrot when &lt;code&gt;--parrot-option&lt;/code&gt; is specified.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Niecza doesn’t depend on global &lt;code&gt;Top&lt;/code&gt; variable anymore allowing multiple Niecza interpreters running at once. It was being removed for two months.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 17 Nov 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W45</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W45.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W45.html</link>
	<description>&lt;p&gt;It’s another late Perl 6 changes article. Today the fun parts are adverbs, adverbs and adverbs. Oh, and blocks. And fixing bugs. Have fun playing with new features.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;INIT {}&lt;/code&gt; block is now rvalue.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;our ($x, $y)&lt;/code&gt; works correctly.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;take&lt;/code&gt; and &lt;code&gt;take-rw&lt;/code&gt; have correct return values.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;SET_FILE_LINE&lt;/code&gt; is now called only on exceptions that support it.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;FIRST&lt;/code&gt;, &lt;code&gt;NEXT&lt;/code&gt; and &lt;code&gt;LAST&lt;/code&gt; blocks are supported on various kinds of loops, previously it only worked for &lt;code&gt;for&lt;/code&gt; loops.&lt;/li&gt;

&lt;li&gt;Implemented operator adverbs.&lt;/li&gt;

&lt;li&gt;Associative objects now support &lt;code&gt;:exists&lt;/code&gt; and &lt;code&gt;:delete&lt;/code&gt; adverbs.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;q:c[]&lt;/code&gt; (string with interpolated closures) now works.&lt;/li&gt;

&lt;li&gt;Implemented slice adverbs, such as &lt;code&gt;:p&lt;/code&gt;, &lt;code&gt;:kv&lt;/code&gt;, &lt;code&gt;:k&lt;/code&gt; or &lt;code&gt;:v&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sun, 11 Nov 2012 08:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Jonathan Worthington (6guts): Lots of improvements coming in the Rakudo November release</title>
	<guid>http://6guts.wordpress.com/?p=257</guid>
	<link>http://6guts.wordpress.com/2012/11/08/lots-of-improvements-coming-in-the-rakudo-november-release/</link>
	<description>&lt;p&gt;The November release is still a couple of weeks off, but it’s already looking like one of the most exciting ones in a while. Here’s a rundown of the major improvements you can expect.&lt;/p&gt;
&lt;h3&gt;User Defined Operator Improvements&lt;/h3&gt;
&lt;p&gt;The way Rakudo handles parsing of user-defined operators has been almost completely reworked. The original implementation dated back quite a long way (we’re talking largely unchanged since probably 2010 or so), and as you might imagine, we’ve the tools to do a lot better now. The most significant change is that we now parse them using a lexically scoped derived language. This is done by mixing in to the current cursor’s grammar – something we couldn’t have done some years ago when NQP lacked roles! This means that the additions to the grammar don’t leak outside of the scope where the user-defined operators are defined – unless they are explicitly imported into another scope, of course.&lt;/p&gt;
&lt;pre&gt;{
    sub postfix:&amp;lt;!&amp;gt;($n) { [*] 1..$n };
    say 10!; # 3628800
}
say 10!; # fails to parse&lt;/pre&gt;
&lt;p&gt;Before, things were rather more leaky and thus not to spec. Perl 6 may allow lots of language extensibility, but the language design takes great care to limit its scope. Now Rakudo does much better here. As well as making things more correct, the nasty bug with pre-compilation of modules containing user defined operators is gone. And, last but not least, the precedence and associativity traits are now implemented, so user defined operators can pick their precedence level.&lt;/p&gt;
&lt;pre&gt;sub infix:&amp;lt;multiplied-with&amp;gt;($a, $b) is equiv(&amp;amp;infix:&amp;lt;*&amp;gt;) {
    $a * $b
}
sub infix:&amp;lt;to-the-power&amp;gt;($a, $b) is equiv(&amp;amp;infix:&amp;lt;**&amp;gt;) {
    $a ** $b
}
say 2 multiplied-with 3 to-the-power 2;&lt;/pre&gt;
&lt;h3&gt;Quote Adverbs and Heredocs&lt;/h3&gt;
&lt;p&gt;The other thing that’s had a big do-over is quote parsing. This meant a lot of quoting related things that hadn’t been easy to attack before became very possible. So possible, in fact, that they’ve been done. Thus, we now support heredocs:&lt;/p&gt;
&lt;pre&gt;say q:to/DRINKS/
    Yeti
    Leffe
    Tokyo
    DRINKS&lt;/pre&gt;
&lt;p&gt;This outputs:&lt;/p&gt;
&lt;pre&gt;Yeti
Leffe
Tokyo&lt;/pre&gt;
&lt;p&gt;Notice how it trims whitespace at the start of the string to the same level of degree of indentation as the end marker, so you can have heredocs indented to the same level your code is, if you wish. The :to syntax is an example of a quote adverb, and we now support those generally too. For example, a double-quoted string normally interpolates a bunch of different things: scalars, arrays, function calls, closures, etc. But what if you want a quoting construct that only interpolates scalars? You do something like:&lt;/p&gt;
&lt;pre&gt;my $value = 42;
say Q:s'{ &quot;value&quot;: $value }';&lt;/pre&gt;
&lt;p&gt;Alternatively, you could take a quoting construct that normally interpolates everything and just switch off the closure interpolation:&lt;/p&gt;
&lt;pre&gt;my $value = 42;
say qq:!c'{ &quot;value&quot;: $value }';&lt;/pre&gt;
&lt;p&gt;Last but not least, the shell words syntax now works. This lets you do quoting where things are broken up into a list by whitespace, but you can quote individual parts to prevent them&lt;br /&gt;
getting split, and also do interpolation.&lt;/p&gt;
&lt;pre&gt;say &amp;lt;&amp;lt; Hobgoblin 'Punk IPA' &amp;gt;&amp;gt;.perl; # (&quot;Hobgoblin&quot;, &quot;Punk IPA&quot;)&lt;/pre&gt;
&lt;p&gt;Sadly, I’ve got too bad a headache today to enjoy any of the listed beers. But hey, at least now you know some good ones to try… :-)&lt;/p&gt;
&lt;h3&gt;Operator Adverbs&lt;/h3&gt;
&lt;p&gt;Well, weren’t these some fun to implement. STD has parsed them for a long while. You’d think that’d make it easy to steal from, but no. Before you can do that, you have to figure out that not only does it parse adverbs as if they were infixes, but then pushes them onto the op stack in the operator precedence parser and does a reduce such that they come out looking like postfixes, which in turn need an AST transform to turn the postfix inside-out so what was originally parsed as a fake infix becomes a named argument to the thing preceding it. I’m still not sure if this is beautiful or horrifying, but now it’s in place. This means we can at last handle the adverb-y syntax for doing things like hash key existence checks or deletion:&lt;/p&gt;
&lt;pre&gt;my %h = a =&amp;gt; 0;
say %h&amp;lt;a&amp;gt;:exists; # True
say %h&amp;lt;a&amp;gt;:delete; # 0
say %h&amp;lt;a&amp;gt;:exists; # False

&lt;/pre&gt;
&lt;h3&gt;Macros&lt;/h3&gt;
&lt;p&gt;Recent work by masak++ has got macros to the point where they’re powerful enough to be potentially useful now. See &lt;a href=&quot;http://strangelyconsistent.org/blog/macros-progress-report-d2-merged&quot;&gt;his blog post&lt;/a&gt; for the sometimes-gory details, illustrated with exciting adventures involving wine barrels and questionably pluralized bits of Russian landscape. Really.&lt;/p&gt;
&lt;h3&gt;NFA Precomputation&lt;/h3&gt;
&lt;p&gt;This is decidedly a guts change, but worth a mention because it’s probably the main performance improvement we’ll see in the November release: the transitive NFAs that are used by the parser are now computed at the time we compile the Perl 6 grammar, not on-demand as we start parsing. They are then serialized, so at startup we just deserialize them and dig into the parsing. They’re not entirely cheap to construct, and so this saves a bit of work per invocation of the compiler. In the spectests, it made an almost 10% difference to the time they take to run (many test files are quite small, and we run over 700 test files, so reducing invocation overhead adds up).&lt;/p&gt;
&lt;p&gt;By the way, if you’re confused on what these transitive NFAs are about, let me try and explain a little. In order to decide which of a bunch of protoregexes or which branch of an alternation to take, the declarative parts of a grammar are analyzed to build NFAs: state machines that can efficiently decide which branches are possible then rank them by token length. It’s not only important for a correct parse (to get longest token matching semantics correct), but also important algorithmically. If you look at the way Perl 6 grammars work, the naive view is that it’s recursive descent. That makes it nice to write, but if it really was evaluated that way, you’d end up trying loads of paths that didn’t work out before hitting upon the correct one. The NFA is used to trim the set of possible paths through the grammar down to the ones that are actually worth following, and their construction is transitive, so that we can avoid following call chains several levels deep that would be fruitless. If you’ve ever used the debugger to explore a grammar, and wondered how we seem to magically jump to the correct alternative so often, well, now you know. :-)&lt;/p&gt;
&lt;h3&gt;Other Things&lt;/h3&gt;
&lt;p&gt;There are a few other bits and pieces: INIT phasers now work as r-values, you can use the FIRST/NEXT/LAST phasers in all the looping constructs now (previously, they worked only in for loops), version control markers left behind in code are gracefully detected for what they are, and a bunch of proto subs in the setting have been given narrower signatures which makes various things you’d expect to work when passed to, say, map, actually do so.&lt;/p&gt;
&lt;p&gt;Oh, and whatever else we manage to get around to in the next couple of weeks. :-)&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/257/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/257/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=257&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 07 Nov 2012 23:27:00 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W44</title>
	<guid>http://glitchmr.github.com/perl6-changes-2012W44.html</guid>
	<link>http://glitchmr.github.com/perl6-changes-2012W44.html</link>
	<description>&lt;p&gt;I apologize for being late, Gabor Szabo. I simply forgot about writing this. This week, the main attraction is proper quote constructs support.&lt;/p&gt;&lt;h1 id=&quot;incompatible_changes&quot;&gt;Incompatible changes&lt;/h1&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IO::Path.dir&lt;/code&gt; was removed. You’re expected to use &lt;code&gt;IO::Path.directory&lt;/code&gt; instead. Also, named parameter in &lt;code&gt;IO::Path&lt;/code&gt; constructor was renamed from &lt;code&gt;:dir&lt;/code&gt; to &lt;code&gt;:directory&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;h1 id=&quot;new_features&quot;&gt;New features&lt;/h1&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Postfix operators like &lt;code&gt;.foo-bar&lt;/code&gt; take precedence above method calls.&lt;/li&gt;
&lt;/ul&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Better delimiter handling. For example, &lt;code&gt;rx&lt;/code&gt; and &lt;code&gt;m&lt;/code&gt; allow delimiters other than &lt;code&gt;//&lt;/code&gt; or &lt;code&gt;{}&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Quote adverbs, such as &lt;code&gt;:w&lt;/code&gt; or &lt;code&gt;:x&lt;/code&gt; are supported.&lt;/li&gt;

&lt;li&gt;Implemented &lt;code&gt;andthen&lt;/code&gt; infix operator.&lt;/li&gt;

&lt;li&gt;You can specify input line separator on new sockets using &lt;code&gt;:input-line-separator&lt;/code&gt; named argument.&lt;/li&gt;

&lt;li&gt;Quotes have better error reporting.&lt;/li&gt;

&lt;li&gt;Heredocs are implemented.&lt;/li&gt;

&lt;li&gt;Macro arguments now carry lexical envirnoment properly.&lt;/li&gt;

&lt;li&gt;Postfix operators like &lt;code&gt;.foo-bar&lt;/code&gt; take precedence above method calls.&lt;/li&gt;

&lt;li&gt;Git merge conflicts markers are now detected properly.&lt;/li&gt;
&lt;/ul&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;qw&lt;/code&gt; is unsafe and cannot be used in safe (sandbox) mode.&lt;/li&gt;

&lt;li&gt;Postfix operators like &lt;code&gt;.foo-bar&lt;/code&gt; take precedence above method calls.&lt;/li&gt;
&lt;/ul&gt;</description>
	<pubDate>Sun, 04 Nov 2012 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W44</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W44.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W44.html</link>
	<description>&lt;p&gt;I apologize for being late, Gabor Szabo. I simply forgot about writing this. This week, the main attraction is proper quote constructs support.&lt;/p&gt; id='incompatible_changes'&amp;gt;Incompatible changes&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;IO::Path.dir&lt;/code&gt; was removed. You’re expected to use &lt;code&gt;IO::Path.directory&lt;/code&gt; instead. Also, named parameter in &lt;code&gt;IO::Path&lt;/code&gt; constructor was renamed from &lt;code&gt;:dir&lt;/code&gt; to &lt;code&gt;:directory&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;/h2&gt;&lt;h2 id=&quot;stdpm6&quot;&gt;STD.pm6&amp;gt;&lt;ul&gt;
&lt;li&gt;Postfix operators like &lt;code&gt;.foo-bar&lt;/code&gt; take precedence above method calls.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Better delimiter handling. For example, &lt;code&gt;rx&lt;/code&gt; and &lt;code&gt;m&lt;/code&gt; allow delimiters other than &lt;code&gt;//&lt;/code&gt; or &lt;code&gt;{}&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Quote adverbs, such as &lt;code&gt;:w&lt;/code&gt; or &lt;code&gt;:x&lt;/code&gt; are supported.&lt;/li&gt;

&lt;li&gt;Implemented &lt;code&gt;andthen&lt;/code&gt; infix operator.&lt;/li&gt;

&lt;li&gt;You can specify input line separator on new sockets using &lt;code&gt;:input-line-separator&lt;/code&gt; named argument.&lt;/li&gt;

&lt;li&gt;Quotes have better error reporting.&lt;/li&gt;

&lt;li&gt;Heredocs are implemented.&lt;/li&gt;

&lt;li&gt;Macro arguments now carry lexical envirnoment properly.&lt;/li&gt;

&lt;li&gt;Postfix operators like &lt;code&gt;.foo-bar&lt;/code&gt; take precedence above method calls.&lt;/li&gt;

&lt;li&gt;Git merge conflicts markers are now detected properly.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;&lt;h2 id=&quot;niecza_perl&quot;&gt;Niecza Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;qw&lt;/code&gt; is unsafe and cannot be used in safe (sandbox) mode.&lt;/li&gt;

&lt;li&gt;Postfix operators like &lt;code&gt;.foo-bar&lt;/code&gt; take precedence above method calls.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sun, 04 Nov 2012 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: Macros progress report: D2 merged</title>
	<guid>tag:strangelyconsistent.org,2012-11-02:blog/macros-progress-report-d2-merged</guid>
	<link>http://strangelyconsistent.org/blog/macros-progress-report-d2-merged</link>
	<description>&lt;p&gt;The grant that I'm currently working on, the &lt;a href=&quot;http://news.perlfoundation.org/2011/09/hague-grant-application-implem.html&quot;&gt;macros
grant&lt;/a&gt;,
has now reached its D2 milestone. That is, the so-called &quot;unquotes&quot; work
as advertised in Rakudo:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;macro apply($code, $argument) {
    quasi {
        {{{$code}}}( {{{$argument}}} );
    }
}

apply sub ($t) { say $t }, &quot;OH HAI&quot;;    # prints &quot;OH HAI&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Macros are &lt;em&gt;routines&lt;/em&gt;, and so they take parameters. The above &lt;code&gt;apply&lt;/code&gt; macro
takes some &lt;code&gt;$code&lt;/code&gt; and an &lt;code&gt;$argument&lt;/code&gt;, and calls the former with the latter.
It's as if, when the macro expansion is all done, what's left in the code
is the following line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(sub ($t) { say $t })(&quot;OH HAI&quot;);    # prints &quot;OH HAI&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Of course, we never actually &lt;em&gt;see&lt;/em&gt; this line, and in the compiler it's never
textually substituted like that, because the substitution all happens on the
level of syntax trees, not on the level of text.&lt;/p&gt;

&lt;p&gt;The new thing in this picture is the &lt;code&gt;{{{ }}}&lt;/code&gt; thingies: the so-called
&lt;em&gt;unquotes&lt;/em&gt;. Back in &lt;a href=&quot;http://strangelyconsistent.org/blog/macros-progress-report-quantum-yak-shaving&quot;&gt;my last progress
report&lt;/a&gt;,
we still didn't have unquote support in nqp. Now we do. In fact, we got unquote
support already back in August. That, it turns out, was the easy bit.&lt;/p&gt;

&lt;p&gt;Then the conceptual problems appeared. For a few months, whenever I thought
about macros, my brain would melt trying to think about those problems. It took
quite a while to go from unquotes existing to them being actually useful. What
follows is an explanation of the problem and its solution.&lt;/p&gt;

&lt;p&gt;The problem is one of &lt;em&gt;context&lt;/em&gt;. By that, we mean the variable bindings seen by
a piece of code. Psychologically, we expect a piece of code to see the variables
in its lexical environment, that is, all the variables declared in all
surrounding blocks.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my $a;

sub f {
    my $b;
    sub {
        my $c;
        # $a, $b, $c visible here
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The exciting and highly useful thing about closures is that they honor this
expectation, while simultaneously being &lt;em&gt;first-class values&lt;/em&gt; that you can pass
around between parts of your program. This combination of static bindings and
dynamic function values is so powerful that you can use it to emulate the
object encapsulation so espoused by OO enthusiasts.&lt;/p&gt;

&lt;p&gt;In the above case, the sub &lt;code&gt;f&lt;/code&gt; implicitly returns its inner sub, which can
be transported across the Russian tundras, stored in a dank wine cellar for
75 years before being uncorked... but when finally called, it will &lt;em&gt;still&lt;/em&gt;
remember its &lt;code&gt;$a&lt;/code&gt;, &lt;code&gt;$b&lt;/code&gt;, and &lt;code&gt;$c&lt;/code&gt; bindings. That's because closures aren't
just containers of statements. They also hold a reference to an &lt;code&gt;OUTER&lt;/code&gt; block
through which variable lookups can be made.&lt;/p&gt;

&lt;p&gt;(And in the above case, &lt;code&gt;$b&lt;/code&gt; and &lt;code&gt;$c&lt;/code&gt; are properly encapsulated. &lt;code&gt;$a&lt;/code&gt; isn't,
since it's globally visible.)&lt;/p&gt;

&lt;p&gt;We want macros to behave the same. That is, &lt;code&gt;quasi&lt;/code&gt; blocks should behave like
closures.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;macro f {
    my $a = &quot;OH HAI&quot;;
    quasi {
        say $a;
    }
}

my $a = &quot;B... BOOOOM!&quot;;
f;      # OH HAI
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It's the same principle: after the &lt;code&gt;f;&lt;/code&gt; call has been conceptually replaced by
&lt;code&gt;say $a;&lt;/code&gt; this code should still remember its context, its origins, namely the
macro body. The fact that &lt;code&gt;say $a;&lt;/code&gt; doesn't print &lt;code&gt;&quot;B... BOOOOM!&quot;&lt;/code&gt;, from the
variable in the mainline scope, is part of what's called &lt;em&gt;hygiene&lt;/em&gt;. Hygiene
means that just like with closures, bindings inside are isolated from bindings
outside by default.&lt;/p&gt;

&lt;p&gt;(The term &quot;hygiene&quot; is often conflated in people's minds with the term
&quot;AST-based macros&quot;. The two are not the same. AST-based macros are necessary
but not sufficient for hygiene. End of rant.)&lt;/p&gt;

&lt;p&gt;But wait a minute. These two situations are obviously very similar. In the case
of the closure, we know that the closure must keep an &lt;code&gt;OUTER&lt;/code&gt; reference to
remember its context. What is it in the macro case that remembers the context?&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;quasi&lt;/code&gt; construct generates an AST, a syntax tree, that then gets spliced
into the mainline code where the &lt;code&gt;f;&lt;/code&gt; call used to be. This AST must be the
vessel for the context information. So, just like a closure is a bunch of
statements plus a context, an AST object must be a tree plus the context
information. If the AST &lt;em&gt;didn't&lt;/em&gt; have a context, the above macro expansion
couldn't be hygienic.&lt;/p&gt;

&lt;p&gt;We must perform unholy surgery on the block that eventually results from the
quasi AST. The block will naturally have mainline context, but we want to
&lt;em&gt;recontext&lt;/em&gt; it to have macro context. So in the Rakudo macro expansion code,
there is some code that transplants the context from the AST object to the new
block. It involves a Rakudo-specific op called &lt;code&gt;perl6_get_outer_ctx&lt;/code&gt;. It's only
used for this code path.&lt;/p&gt;

&lt;p&gt;This much was clear already when I was merging D1. Now for the new
complications.&lt;/p&gt;

&lt;p&gt;Macro expansions consist of &lt;em&gt;two&lt;/em&gt; stages of substitution, and this is what
makes them useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unquotes are replaced by ASTs&lt;/strong&gt;, typically arguments originating from the
outisde of the macro.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The macro invocation is replaced by the AST&lt;/strong&gt; returned from applying the
macro to its arguments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When implementing D1, I sorted out my thoughts by writing lots of ruminating
gists. During this phase of the work, I've composed fewer gists, but an
unexpected thing happened: the more time passed, the more I realized how much I
had &lt;em&gt;misnamed&lt;/em&gt; the variables in the macro code I had contributed to Rakudo.&lt;/p&gt;

&lt;p&gt;It wasn't that I was careless about naming when I first wrote that code.
Instead, my understanding of the macro domain had shifted so much that the
choices of names I had made started to feel wrong. Today I landed &lt;a href=&quot;https://github.com/rakudo/rakudo/commit/203f97e264e1c61e18a61163eef49bba03b806f1&quot;&gt;a
long-awaited
refactor&lt;/a&gt;
which not only unified the three macro-invocation code paths, but also fixed
all the now slighty-off variable names. Quite a relief.&lt;/p&gt;

&lt;p&gt;Here's part of what changed. During D1, a lot of AST objects in source ended up
being called &lt;strong&gt;quasi ASTs&lt;/strong&gt;. Nowadays, the following distinction is made:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;quasi ASTs&lt;/strong&gt; are what &lt;code&gt;quasi&lt;/code&gt; blocks generate. Naturally.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;argument ASTs&lt;/strong&gt; are the things that the parser generates as it parses the
macro arguments, just before it invokes the macro.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;macro ASTs&lt;/strong&gt; are what's returned from a macro, to be spliced
back into the mainline code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is overlap. A macro AST has been generated as either a quasi AST or an
argument AST at some point or other. But the focus here is where the ASTs are
coming from. And it turns out that matters a lot. Quasi ASTs and argument ASTs
are quite different. Hence the need for precision.&lt;/p&gt;

&lt;p&gt;By the way, there is possibly a fourth kind of AST, one that we don't have yet,
but that is totally possible once people start building macro libraries and
stuff:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;synthetic ASTs&lt;/strong&gt;, syntax trees built up programmatically from individual
AST nodes or smaller ASTs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't know yet if that's going to become a reality. Until it does, &lt;code&gt;quasi&lt;/code&gt;
blocks fill much the same role.&lt;/p&gt;

&lt;p&gt;Once we had unquotes working in Rakudo, the one glaring omission was that
the unquotes didn't behave hygienically. Which was a shame because, again,
people really expect hygiene to work:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;macro test($value) {
    my $a = &quot;B... BOOOOM!&quot;;
    quasi {
        say {{{$value}}};
    }
}

my $a = &quot;OH HAI&quot;;
test $a;    # OH HAI nowadays, used to B... BOOOOM!
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Just as the quasi AST should remember its own original context, so should the
argument AST that ends up in &lt;code&gt;$value&lt;/code&gt;. It used not to, and so the context it
got was the quasi's, resulting in &lt;code&gt;&quot;B... BOOOOM!&quot;&lt;/code&gt; above. A little ironic
that it was the successful recontexting of the quasi AST that messed things
up for the argument AST.&lt;/p&gt;

&lt;p&gt;For months I struggled with the problem of how to recontext the argument
ASTs. I developed a solution in a branch, which finally worked as it should,
except that it &lt;em&gt;still&lt;/em&gt; didn't recontext the ASTs properly! Argh!&lt;/p&gt;

&lt;p&gt;My plan of attack had been to set the context at the time of unquote
evaluation, as the quasi is evaluated when running the macro. The other
day, jnthn pointed out that this approach may be overly complicated: maybe
the context could be set at the time of argument collection, just before
calling the macro. This is definitely simpler. Not least because at this
point, the parser actually &lt;em&gt;is&lt;/em&gt; in the context it wants to set! And in
particular, no block surgery was needed this time.&lt;/p&gt;

&lt;p&gt;I tried it. It worked. This solution almost feels &lt;em&gt;too&lt;/em&gt; simple, and I'm not
sure yet it will let us do all the things we want to do. But all the tests
pass, and I have hammered this solution with tricky situations that might
break, and it's holding up so far. So, we now have hygienic macros with
unquotes in Rakudo.&lt;/p&gt;

&lt;p&gt;Here are the macro-related gists that I wrote during this period. They are in
various states of obsolescence at this point, but still potentially
informative:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://gist.github.com/abd360db840a0719da2f&quot;&gt;Proceedings: What are macros?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://gist.github.com/3438222&quot;&gt;macros use case by FROGGS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://gist.github.com/3634046&quot;&gt;It's all about context&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://gist.github.com/3678362&quot;&gt;pack, unpack, pack, unpack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other artifacts that have emerged since D1 are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;a href=&quot;https://github.com/perl6/roast/blob/master/S06-macros/unquoting.t&quot;&gt;new spectest
file&lt;/a&gt;.
Also, thanks to a suggestion by moritz++, the macro spectest files are now
&lt;a href=&quot;https://github.com/perl6/roast/commit/0710d57620707c076175f129eb1ab08df427b840&quot;&gt;much better
named&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A number of commits to the &lt;code&gt;nom&lt;/code&gt; branch of Rakudo:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/98591b486467b72f925d3cea0bcfa7155f6e313c&quot;&gt;can parse unquotes in quasis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/1b9b70b1d0813cebd2b3d4dab2805be1d7abc13f&quot;&gt;backpedal on throwing an exception&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/30c0302b747a553b7f97191919930c06effe3575&quot;&gt;&lt;code&gt;&amp;lt;statementlist&amp;gt;&lt;/code&gt;, not &lt;code&gt;&amp;lt;EXPR&amp;gt;&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/b7e189599c2787d7b3cbfb2865bbfb406fdc042f&quot;&gt;implement unquote splicing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/fc88876a1bc08eb6c5b39be4ae8b9f72d366c604&quot;&gt;&lt;code&gt;X::TypeCheck::MacroUnquote&lt;/code&gt; -&amp;gt; &lt;code&gt;X::TypeCheck::Splice&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/7d10d1aae2288b9e7c9529c9899bd845ced808fc&quot;&gt;throw &lt;code&gt;X::TypeCheck::Splice&lt;/code&gt; everywhere&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/e5b94e343b237fa644ccff2abb583f0331ea74ad&quot;&gt;make comment more precise&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/e7ab9ace23569bb2d5fe5550288efb8c0cbacd4b&quot;&gt;refactor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/9bb7de6dbf77b29298dae64ed5707e08061f065a&quot;&gt;wrap macro-arg ASTs in thunks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/203f97e264e1c61e18a61163eef49bba03b806f1&quot;&gt;unify macro code paths&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/rakudo/rakudo/commit/02688057bb7e44557c614155370cd57209733e1c&quot;&gt;make macro expansion ignore empty ASTs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;A number of commits to the &lt;code&gt;nqp&lt;/code&gt; project:
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/perl6/nqp/commit/1f54496f467ce76307afedb8e0992c1206aa7ea6&quot;&gt;added &lt;code&gt;QAST::Unquote&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/perl6/nqp/commit/c2236072abf2f4d743f0b02d750fc5ac32b88f00&quot;&gt;added &lt;code&gt;.evaluate_unquotes&lt;/code&gt; method to QAST nodes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/perl6/nqp/commit/2f7b14d66b5777f7f4d680cdbd787d284828c1f2&quot;&gt;add &lt;code&gt;.evaluate_unquotes&lt;/code&gt; to BVal and Block&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/perl6/nqp/commit/bc734932e9f7a8b63938fcb8ea8d23a057cd596f&quot;&gt;shallow-clone nodes with kids&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Two more deliveries of the macros talk: one at French Perl Workshop in
Strasbourg, and one at YAPC::Europe in Frankfurt.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And once again, it's time to glance at what's ahead in the grant work. D3
promises to deliver hygiene. As explained above, D2 already provides this; I
actually could have declared the milestone D2 finished at the point I got
unquotes working in Rakudo (in August), but it felt slightly disingenuous to do
so, because unquotes aren't really useful until they're fully hygienic. Anyway,
half of D3 ends up being already done. What still needs to be implemented is
the &lt;code&gt;COMPILING::&lt;/code&gt; pseudopackage, which gives the macro author several ways to
opt out of hygiene. This is sometimes very powerful, even if it makes sense for
it not to be the default.&lt;/p&gt;

&lt;p&gt;My grant reports have been sparse lately. I'm hopeful that the wait until the
next one won't be as long.&lt;/p&gt;</description>
	<pubDate>Fri, 02 Nov 2012 16:40:43 +0000</pubDate>
</item>
<item>
	<title>rakudo.org: Rakudo Star 2012.10 released</title>
	<guid>http://rakudo.org/?p=225</guid>
	<link>http://rakudo.org/2012/10/29/rakudo-star-2012-10-released/</link>
	<description>&lt;p&gt;On behalf of the Rakudo and Perl 6 development teams, I’m happy to announce the October 2012 release of “Rakudo Star”, a useful and usable distribution of Perl 6.  The tarball for the October 2012 release is available from &amp;lt;&lt;a href=&quot;http://github.com/rakudo/star/downloads&quot;&gt;http://github.com/rakudo/star/downloads&lt;/a&gt;&amp;gt;. A Windows .MSI version of Rakudo star will usually appear in the downloads area shortly after the tarball release.&lt;/p&gt;
&lt;p&gt;In the Perl 6 world, we make a distinction between the language (“Perl 6″) and specific implementations of the language such as “Rakudo Perl”.  This Star release includes &lt;a href=&quot;https://github.com/rakudo/rakudo/blob/nom/docs/announce/2012.10&quot;&gt;release 2012.10&lt;/a&gt; of the &lt;a href=&quot;http://github.com/rakudo/rakudo&quot;&gt;Rakudo Perl 6 compiler&lt;/a&gt;, version 4.6.0 of the &lt;a href=&quot;http://parrot.org/&quot;&gt;Parrot Virtual Machine&lt;/a&gt;, and various modules, documentation, and other resources collected from the Perl 6 community.&lt;/p&gt;
&lt;p&gt;Some of the new features added to this release include:&lt;/p&gt;
&lt;p&gt;* The method case of the handles trait&lt;/p&gt;
&lt;p&gt;* The &amp;lt;-&amp;gt; lambda, which defaults parameters to rw&lt;/p&gt;
&lt;p&gt;* The :dba modifier in regexes&lt;/p&gt;
&lt;p&gt;* The radix form :60[24, 59, 59]&lt;/p&gt;
&lt;p&gt;* Improved coverage of Perl 5 regexes when the P5 modifier is used&lt;/p&gt;
&lt;p&gt;* Correct parsing of nested quote delimiters&lt;/p&gt;
&lt;p&gt;* Attributes in scope are now visible inside of an eval&lt;/p&gt;
&lt;p&gt;This release also contains a range of performance improvements, bug fixes, improvements to error reporting and better failure modes.&lt;/p&gt;
&lt;p&gt;The following features have been deprecated or modified from previous releases due to changes in the Perl 6 specification, and are being removed or changed as follows:&lt;/p&gt;
&lt;p&gt;* Unary hyper ops currently descend into nested arrays and hashes.&lt;br /&gt;
This will change to make them equivalent to a one-level map.&lt;/p&gt;
&lt;p&gt;* ~/.perl6/lib will go away from the default include path (@*INC).&lt;br /&gt;
Instead %*CUSTOM_LIB now holds paths to four library locations:&lt;br /&gt;
perl    Rakudo installs its core modules here&lt;br /&gt;
vendor  OS-level package managers should install their modules here&lt;br /&gt;
site    for local module installations (e.g. with panda or ufo)&lt;br /&gt;
home    like site, but always under the user’s home directory.&lt;br /&gt;
fallback if site isn’t writable.&lt;/p&gt;
&lt;p&gt;* protos for built-in routines are now mostly as generic as possible,&lt;br /&gt;
and will be changed to be specific to the arity of the routine.&lt;br /&gt;
For example ‘proto sub chr(|) {*}’ will become ‘proto sub chr($) {*}’&lt;br /&gt;
This affects everybody who adds multis with unusual arity to built-in&lt;br /&gt;
subs.&lt;/p&gt;
&lt;p&gt;* Parameters preceded by a | or \ can no longer have a sigil.&lt;/p&gt;
&lt;p&gt;* IO::Path.dir (which returns the directory part of the path) has been&lt;br /&gt;
renamed to IO::Path.directory.  IO::Path.dir will be removed or&lt;br /&gt;
re-purposed.&lt;/p&gt;
&lt;p&gt;* The Str.ucfirst builtin is deprecated; it will be replaced by Str.tc.&lt;/p&gt;
&lt;p&gt;* Leading whitespace in rules and under :sigspace will no longer be&lt;br /&gt;
converted to &amp;lt;.ws&amp;gt; .  For existing regexes that expect this conversion,&lt;br /&gt;
add a &amp;lt;?&amp;gt; in front of leading whitespace to make it meta again.&lt;/p&gt;
&lt;p&gt;* The ?-quantifier on captures in regexes currently binds the capture&lt;br /&gt;
slot to a List containing either zero or one Match objects; i.e., it&lt;br /&gt;
is equivalent to “** 0..1″.  In the future, the ?-quantifier will&lt;br /&gt;
bind the slot directly to a captured Match or to Nil.  Existing code&lt;br /&gt;
can manage the transition by changing existing ?-quantifiers to&lt;br /&gt;
use “** 0..1″, which will continue to return a List of matches.&lt;/p&gt;
&lt;p&gt;There are some key features of Perl 6 that Rakudo Star does not yet handle appropriately, although they will appear in upcoming releases.  Some of the not-quite-there features include:&lt;/p&gt;
&lt;p&gt;* advanced macros&lt;br /&gt;
* threads and concurrency&lt;br /&gt;
* Unicode strings at levels other than codepoints&lt;br /&gt;
* interactive readline that understands Unicode&lt;br /&gt;
* non-blocking I/O&lt;br /&gt;
* much of Synopsis 9&lt;/p&gt;
&lt;p&gt;There is an online resource at &lt;a href=&quot;http://perl6.org/compilers/features&quot;&gt;http://perl6.org/compilers/features&lt;/a&gt; that lists the known implemented and missing features of Rakudo and other Perl 6 implementations.&lt;/p&gt;
&lt;p&gt;In many places we’ve tried to make Rakudo smart enough to inform the programmer that a given feature isn’t implemented, but there are many that we’ve missed.  Bug reports about missing and broken features are welcomed at &amp;lt;&lt;a href=&quot;http://rakudo.org/feed/rakudobug@perl.org&quot;&gt;rakudobug@perl.org&lt;/a&gt;&amp;gt;.&lt;/p&gt;
&lt;p&gt;See &lt;a href=&quot;http://perl6.org/&quot;&gt;http://perl6.org/&lt;/a&gt; for links to much more information about  Perl 6, including documentation, example code, tutorials, reference materials, specification documents, and other supporting resources. A draft of a Perl 6 book is available as &amp;lt;docs/UsingPerl6-draft.pdf&amp;gt; in the release tarball.&lt;/p&gt;
&lt;p&gt;The development team thanks all of the contributors and sponsors for making Rakudo Star possible.  If you would like to contribute, see &amp;lt;&lt;a href=&quot;http://rakudo.org/how-to-help&quot;&gt;http://rakudo.org/how-to-help&lt;/a&gt;&amp;gt;, ask on the &lt;a href=&quot;http://rakudo.org/feed/perl6-compiler@perl.org&quot;&gt;perl6-compiler@perl.org&lt;/a&gt; mailing list, or join us on IRC #perl6 on freenode.&lt;/p&gt;</description>
	<pubDate>Mon, 29 Oct 2012 22:24:02 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Perl 6 changes - 2012W43</title>
	<guid>http://glitchmr.github.com/perl-6-changes-2012W43.html</guid>
	<link>http://glitchmr.github.com/perl-6-changes-2012W43.html</link>
	<description>&lt;p&gt;Rakudo Star 2012.10 will be released soon, but before that will happen, I’ll list changes in Perl 6 specifications and implementations. Not many changes, but many of those are very important. Personally, I find custom operators precedences, &lt;code&gt;&amp;lt;&amp;lt; &amp;gt;&amp;gt;&lt;/code&gt; quotes and prototypes in core subroutines very impressive improvements - it was all done in one week.&lt;/p&gt; id='new_features'&amp;gt;New features&amp;gt;&lt;h2 id=&quot;rakudo_perl&quot;&gt;Rakudo Perl&amp;gt;&lt;ul&gt;
&lt;li&gt;Custom operators can now have precedences.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;&amp;lt;&amp;lt; &amp;gt;&amp;gt;&lt;/code&gt; quotes now support interpolation.&lt;/li&gt;

&lt;li&gt;Perl 6 grammars are pre-computed.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;eval&lt;/code&gt; now sees custom operators.&lt;/li&gt;

&lt;li&gt;Not-found dynamic values make better error messages.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;${variable}&lt;/code&gt; now makes better error message.&lt;/li&gt;

&lt;li&gt;&lt;code&gt;read&lt;/code&gt; now exists again in &lt;code&gt;IO::Socket&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Many core subroutines now have prototypes. This allows doing stuff like &lt;code&gt;@array.map: &amp;amp;sin&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/h2&gt;</description>
	<pubDate>Sat, 27 Oct 2012 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>
<item>
	<title>Carl Masak: Sweet ports</title>
	<guid>tag:strangelyconsistent.org,2012-10-26:blog/sweet-ports</guid>
	<link>http://strangelyconsistent.org/blog/sweet-ports</link>
	<description>&lt;p&gt;I had invited jnthn over because I had invested in a bottle of nice port wine that I really wanted to try, but one whole bottle was too much for me. For both of us, during the course of an afternoon, it was about right.&lt;/p&gt;

&lt;p&gt;&lt;img alt=&quot;jnthn holding a glass of port&quot; src=&quot;http://strangelyconsistent.org/blog/images/jnthn-porting.jpg&quot; style=&quot;float: right; border: solid 1px black; margin: 1em;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So that was the premise. Because we both like bad puns — jnthn admittedly more than I do — we decided to make it a &quot;porting hackathon&quot;, where we would port some piece of software to Perl 6 while sipping the sweet beverage from Portugal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which piece of software did we end up porting?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://metacpan.org/module/JSON::Path&quot;&gt;&lt;code&gt;JSON::Path&lt;/code&gt;&lt;/a&gt; from CPAN. It's a module that does for JSON what XPath did for XML.&lt;/p&gt;

&lt;p&gt;Well, actually &lt;code&gt;JSON::Path&lt;/code&gt; is not very tied to the JSON format at all. It just expects your data to be a hierarchy of arrays, hashes, and scalar values, just like JSON.&lt;/p&gt;

&lt;p&gt;Here are some JsonPath examples, just to give you a taste of it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$.class.student[0].name           name of first student in class hash
$['class']['student'][0]['name']  same, with an alternate notation
$.beers[*]                        all beers
$.beers[*].name                   names of all beers
$..author                         recursively find all 'author' entries
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See &lt;a href=&quot;http://goessner.net/articles/JsonPath/&quot;&gt;here&lt;/a&gt; for a more detailed specification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Any nice insights along the way?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes, we found a pattern which we really liked. Not sure what it's called, or if it has a name. We're certainly not the first to come across it — it's probably well-known in FP circles. But as soon as we came up with the idea, the rest of the design basically fell into place.&lt;/p&gt;

&lt;p&gt;Perhaps the easiest way to explain the pattern is to say this: our action methods make little subroutines.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;method command:sym&amp;lt;.&amp;gt;($/) {
    my $key = ~$&amp;lt;ident&amp;gt;;
    make sub ($next, $current, @path) {
        $next($current{$key}, [@path, &quot;['$key']&quot;]);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is especially apt, because the JsonPath language is all about how to find data in a hierarchical data structure. So each little subroutine outlines how one particular piece of syntax digs further down into the data structure. In the above case, it's saying that a JsonPath fragment such as&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.foo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;will be translated to Perl 6 code such as&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$current{'foo'}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All the other action methods also return little anonymous subs like this one. To make it all work, the grammar is structured so that the fragments end up nesting around each other from left to right:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;token commandtree {
    &amp;lt;command&amp;gt; &amp;lt;commandtree&amp;gt;?
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The resulting AST comes out looking like a Matryoshka doll of &lt;code&gt;commandtree&lt;/code&gt; nodes. Or a chain where each link is generated by its own specific rule. The links of the chain are forged together by the &lt;code&gt;commandtree&lt;/code&gt; action method, that uses &lt;code&gt;assuming&lt;/code&gt; to pre-set the &lt;code&gt;$next&lt;/code&gt; parameter of the anonymous functions:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;method commandtree($/) {
    make $&amp;lt;command&amp;gt;.ast.assuming(
        $&amp;lt;commandtree&amp;gt;
            ?? $&amp;lt;commandtree&amp;gt;[0].ast
            !! #`[create a function that returns the result];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that's it. Long ago in the mists of computer history, AI researchers must have felt that intelligence would sprout from depths of LISP because they knew about patterns like this one: how to build up complex behavior by forging together little links in a chain, each one a simple &quot;atom&quot; of behavior. At least that's how it felt to see this experiment work.&lt;/p&gt;

&lt;p&gt;It also made me &lt;a href=&quot;http://twitter.com/carlmasak/status/259962045338902528&quot;&gt;tweet this&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img alt=&quot;&amp;quot;Whenever I use higher-order functions properly, it suddenly feels like I'm doing &amp;lt;em&amp;gt;real&amp;lt;/em&amp;gt; coding, not some watered-down attempts at coding.&amp;quot;&quot; src=&quot;http://strangelyconsistent.org/blog/images/hop-tweet.png&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes, but how was the port?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Oh, it was pretty nifty. I've decided to provisionally like port wine after this. It's fruity and sweet, and goes really well with cheese, or quality chocolate.&lt;/p&gt;

&lt;p&gt;Here's a picture of the finished bottle, along with all the tests passing:&lt;/p&gt;

&lt;p&gt;&lt;img alt=&quot;A picture of a screenshot and an empty bottle of port.&quot; src=&quot;http://strangelyconsistent.org/blog/images/screenshot-and-bottle.jpg&quot; title=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Our finished module can be found &lt;a href=&quot;https://github.com/jnthn/json-path&quot;&gt;at Github&lt;/a&gt;.&lt;/p&gt;</description>
	<pubDate>Fri, 26 Oct 2012 20:19:37 +0000</pubDate>
</item>
<item>
	<title>Jonathan Worthington (6guts): Rakudo Debugger Updates</title>
	<guid>http://6guts.wordpress.com/?p=248</guid>
	<link>http://6guts.wordpress.com/2012/10/24/rakudo-debugger-updates/</link>
	<description>&lt;p&gt;A while ago I wrote about Rakudo getting an &lt;a href=&quot;http://6guts.wordpress.com/2012/08/28/a-rakudo-debugger/&quot;&gt;interactive debugger&lt;/a&gt;. The feedback I’ve got has been a happy mixture of “this is useful” and “I’d really like it to X” – so I’ve been working on some improvements. I showed them off at my &lt;a href=&quot;http://act.yapc.eu/npw2012/&quot;&gt;Nordic Perl Workshop&lt;/a&gt; talk the weekend before last, in a fun session where I used the debugger to hunt down some problems in a small tool that had a couple of modules. It was nice not only to demonstrate the debugger itself, but also because I could show some neat Perl 6 code along the way.&lt;/p&gt;
&lt;p&gt;So, what new things can you expect from the debugger that will be bundled in the Rakudo Star release that will be emerging in the next few days? Here’s a quick rundown.&lt;/p&gt;
&lt;p&gt;Attributes that are in scope can now be introspected, just by typing their name. Additionally, the self keyword is recognized as a variable name by the debugger, meaning you can look at it directly (just type “self” and press enter) or even to look at public attributes (“self.name”).&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://6guts.files.wordpress.com/2012/10/attrs.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-250&quot; height=&quot;187&quot; src=&quot;http://6guts.files.wordpress.com/2012/10/attrs.png?w=640&amp;amp;h=187&quot; title=&quot;attrs&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Before, if you were on a line of code that was going to make a call, you would always step in to the callee on pressing enter. Now, if you type “s” and press enter, you will &lt;strong&gt;s&lt;/strong&gt;tep over the call. Got bored of debugging the current routine and want to let it run its course, and break on the next statement after it returns? Just type “so” and press enter, and you will &lt;strong&gt;s&lt;/strong&gt;tep &lt;strong&gt;o&lt;/strong&gt;ut of the current routine.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://6guts.files.wordpress.com/2012/10/step.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-251&quot; height=&quot;352&quot; src=&quot;http://6guts.files.wordpress.com/2012/10/step.png?w=640&amp;amp;h=352&quot; title=&quot;step&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Trace points are perhaps the most powerful of the new features. They enable you to add print statements to your code, without actually adding print statements to your code. A trace point is like a break point, but instead of breaking, it just evaluates an expression and logs it. Later on, you can view the log.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://6guts.files.wordpress.com/2012/10/tracepoints.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-249&quot; src=&quot;http://6guts.files.wordpress.com/2012/10/tracepoints.png?w=640&quot; title=&quot;tracepoints&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To go with Rakudo’s improving support for the P5 adverb on regexes, which allows the use of Perl 5 regex syntax from within Perl 6, the debugger now also supports single-stepping through those Perl 5 regexes.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://6guts.files.wordpress.com/2012/10/p5rx.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-252&quot; src=&quot;http://6guts.files.wordpress.com/2012/10/p5rx.png?w=640&quot; title=&quot;p5rx&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are also a range of small fixes and tweaks that avoid some of the noise you could get before. For example, fails no longer count as exception throws that cause a rt (run until throw) to break, and sigspace in rules is no longer single-stepped, just jumping straight to the next interesting atom.&lt;/p&gt;
&lt;p&gt;What of plans for the future? There are some other ideas already in the issues queue. Beyond those, I’m planning to make a web-based API frontend to the debugger, to go alongside the command line one. This should allow a browser-based debugging interface to be built, but should also enable tools like Padre to integrate with the Rakudo Debugger.&lt;/p&gt;
&lt;p&gt;Enjoy the updates!&lt;/p&gt;
&lt;br /&gt;  &lt;a href=&quot;http://feeds.wordpress.com/1.0/gocomments/6guts.wordpress.com/248/&quot; rel=&quot;nofollow&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://feeds.wordpress.com/1.0/comments/6guts.wordpress.com/248/&quot; /&gt;&lt;/a&gt; &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://stats.wordpress.com/b.gif?host=6guts.wordpress.com&amp;amp;blog=14597269&amp;amp;post=248&amp;amp;subd=6guts&amp;amp;ref=&amp;amp;feed=1&quot; width=&quot;1&quot; /&gt;</description>
	<pubDate>Wed, 24 Oct 2012 15:39:29 +0000</pubDate>
</item>
<item>
	<title>Konrad Borowski: Travis - add and forget</title>
	<guid>http://glitchmr.github.com/travis-add-and-forget.html</guid>
	<link>http://glitchmr.github.com/travis-add-and-forget.html</link>
	<description>&lt;p&gt;So, you may have heard that Travis is nice build testing service. It is - I even use it for my JavaScript projects. But, guess what will happen if somebody uses Travis incorrectly.&lt;/p&gt;&lt;p&gt;The problem is about one of the most commonly languages made by &lt;a href=&quot;http://use.perl.org/use.perl.org/_Aristotle/journal/33448.html&quot; title=&quot;use Perl: The blind leading the blind&quot;&gt;bad developers&lt;/a&gt; for &lt;a href=&quot;http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/&quot; title=&quot;fuzzy notepad: PHP: a fractal of bad design&quot;&gt;bad developers&lt;/a&gt;. But this article isn’t about why this language is bad - we all know it. Technically, I would use PHP instead of Brainfuck if I would have choice between PHP and Brainfuck, but it would be choice between very bad and worse.&lt;/p&gt;&lt;p&gt;6 months ago, &lt;a href=&quot;https://github.com/dshafik&quot; title=&quot;GitHub: dshafik&quot;&gt;Davey Shafik&lt;/a&gt; though - everybody uses Travis CI, why PHP source code doesn’t. He wanted to add Travis CI to his projects, but after quick look he noticed he doesn’t have test cases in his code and he was too lazy to add them. So, why not add Travis CI to some project that already has test cases so he could see how Travis CI would work.&lt;/p&gt;&lt;p&gt;And so he did. He decided to ask PHP to add Travis CI to &lt;a href=&quot;https://github.com/php/php-src/pull/68&quot; title=&quot;GitHub: php/php-src: Pull request #68 (Add support for Travis CI&quot;&gt;its source code&lt;/a&gt;. Of course, the reaction is obvious.&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;This is awesome, thanks!&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;If this gets merged in and you guys are interested in pull-request testing then shoot us a note at &lt;a href=&quot;mailto:contact@travis-ci.org&quot;&gt;contact@travis-ci.org&lt;/a&gt;. This feature is currently being rolled out manually but we’d love to turn it on for php.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;Cool, Travis is awesome.&lt;/p&gt;
&lt;/blockquote&gt;&lt;blockquote&gt;
&lt;p&gt;FYI looking into it. General idea is great, have to read about travis, etc first.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;After general “awesome” comments (seriously, do you know other words?) the code review started. For example, &lt;a href=&quot;http://github.com/dsp&quot; title=&quot;GitHub: dsp&quot;&gt;David Soria Parra&lt;/a&gt; complained about &lt;code&gt;!!&lt;/code&gt; usage&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;nb&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_CI'&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!!&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;getenv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_PHP_VERSION'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, version below is better. I mean, it’s longer so it’s definitely better. Yeah… is any programmer using &lt;code&gt;Boolean()&lt;/code&gt; function anyway in JavaScript (warning: not &lt;code&gt;Boolean&lt;/code&gt; constructor - &lt;code&gt;Boolean&lt;/code&gt; constructor is something you shouldn’t ever use as it’s always truthy).&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;nb&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_CI'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;getenv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_PHP_VERSION'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I’ve decided to look for explicit booleans. So, I made a search query and I’ve found &lt;a href=&quot;http://stackoverflow.com/a/7336873/736054&quot; title=&quot;Stack Overflow: How to convert string to boolean php&quot;&gt;answer on Stack Overflow&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$test_mode_mail&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'true'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I seriously don’t know what to think about this. It got 8 upvotes. It works - but it would be seriously stupid code in any language that isn’t PHP. I mean - &lt;code&gt;$string == 'true'&lt;/code&gt; is boolean, so why use ternary operator for it? And WHY use ternary operator for it even if it wouldn’t be ternary operator. I’m not going to mention usage of &lt;code&gt;==&lt;/code&gt;, instead of &lt;code&gt;===&lt;/code&gt;, it doesn’t really matter in this case.&lt;/p&gt;&lt;p&gt;My solution would be like this:&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;nb&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_CI'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_PHP_VERSION'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But good design should avoid dynamic constants.&lt;/p&gt;&lt;p&gt;Anyway, Davey Shafik has changed &lt;code&gt;!!&lt;/code&gt; into &lt;code&gt;(bool)&lt;/code&gt;… hey, hasn’t David Soria Parra said him to use &lt;code&gt;(boolean)&lt;/code&gt;… check. Those PHP aliases attack again. Why? Why converting to boolean could be done using two casts with only different name? Why converting to float could be done using &lt;em&gt;three&lt;/em&gt; casts with only different name - &lt;code&gt;(float)&lt;/code&gt;, &lt;code&gt;(double)&lt;/code&gt; and &lt;code&gt;(real)&lt;/code&gt;?&lt;/p&gt;&lt;p&gt;But that isn’t real problem. The Travis CI change was merged. Now README page of PHP contains the “build status: failing”. I’ve decided to click that image - every single change had either “build status: failing” or “build status: unknown” (because of failure while doing &lt;code&gt;git clone&lt;/code&gt; (possibly GitHub went down?)). PHP wastes time of Travis CI just to get “build status: failing” again.&lt;/p&gt;&lt;p&gt;After some time, David Soria Parra has decided to &lt;a href=&quot;https://github.com/php/php-src/commit/1fc6b3c4d9f364aab0353cce979f582908eab61b&quot; title=&quot;GitHub: php/php-src: Send mails to php-qa@lists.php.net whenever a build is failing&quot;&gt;add e-mailing about failures&lt;/a&gt; to php-qa@lists.php.net.&lt;/p&gt;&lt;p&gt;What went wrong? Well…&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;yaml&quot;&gt;&lt;span class=&quot;l-Scalar-Plain&quot;&gt;notifications&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;l-Scalar-Plain&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;l-Scalar-Plain&quot;&gt;recipients&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;php-qa@lists.php.net&lt;/span&gt;
        &lt;span class=&quot;l-Scalar-Plain&quot;&gt;on_success&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;change&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# [always|never|change] default: change&lt;/span&gt;
        &lt;span class=&quot;l-Scalar-Plain&quot;&gt;on_failure&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;always&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# [always|never|change] default: always&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But… PHP always fails - so PHP Quality Assurance would get lots of useless messages. Well, the solution for PHP developers wasn’t to fix PHP issues, definitely not - that would be too clever for programmers that work on PHP. The fix for developers was to &lt;a href=&quot;https://github.com/php/php-src/commit/f8d60e2f0963da833a024347a3996a7bb8904822&quot; title=&quot;GitHub: php/php-src: Travis stop spamming&quot;&gt;disable e-mail notifications&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;yaml&quot;&gt;&lt;span class=&quot;l-Scalar-Plain&quot;&gt;notifications&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;l-Scalar-Plain&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;l-Scalar-Plain&quot;&gt;recipients&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;p-Indicator&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;php-qa@lists.php.net&lt;/span&gt;
        &lt;span class=&quot;l-Scalar-Plain&quot;&gt;on_success&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;never&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# [always|never|change] default: change&lt;/span&gt;
        &lt;span class=&quot;l-Scalar-Plain&quot;&gt;on_failure&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;never&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# [always|never|change] default: always&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, I wonder why simply didn’t removed &lt;code&gt;notifications:&lt;/code&gt; section. I mean, they gave e-mail and told Travis - whatever happens, don’t e-mail. I’m going to call this &lt;a href=&quot;http://thedailywtf.com/Articles/The_Brillant_Paula_Bean.aspx&quot; title=&quot;The Daily WTF: The Brillant Paula Bean&quot;&gt;brillant&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;After some time, David Soria Parra has noticed that he doesn’t have to give e-mail to PHP Quality Assurance. So, he &lt;a href=&quot;https://github.com/php/php-src/commit/0d85a86bbb151537a2362f17224d076556252ada&quot; title=&quot;GitHub: php/php-src: Disable email notifications for travis-ci&quot;&gt;removed it&lt;/a&gt;.&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;yaml&quot;&gt;&lt;span class=&quot;l-Scalar-Plain&quot;&gt;notifications&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;l-Scalar-Plain&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p-Indicator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;l-Scalar-Plain&quot;&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now I wonder why he didn’t removed whole section. He doesn’t want any notifications, so why have this section? So now, Travis CI does nothing and everybody ignores it. I mean, it compiles, but…&lt;/p&gt;&lt;p&gt;It has 1123 compilation warnings. It has 106 test failures (with 43 expected test failures), one expected SIGSEGV (wait…) and 70.4% code coverage. And it’s not about unimplemented features - those are simply SKIPed. No, it isn’t better in PHP 5.4 - I mean, PHP 5.4 has 103 test failures (with 43 expected test failures).&lt;/p&gt;&lt;p&gt;PHP developers - please fix every bug before implementing new features. Having codebase that constantly contains lots of test failures isn’t really fun.&lt;/p&gt;&lt;p&gt;If you are PHP user, I would advice you trying some other language, such as &lt;a href=&quot;http://www.perl.org/&quot; title=&quot;The Perl Programming Language&quot;&gt;Perl&lt;/a&gt;  (believe me or not, Perl is way better than PHP) or &lt;a href=&quot;http://python.org/&quot; title=&quot;Python Programming Language - Official Website&quot;&gt;Python&lt;/a&gt;. Those languages are consistent and more structured than PHP. Annoyed by security issues? Those languages make it easier to protect against them.&lt;/p&gt;&lt;p&gt;If you still want to use PHP, use OOP everywhere and never use global variables (with the exception for &lt;code&gt;$_GET&lt;/code&gt;, &lt;code&gt;$_POST&lt;/code&gt; and &lt;code&gt;$_SERVER&lt;/code&gt; of course). PHP is simply unusable without OOP. But still, I would recommend using other langauges. Also, use template engine and prepared SQL queries.&lt;/p&gt; id='20121029_update'&amp;gt;2012-10-29 update&amp;gt;&lt;p&gt;The older version of article was mentioning following syntax.&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;TRAVIS_CI&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_PHP_VERSION'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Turns out that it doesn’t work. Why? Because constant value isn’t constant - it depends on environment variable existing. All you get is cryptic syntax error. PHP stupidly uses its grammar to annoy developer, even if this syntax would be allowed in other sane languages. For example, you cannot do &lt;code&gt;func()()&lt;/code&gt;, just because grammar forbids that. I haven’t heard of other language with similar problems.&lt;/p&gt;&lt;pre&gt;&lt;code&gt;PHP Parse error:  syntax error, unexpected 'isset' (T_ISSET)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Instead, the solution should be more like this.&lt;/p&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$travis_ci&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$_ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'TRAVIS_PHP_VERSION'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It’s not constant. It shouldn’t be because it isn’t real constant.&lt;/p&gt;</description>
	<pubDate>Sun, 21 Oct 2012 07:00:00 +0000</pubDate>
	<author>glitchmr@myopera.com (Konrad Borowski)</author>
</item>

</channel>
</rss>
