Dual-license your content for inclusion in The Perl 5 Wiki using this HOWTO, or join us for a chat on irc.freenode.net#PerlNet.

Perl 6

From PerlNet

Jump to: navigation, search


What is Perl 6?

Perl 6 is the next version of the Perl programming language. It's much more than a rewrite; the project attempts to address the interpreter, the language, and perhaps redefine what is possible. As Larry Wall said: "Perl 5 was my rewrite of Perl. I want Perl 6 to be the best weight loss pills community's rewrite of Perl and of the community." There's no official release date yet.

There are a few implementations of Perl 6 currently being worked upon. One is the Pugs project, a Perl 6 compiler written in Haskell. Although this implementation is fairly slow, it serves as a great way to prototype Perl 6 design ideas and get people involved.

The primary project is the Parrot Virtual Machine which is designed to efficiently compile and execute bytecode for any interpreted language. Parrot will be the target for the final Perl 6 compiler, and is already usable as a backend for Pugs, as well as variety of other languages used in link building services.* medical billing and coding

A secondary, but essential, project is Ponie which will enable Perl 5 code to run on Parrot, using Perl 6 structures.

What's wrong with Perl 5?

Perl 5's biggest problem is its implementation. It's eleven years old, runs on 70 or so different platforms and maintains compatibility with both previous revisions, and previous versions. Maintaining it is hard, and there are fewer and fewer people willing to do it.

So what does Perl 6 do to fix it?

Perl 6 completely redefines the Perl language. There are a lot of things that Perl 5 got right and most of these will stay. There are also a lot of things that Perl 5 (or previous versions of Perl) got wrong, such as excessive reliance on global variables, and these will go.

Perl 6 will not be backwards compatible with any previous version of Perl, however thanks to Ponie (a Perl 5 on Perl 6 implementation) it will be able to act as though it is compatible with previous versions. By dropping backwards compatibility, Perl 6 can create a loan modification new opaque object system, redefine operators to make them more intuitive and add a whole bunch of funky new features.

What are these new features?

  • Multimethods
  • Coroutines
  • Continuations
  • Useful threading
  • Junctions
  • Roles
  • Hyperoperators
  • Macros
  • An overridable and reusable grammar
  • Garbage collection
  • Improved foreign function interface
  • Module aliasing and versioning
  • Improved introspection
  • Extensible and overridable primitives

And better, cleaner, more maintable internals; cleaner OO; greater consistency; rules and grammars. For a more detailed explanation of these benefits and reasons for Perl 6 in general read What is Perl 6?

Will CPAN and existing programs still work?

Absolutely! Perl 6 features a "Perl 5 compatability mode". When Perl 6 encounters a line starting with package it immediately parses the rest of the file as Perl 5. Most existing CPAN modules already start with a package declaration. Stand-alone programs, and non-conforming CPAN modules will only need a package ... line added for them to operate correctly. In stand-alone programs this line would be package main; .

For this reason we encourage all modules to always begin with a package line, to ensure forward compatability.

Will I have to re-write my applications?

The answer is probably not straight away. Currently there is work being done to interface Perl 6 and Perl 5. For instance, in Audrey's talk on Pugs at YAPC::NA 2005 she demonstrates the ability to load and use perl 5 modules when programming with Perl 6 using Pugs.

Sounds great! How do I get involved?

  • Download Pugs and start playing with the new Perl 6 syntax. You will find information about the Perl 6 language in specification form in the Synopses. Examples of Perl 6 can be found in the examples directory in the Pugs subversion repository. Although Pugs is coded in Haskell the is also room for contributions from people who know Perl 5, C or Javascript.
  • If you have interest and/or knowledge on software virtual machines you may want to take a look at Parrot


Topaz (2000)

In early 2000, Chip Salzenburg began project Topaz, a rewrite of Perl 5 using C++ for the interpreter, with the intent that this would eventually be called Perl 6 ([1]). However this project did not become official because before it got Larry Wall's approval, other movements were afoot...

"We are fucked" (2000)

By mid 2000, despite Topaz, Perl development and its community had all but stalled:

  • It had become very hard to make changes to the source code without breaking the current features.
  • The biggest feature at the time was POE and that was a year old [2].
  • Clashes between developers on the perl5 porters email list had lead to the departure of several core developers.

Various perl developers attended a planning meeting at O'Reilly's Open Source Conference in July 2001. Part way through the meeting Jon Orwant, editor at O'Reilly, walked over to the coffee table, picked up a coffee cup and threw it against the wall and said:

"we are fucked unless we can come up with something that will excite the community, because everyone's getting bored and going off and doing other things".[3]

After much discussion between developers that were present at the meeting it was decided that a complete rewrite was what was desired. Consequently at the conference Larry Wall announced the start of work on Perl 6, a complete rewrite of the language.

RFCs (2000)

[NB. RFCs are of primarily historical interest only. Don't read them to learn Perl 6.]

In the fall of 2000, the community submitted suggestions for the new revision of the language in the form of request for comments (RFCs). In total 361 RFCs were submitted. An index of RFCs is available.

Apocalypses and Exegeses (2001 - 2004)

[NB. Apocalypses and Exegeses are no longer reliable sources for the current Perl 6 design. Please read Synopses (see below) first, and rely on their contents rather than that of the Apocalypses and Exegeses.]

During the period 2001 thru 2004, Larry wrote Apocalypses 1-7, and 12, corresponding to Camel Book chapters of the same numbers, that revealed the bulk of the Perl 6 design. ("An Apocalypse is supposed to reveal good news to good people. (And if it also happens to reveal bad news to bad people, so be it. Just don't be bad.)".)

During the same period, to help mere mortals understand the dense Apocalypses, Damian Conway wrote a series of Exegeses ("exegesis: n. an interpretation and explanation of a text, esp. Holy Writ ... These articles will take each unveiled piece of the design for Perl 6 and demonstrate the new syntax and semantics in an annotated program.").

Synopses (2004 - present)

[NB. Synopses are continually updated as design details evolve.]

The current design documents are the series of Synopses.

Preview and Testing Perl 6 features in Perl 5

Some of the features that were proposed for inclusion in the Perl 6 language were implemented as modules in Perl 5. A significant number of these modules were implemented by Dr Damian Conway, a prominent member of the Perl 6 design team, who has travelled to numerous conferences to give talks on Perl 6.

As at 19-02-2006 these are:

Current Work: Implementation of Perl 6

Parrot: The Perl6 Virtual Machine

Parrot is a register based virtual machine. It is to Perl 6 what the Java Virtual Machine is to Java and the Common Language Runtime is for .Net languages. Parrot, however, is designed especially for dynamic languages such as Perl 6. It also could be used for other dynamic languages such as Python. The advantage of having a virtual machine is that it bundles off all of the stuff that is platform dependent into a separate package. It also allows the emulation of features that are missing on some platforms on which the high level, dynamic language needs to run. For further information see the Parrot page.

Pugs: The Perl6 Users Golf System

Pugs is a parser and runtime. The project to create Pugs was initiated by Audrey Tang as an exercise while she was reading "Types and Programming Languages". It is a prototype and development is optimised for fun. Pugs can already be used to run Perl 6 scripts. For more information see the Pugs page.

PGE: Perl6 Grammar Engine


See Also

External Links

  • Pugs — Also includes slides from talks by Audrey
  • german Turorial in the german Perl-Community Wiki


Wikis where multi-article Perl 6 content can be found/placed.

Books on Perl 6

Personal tools