Perl 6 Programming/Implementations

From Wikibooks, open books for an open world
Jump to navigation Jump to search
was the first more-or-less functioning implementation of Perl 6. It was written in Haskell by Audrey Tang. It is now relevant mostly for historical interest.
An implementation of Perl 6 using the .net framework.
The leading, high-level implementation of Perl 6. It is self-hosting, which means that it is written mostly in Perl 6 and a sub-language of Perl 6: nqp. It targets several Virtual machine: Parrot, JVM, MoarVM and probably a few others in a near future (JavaScript, Lua, ...)

As of April 2014, Rakudo on MoarVM is the most promising implementation. It is entirely free and open-source software and uses a VM specifically designed for Perl 6.

Pugs and Parrot[edit]

After a long period of language design, it was time to start creating an implementation of the new language. To avoid the problems of Perl 5, it was decided by the initial organizers to create better separation between the back-end execution engine and the front-end language parser. After a number of discussions, the Parrot Virtual Machine project was started to create a virtual machine for dynamic languages like Perl 6. Parrot quickly grew to become independent of Perl 6, opting instead to become a virtual machine for all dynamic languages. Since Perl 6 was so large and ambitious, any virtual machine that could support it would also be very capable of supporting many other dynamic languages as well.

Audrey Tang, a Perl hacker, put together a reference implementation of Perl 6 using the Haskell programming language. This implementation was called Pugs, and served as a testbench for many of the ideas that the language designers were developing. Feedback from the Pugs team helped to shape the language design, and changes to the language design caused modifications in Pugs. It was a useful and helpful relationship, especially since no other implementations were at such a high state of development at that time., STD_blue and ELF[edit]

The "official" grammar for Perl 6 was going to be written in Perl 6 itself. This is because Perl 6 was being designed to have one of the most advanced grammar engines of any existing language at the time. There simply was no better choice for a grammar implementation for such an advanced language than that language itself. was created as the standard Perl 6 grammar, and is still deferred to when conflicts arise in the various implementations.

STD_red is an implementation of the Perl 6 grammar using the Ruby programming language. STD_blue is a more up-to-date compiler for that's written in Perl 5.

ELF is a boot-strapped implementation of Perl 6 that uses STD_blue to compile Perl 6 code into Perl 5 code for execution.

Rakudo Perl 6[edit]

When Audrey Tang left the Pugs project, however, development on it dropped to a minimum. It was still useful for testing and reference, but Pugs was no longer the active development platform that it once was. However, Parrot had grown by leaps and bounds since that time and was finally ready to start supporting compilers for high-level languages. A Perl 6 project, known as "Rakudo Perl 6" was started and began to grow rapidly. Part of the Rakudo project was Patrick Michaud's creation of high-level parser tools called PCT ("Parrot Compiler Tools"). PCT is a parser generator tool similar to the low-level Flex and Bison tools. However, PCT used a subset of the Perl 6 language to write parsers, instead of using C or C++. This meant that Rakudo was on the road to becoming self-hosting: The Rakudo compiler itself was partially written in Perl 6.

More information about Rakudo Perl 6 can be found on the web at