I used the first chunk of my Rakudo day today to kick off a new project. At YAPC::EU, we had the Rakudo BOF where we collected together suggestions of features that mattered to people for Rakudo * - the major, usable Rakudo release we're planning for Q2 2010. One that came up was interoperability with Perl 5. This is something that I think had generally been assumed as something far off for Rakudo, or at least not really discussed in any great deal. The legacy is hardly great: the Ponie project, which tried to re-target Perl 5 to the Parrot Virtual Machine, was put out to pasture after plenty of effort for a variety of reasons, including Parrot being too much of a moving target at that point.
As far as I can see, re-targeting Perl 5 would be really quite a lot of work, and require a lot of guts knowledge. A lot of work in a specialized area presents a resourcing problem, and while I would happily cheer on a renewed effort to try and port Perl 5 to run on Parrot, I'm not at all expectant that anyone is going to jump in to such a task soon. Even if that happens, the chances of having something ready for Rakudo * seem to me fairly slim.
So, enter Blizkost. The Blizkost project is aiming to embed the Perl 5 interpreter and then build various bridges between it and Parrot. We'll start with the easy things - today I've done the easiest thing - and then build out from there. Rather than this being something built into Rakudo, instead Blizkost operates at the level of any other Parrot language implementation, meaning that it supports the HLLCompiler interface. This means that any other Parrot language that knows how to use this interface to eval code in another language, for example, will be able to make use of this.
The simplest thing I figured we could do is make it possible to eval a string of Perl 5 code. You can't get the value it returns, nor will it find any outer lexicals, but this means that you can now do (copy paste from the REPL):
> eval('print "Hello from Perl 5\n"',
Hello from Perl 5
Rakudo itself needed no changes to deal with this (other than a minor fix to deal with a language inter-op regression that affected eval in any language). All I had to do was to configure, make and make install Blizkost, using the same installed Parrot as Rakudo is built against, and it Just Worked.
So, we have a starting point. It's a small one, but then I only spent several hours on this so far.
I spent remaining bit of my Rakudo day dealing with some bugs.
I also spotted two other RT tickets that represented issues that I knew had been solved recently and closed them. I noted that a third was fixed and could be closed if somebody wrote tests to cover it and make sure it doesn't come back. Happily, we have some awesome test writers who take care of such things.
Thanks to Vienna.pm for funding this Rakudo day.