The T-Files


Sat, 09 Oct 2004

The thousand and one reasons to love Perl: [8] Parrot

The next incarnation of Perl, Perl 6, will run on top of its own virtual machine, much like Java or C#. This virtual machine is called Parrot. Unlike the Java Virtual Machine, which has been constructed just to run Java, Parrot will be the target platform for many other languages in addition to Perl 6 (such as Python, Ruby, PHP and BASIC). In fact, Parrot is very likely to be released significantly before Perl 6, and there is already an experimental version of Perl 5 (called Ponie) using Parrot, which will probably evolve into the official Perl 5.12 a few years from now. This approach will allow developers to share code libraries written in different languages. The are plans for a Parrot version of the excellent Perl database interface, which would make it accessible to other Parrot languages. There is already a prototype of mod_parrot, embedding Parrot into the Apache web server, that could one day replace mod_perl, mod_php, and mod_python.

There is still no real-world compiler available targeting Parrot, so you cannot use high-level languages at the moment and have to program it in its Assembler-like native code, but you can already access all the amazing features built into the core runtime engine, such as JIT compilation to real machine code, dynamic loading of shared libraries (in both machine and Parrot byte code), I/O functions, Unicode string manipulation, and access to objects (Perl datatypes like arrays or hash tables, or those you write yourself).