in Perl 6
There is no official or reference Perl 6 implementation, as exists with Perl 5. Instead, there is a language specification that began with Apocalypses and evolved through Exegeses and Synopses. There is also a test suite. The Synopses and test suite continuously evolve together with several compilers and interpreters. Larry Wall has clarified that anything that passes the test suite is Perl 6. With their feedback, the Synopses and test suite that form the language specification are evolving. This page is about the various partial implementations that exist, which can parse and execute Perl 6. Virtual machines and runloops are excluded because they do not deal with Perl 6 source code.
- Rakudo is currently the most feature-rich and most actively developed implementation. It runs on Parrot, a virtual machine for many dynamic languages.
- Niecza is currently the fastest implementation, the active development is lead by Stefan O'Rear.
- viv is a derivation of STD.pm for testing and bootstrapping purposes. A utility called "gimme5" creates viv by translating STD.pm into Perl 5. This is possible because Larry very carefully wrote STD.pm in a translatable subset of Perl 6.
- Elf is a compiler written in Perl 6 with Perl 5 and Lisp backends.
- vill connects STD.pm to the LLVM (Low Level Virtual Machine) compiler tools.
- Perlito, formerly known as MP6 (mini Perl 6), is a Perl 6 subset build by Flavio Glock for bootstrap purposes.
- v6 is a Perl 6 compiler for Perl 5.
Historical Implementations are definitely closed projects.
Pugs is an implementation of Perl 6, started by the lovely Audrey Tang, that ended the long "Dark Ages" of a Perl 6 development without implementation. Its written in the purely functionel language Haskell, using the Glasgow Haskell Compiler (GHC). It aims to implement the full Perl6 specification, as detailed in the Synopses. It has a dual core structure that embeds an Perl 5 interpreter allowing to use CPAN modules inside Perl 6. The test suite was born as a part of the Pugs adventure as well as Elf, Perlito, KindaPerl6 and many others projects.
Currently, the Pugs.hs project exists mainly for historical/archival purposes, not for active development.
The goal during this hiatus is to continue maintaining Pugs.hs, so it remains
installable with current and future editions of the Haskell Platform, and
interoperable with current and future releases of the Perl 5 Language.
Incredibly, an effort lead by Flávio Soibelmann Glock is working to actually implement Perl 6 in Perl 5. You can download v6 now on CPAN to try it out. Its feature set has not caught up with pugs yet, but there is steady progress on it.
Perl 6 features are also coming to Perl 5 in other ways, see Perl 6 for Perl 5.
The 'viv' utility is a Perl 5 based way to experiment with STD.pm, the still evolving "official" Perl 6 grammar, written in Perl 6. STD.pm can parse Perl 6 source code, check it for correct syntax and semantics, and convert it to an abstract syntax tree.
The chicken-or-egg bootstrap problem is how to use STD.pm on a computer that does not have a Perl 6 to run it. None of the current (March 2010) Perl 6 implementations (Rakudo, Pugs etc) can handle STD.pm, because amongst other things it uses Longest Token Matching (LTM), a feature of Perl 6 grammars that is particularly difficult to implement in a general purpose parser.
A utility called 'gimme5' http://svn.pugscode.org/pugs/src/perl6/gimme5 comes to the rescue. Larry wrote 'gimme5' in Perl 5 to translate a subset of Perl 6 grammars into Perl 5 language. The STD.pm 'make' command uses 'gimme5' to translate STD.pm into 'STD.pm5'. Another step then converts 'STD.pm5' to 'STD.pmc'. Larry ensures that STD.pm is written in just a translatable subset of Perl 6, so that 'gimme5' can handle it. He also causes 'viv' to emulate Longest Token Matching, by carefully arranging the sequence of tokens where they occur as alternatives in STD.pm. The result is that longer tokens occur and match before shorter ones.
Unfortunately, 'viv' is not equipped to execute the code. Other language tools such as Mildew extend 'viv' further and may be able to do that.
The name is a cute anagram of "Perl six". There is an existing but dormant version, and a radically different to-be-released version.
So the Sprixel currently available at http://svn.pugscode.org/pugs/src/perl6/sprixel is an AST interpreter, but a fairly quick one when run on V8.
After several months of experimentation diakopter settled on C# as the new implementation language, to run on both the Mono and the .NET virtual machines. The new Sprixel will embed a utility called RunSharp to dynamically generate bytecode that gets JIT compiled to native machine code before being executed. It will also contain its own regex and grammar engine, and will probably have its own derived variant of STD.pm for the Perl 6 language definition. The microbenchmarks published in #perl6 so far promise extremely fast parsing and execution performance.
Formerly known as MiniPerl 6. It's a small subset of Perl 6, helping to bootstrap other high level languages (HLL), pretty much like NQP. Perlito is grown out of the Pugs project and is mainly developed by Flavio S. Glock.
Topaz was Chip Salzenberg's attempt to reimplement Perl 5 in C++ in the late 1990s. Topaz was abandoned after the Coffee Mug Incident.
Simon Cozens tested around 2000 how to reimplement Perl.
(Perl (5) On New Interpreter Engine) had aimed to implement the Perl 5 language on Parrot. It was developed 2003-2006 by Arthur Bergman and Nicholas Clark. Ponie had the potential to integrate Perl 6 and Perl 5 code in the same process. That would have been useful for language bootstrap purposes, and also to make lots of the Perl 5 based CPAN libraries available to Perl 6 users. Some thought at one point even it might become Perl 5.10.. It was discontinued because emulating all of the idiosyncracies of Perl 5 was daunting, and the developers were presumably daunted.
A Perl 6 compiler written in Perl 6 itself, started by Mitchell Charity.
(well, the elf mostly-compatible-subset of p6). elf_h in http://svn.pugscode.org/pugs/misc/elf/ is a stand-alone p5 program, namely elf compiled to p5. the elfish/on_sbcl just swaps out the emitter. so elf_on_p5 can compile to p5 and to cl (depending on the emitter used), and so can elf_on_sbcl.