Friday, January 18, 2008

A Tour of Parrot

Tomorrow is Parrot’s monthly New Contributor Day, as we prepare for the 0.5.2 release on 15 January 2008. Before you join us in #parrot on irc.perl.org, you might peruse three articles I wrote for Linux Magazine last year.

A Tour of Parrot explains the philosophy of the project and several of the design decisions we’ve made.

Programming PIR explains the native programming language of Parrot, an assembly language full of high-level language features and syntactic shortcuts.

Programming Reusable PIR shows how to build actual programs in PIR.

Now that the Parrot Compiler Toolkit has reached its second stage of evolution, you don’t have to write PIR to build your own compiler on Parrot. I hope to continue the series soon by showing how simple writing a working compiler for a non-toy language can be with this new technology.

Parrot 0.5.2 Released

Bob Rogers just released Parrot 0.5.2. This monthly release includes a couple of interesting new features.

First, we’ve managed to bundle up Patrick Michaud’s Rakudo (that’s the implementation of Perl 6 on Parrot) such that you can type make perl6 on Unixy platforms and make perl6.exe on Windows and get a working standalone Perl 6 binary. This is experimental and we hope to iron out some installation and deployment issues by next month’s release, but it was important to demonstrate our progress.

The second new feature is a toolkit for starting your own compiler. Max Mohun built a prototype several months ago, and we’ve added a stripped down version for now that builds the skeleton of a compiler for you using the Parrot Compiler Tools. I mentioned the LOLCODE compiler in What the Perl 6 and Parrot Hackers Did on Their Christmas Vacation; this is how Simon and Company were able to get LOLCODE up and running so quickly.

If someone asks nicely, I might even make it possible to create a standalone LOLCODE compiler executable. Where else are you going to get patch explanations like:

The bare expression before an O RLY? should both set IT and be used as a test in the O RLY?, but it should only be evaluated once.

(See Perl RT #49808.)