Parrot is really quite wonderful

Since I had all this time on my hands, I thought I'd have a quick look at how Parrot has been getting on in the six years of my absence.

There's been a series of articles on Perlbuzz and other places about how Perl 6 is nearly there, how Perl 6 is already there, how Perl 6 is dead in the water, and so I thought I'd go see for myself. My old SVN login still works; thankfully it looks like none of my original code for Parrot remains though. :)

I've come away thinking that Parrot is hugely important. I also think things have come a heck of a lot further than anyone outside the project could imagine. There's a perl6 make target which builds Perl 6 binary, for heaven's sake, and it runs real live Perl 6 code. It's there, right now. But that's not what excites me.

What excites me is the Parrot Compiler Toolkit.

Around the time I stopped working on Parrot, people were saying that Perl 6 was going to be written in Perl 6, and I was, well, let's say, a little sceptical. But you know what? They've done it. I am astounded. It is lovely.

This afternoon Will Coleda checked in a simple stub implementation of LOLCODE. The implementation consists of three files. The first is the grammar. This is written in Real Life Perl 6 Rules. That was pretty impressive. Then there's the actions file, which builds the Abstract Syntax Tree. This is written in a language called "Not Quite Perl", which is as close to Perl 6 as makes no odds. Finally there's the implementation of the builtins, which is written in Parrot's intermediate language. This is where you implement any custom runtime operations that Parrot doesn't already know about.

I spent two hours this afternoon basically starting from zero knowledge of the Parrot Compiler Toolkit and added a bunch of features to Will's stub, including variable assignment and access. That is astonishing.

The bottom line? The takeaway? It's really, really true. Parrot lets you implement your own languages using Perl 6 rules for the grammar and Perl 6 for the compiler.


Full version - 0 Comments