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 Users FAQ

From PerlNet

Jump to: navigation, search

Contents

Latest Perl 6 developments

Some important developments to watch:

  • PITA - The Perl Image Testing Architecture (http://ali.as/pita/).
  • Darren Duncan's work on a Perl 6 Relation type (as in relational algebra and data structures).

About perl.perl6.users (and this FAQ)

(Newbie warning! Perl 6 is still UNDER CONSTRUCTION. Don't make critical plans that depend on it just yet. Please see other sections below about intermediate Perl 6-related solutions you can use now.)

perl.perl6.users is a *mailing list* that is also available by nntp.

A major aim of the mailing list is to help out early-adopters of Perl 6 (including early learners and early test drivers). It is a forum for seeking and sharing the latest general news and information about using (versus creating) Perl 6. (Presently, the other Perl 6 mailing lists are primarily for developers of Perl 6, versus for Perl 6 developers.) However, the time for sharing the -Ofun more widely has arrived. Some enterprising folks are already using pieces of the emerging Perl 6 infrastructure for $work. Parts of Perl 6 are being implemented in Perl 5 (some internally, some as modules). Wider experimentation with Perl 6 will help test out the emerging collection of docs, and help determine practical priorities for improvements.

After years of seemingly glacial but important preliminary work in 2000-2004, there has been a gathering avalanche of Perl 6 development work since early 2005. Over-optimism is now in danger of replacing over-pessimism, so we're strictly limiting ourselves to mere wild enthusiasm here (strictly for -Ofun++, of course).

Suggested additional content and corrections for this FAQ are always welcome. It's a wiki, please be bold and make your changes!

Think of this mailing list as the prototype for the future comp.lang.perl6.<something> newsgroup. When traffic warrants it, we'll apply for official Usenet "big 8" comp.* status.

You can access the mailing list (perl.perl6.users) in several ways:


About Perl 6

What is Perl 6? Perl 6 is an extensively refactored, super-modernized, and ultra-supercharged derivative of Perl 5. Simple things will still be simple to do, but you'll have enormously more "programming leverage" available for tackling challenging tasks. Chromatic has written a good introductory article on why Perl 6 is needed, and what it is. Also see Juerd's Refuting Perl6 Myths.

As a correction to Juerd's slides, Perl 5.10 will have many Perl 6 features you can start using. These will be in feature.pm which is currently part of the Perl 5.9 developer branch.

Notable Perl 6 features

When it comes to embracing "embrace and extend", Perl 6 is exceptionally promiscuous in selectively borrowing from other languages (and Perl 6 is very tenacious about refining and generalizing their best ideas). Here is a brief summary of some notable Perl 6 features, starting from the list in the FAQ, plus a variety of additions and extensions:

  • optional explicit strong typing
  • proper parameter lists
  • active metadata on values, variables, subroutines, and types
  • declarative classes with strong encapsulation
  • full OO exception handling
  • support for the concurrent use of multiple versions of a module
  • extensive and powerful introspection facilities (including of POD)
  • LL and LR grammars (including a built-in grammar for Perl 6 itself)
  • subroutine overloading
  • multiple dispatch (multimethods)
  • named arguments
  • a built-in switch statement
  • hierarchical construction and destruction
  • distributive method dispatch
  • method delegation
  • named regexes
  • overlapping and exhaustive regex matches within a string
  • named captures
  • parse-tree pruning
  • incremental regex matching against input streams
  • macros (that are implemented in Perl itself)
  • full Unicode processing support
  • user-definable operators (from the full Unicode set)
  • chained comparisons
  • a universally accessible aliasing mechanism
  • lexical exporting (via a cleaner, declarative syntax)
  • multimorphic equality tests
  • state variables
  • hypothetical variables
  • hyperoperators (i.e. vector processing)
  • function currying
  • junctions (i.e. superpositional values, subroutines, and types)
  • coroutines
  • better threading
  • better garbage collection
  • much better foreign function interface (cross-language support)
  • invariant sigils, plus twigils (minimalist symbolic "Hungarian")
  • many widely useful objects/types
  • lazy evaluation (including virtual infinite lists)

Holy freaking cow! How can most mere-mortals contend with all this stuff? Well, the good news is that you most likely won't ever need to know (or use) much of this stuff. You can learn and use a moderate and comfortable subset of Perl 6 that meets your typical needs. However these features provide an extremely powerful toolkit for experts to produce modules and other tools that you can use (without you needing to know about their internal wiring and plumbing). Perhaps counterintuitively, many of these features will make Perl 6 substantially easier and simpler than Perl 5 for more advanced applications (once you get used to it). Many of these features will also help "future-proof" Perl 6 by providing many means of incorporating new extensions.

As you can see, Perl 6 thus takes the powerful evolutionary advantages of "hybrid vigor" to new extremes. First there was "extreme programming", now we have Perl 6, "the first extreme programming language". If you think our many friends, including {Ruby, Python, Smalltalk, Lisp, Haskell, and others}, are generally more {cool, powerful, productive, and fun} than {C, C++, Java, C#}, then you'll likely recognize Perl 6 as the new "top of the tool chain" for practical high-powered fun.

Big picture, executive-level overview

OK, so given that semi-awesome tapestry of features, what's the "big picture", executive-level overview from 35,000 feet look like?

First of all, think of Perl 6 as the heart of (what will be) the vastly larger software super-system of C6PAN (which will subsume Perl 5’s CPAN, an already large and powerful collection of Perl 5 modules). Likewise, think of Perl 6 as including the Parrot virtual machine (which will also support other allied programming languages, and mutually shared libraries between them), plus whatever other backends are eventually supported (Javascript 2 aka ECMAScript Edition 4 is intriguing).

For convenience, we'll use "Perl 6++" to mean this larger "Perl 6 + C6PAN + Parrot" super-system (and whatever cohorts become affiliated with it).

Perl 6++ roles

So what roles do these integrated capabilities ultimately position Perl 6++ for? Here are some slightly speculative (but hopefully self- fulfilling) prophecies (using an "odds-meter" likelihood threshold of 50%-50%):

  • Perl 6++ is going to be the counterpart of world English (which exceeds all other languages in importing new concepts).
  • Perl 6++ is going to be the software world’s first counterpart of the Great Library of Alexandra. CPAN was a valuable first baby step towards this development.)
  • Perl 6++ is going to be the first mainstream-strength super-morphic programming system. (Extremely important!)
  • Perl 6++ will carry us to the age of kilo-core, mega-thread, 100 GHz, tera-byte microprocessors and the trillion+ node Internet.
  • Perl 6++ is thus going to be the principal collaborative software system of super-natural human intelligence. ("Real AI" is still a long way off, but the spectacular human cognitive revolution is still in its early infancy.)

Perl 6++ summary

In summary, Perl 6++ is going to be a major cornerstone and leading catalyst of a "Software Renaissance", and as such, Perl 6++ will become the "software launch pad" of the (so-called) "Singularity Age". (By that time, however, Perl 6++ will have evolved into Perl 7++. Perl 6++ will make the development of its eventual inevitable successor very much easier, and it will likewise help strongly accelerate the advance of other existing and new languages as well.)

Whatever the next "world's greatest programming system" happens to be (after Perl 6++, that is), it's very likely that Perl 6++ will play predominant roles in prototyping it, launching it, and providing it the competitive advantage of under-the-covers access to C6PAN.

Because of this, I suspect the winner of the next round of competitive programming system evolution will probably be designated Perl 7++ by acclimation, even if it's not a @Larry project.

General Perl 6 status

Our overview of Perl 6 status begins with a release history sample for the 2 most critical components, Pugs (compiler) and Parrot (VM). A lot of foundation-building has been going on, and visible progress has dramatically increased from 2005 onwards, so we have concentrated on more recent data points (through early 2005).

See the Perl 6 announce list for the very latest (major) release announcements.

The major/minor version numbers of Pugs converges to 2*pi. (That's 360 degrees -- the circumference of a unit-radius circle -- expressed in radians.) Each significant digit in the minor version represents a milestone. The third digit is incremented for each release. The current milestones are (with some interspersed releases):

Release Content Date
Pugs 6.0 Initial release.
Pugs 6.0.0 "Day 6 of Pugs" Released 01/07/2005
Pugs 6.2 Basic IO and control flow elements; mutable variables; assignment.
Pugs 6.2.0 Released 04/13/2005
Pugs 6.2.10 Released 10/09/2005
Pugs 6.2.11 Released 02/01/2006
Pugs 6.2.12 Released 04/07/2006
Pugs 6.2.13 Released 17/10/2006
Pugs 6.28 Classes and traits.
Pugs 6.28.0 Almost here....
Pugs 6.283 Rules and Grammars
Pugs 6.2831 Type system and linking.
Pugs 6.28318 Macros.
Pugs 6.283185 Port Pugs to Perl 6, if needed.

Parrot follows a more conventional version number scheme (note that dates are represented as mm/dd/yyyy):

Release Release name Date
Parrot 0.0.1 Released 09/10/2001
Parrot 0.0.10 Released 03/18/2003
Parrot 0.1.0 Released 02/29/2004
Parrot 0.2.0 "NLnet" Released 05/08/2005
Parrot 0.3.1 "Wart" Released 10/06/2005
Parrot 0.4.2 "GPW" Released 02/22/2006
Parrot 0.4.3 "Cold Conure" Released 04/02/2006
Parrot 0.4.4 "Feather" Released 05/14/2006
Parrot 0.4.5 Released 06/19/2006
Parrot 0.4.6 Released 08/08/2006
Parrot 0.4.7 "Caique" Released 11/14/2006
Parrot 0.4.8 "Eponymous" Released 01/17/2007
Parrot 0.4.9 "Socorro" Released 02/22/2007
Parrot 0.4.10 "The Release Formerly Known as "Prince"." Released 03/21/2007
Parrot 0.4.11 "Tax Bird." Released 04/17/2007
Parrot 0.4.12 Almost here...
Parrot 0.5.0


Design

The major language domains are fairly complete, but many {corner, borderline} cases are still {incompletely, tentatively} specified.

Documentation

(See later section for current doc links.)

  • The on-line docs are undergoing tremendous improvement.
  • No up-to-date Perl 6 books at the moment.
  • Part of motivation for creating perl.perl6.users mailing list and FAQ is to help with interim user documentation (including generating useful archives for point-of-departure searching).

Implementation

Front ends

  • Perl 6: Pugs
  • Perl 5 to Perl 5 (to Perl 6) translator

Middleware

To be completed

Back ends

  • Parrot (from Pugs)
  • Javascript (from Pugs)
  • Haskell runtime (from Pugs)
  • Perl5
  • Bridgeware (Perl 5 <==> Perl 6)
  • Ponie: This is an important missing piece to make Perl 5 and CPAN run on Parrot. (Big corporate support for this project would be great.)
  • Perl5 modules for Perl 6 features.

Performance

Very slow at present , but it's getting better and is already good enough for serious experimenting.

When will Perl 6 be ready?

So when will Perl 6 be ready? The official answer is "When it's done"; the official policy is that a formal schedule would be a counterproductive diversion. Some *wild* milestone guesses are:

  • "early alpha something" by Christmas 2006
  • "first production beta" in summer 2007
  • "first production release" by New Year's Eve 2007

Where to get Perl 6

Win32 binary builds of Pugs and Parrot (easiest way to get started):

Pugs: (http://www.pugscode.org/)

Parrot home page: (http://www.parrotcode.org/)

FYI: Perl development server: (http://feather.perl6.nl/).

Perl 6 info and docs

Note on mirroring: Since this FAQ is oriented towards Perl 6 users, we mostly use perl.org links instead of openfoundry.org links:

How to get started running Perl 6

Most of the information on getting started can be found on the getting started page. You may also find the following links useful:

Perl 6 language specification

This is the latest official Perl 6 language specification. This is what Pugs is always converging towards:


Perl 6 code examples

Once you've had a chance to play with these examples, you may want to contribute your own examples and tests.

General Perl 6 documents and related info

There are lots of places to turn to for information on Perl 6.

General background articles on Perl 6

The O'Reilly Perl website sometimes has interesting articles about Perl 6.

Design influences

Planet Perl 6

Planet Perl Six is an aggregator of select Perl 6 related blogs. It includes weekly Perl6 summaries and weekly Perl 6 meeting minutes.

IRC channels

IRC channels (and their archives) are a major source of useful information. NOTE: Please don't unthinkingly interrupt and pester the developers of Perl 6 with questions that you can just as well ask on perl.perl6.users, which they and others can then later answer at their convenience. (As always, it's good manners to check Google and to check archival logs before posting questions.)

The primary IRC channel is #perl6 on http://freenode.net/ Daily logs are kept to allow you a chance to see what you've missed. Larry Wall often hangs out there with the nickname of "TimToady".

If you need an IRC client for Windows, try Chatzilla, a Firefox extension.

Some handy "#perl6"-isms

  ?eval <Perl 6 expression>   # Replays with evaluated expression.
  perlbot nopaste             # Use to paste blocks of text offline; it replies to IRC with URL to it.

Mailing lists

Perl 6 mailing lists, at (http://www.nntp.perl.org/group/) and Google Groups (http://groups.google.com/):

You can also get these by email; see (http://lists.cpan.org/showlist.cgi?name=perl6-internals) for details (and make appropriate substitutions on "-internals" for other groups).

Helping with the documentation

These links are about hacking on Perl 6 docs.

  • The evil plan This mentions many things you can do to help out with docs, although it is a bit dated.

Helping with the hacking

These links are about hacking on (versus hacking with) Perl 6.

Perl 5 modules implementing Perl 6 features

In Perl 5.9 (development branch) and Perl 5.10 (production release), feature.pm provides some Perl 6 features that you will be able to selectively turn on.

There are many modules that *currently* implement parts of Perl 6 in Perl 5. Go to CPAN and do a module search on perl6.

(Note: (http://search.cpan.org/modlist/Perl6) is missing many entries. Use the search above for the time being.)

Some of these are listed on the Perl 6 page.

Incremental migration from Perl 5 to Perl 6

<<To be completed.>>

Other useful resources

<<Creative and practical ($work) applications of existing pieces Perl 6 pieces (Parrot, Perl5 transition modules).>>

How you can help out with Perl 6

There is lots of useful Perl 6 support work that doesn't require you to be a lambda camel uber-hacker (or any other sort of wizard). There is a growing body of evolving docs that can use periodic proof-reading and cross-checking. There are lots more docs that need to be written. There are a wide range of Perl 6 tests that need to be written to more comprehensively check out interim versions of Perl 6, and thus help speed up its evolution into a production quality system. Look in docs section above for information on hacking Perl 6 docs.

Here's a specific suggestion. Watch the Perl 6 language mailing list and "#perl6" Perl 6 IRC channel and make sure that answers to questions about "How do I do <whatever> in Perl 6?" got turned into entries in the Perl 6 Cookbook.

Here's some related suggestions: Make sure that every Cookbook entry has an associated test (perhaps mutually cross-referenced). Mine Perl 6 feature tests for useful items to add to the Cookbook.

You could also help out with this FAQ. Simply use the 'edit' link at the top of this article, or at the start of each section.

There are lots of related projects that could be pursued. One important area is programming support. Perl 6 editing and refactoring support in OSS IDEs such as Eclipse and Netbeans would be very valuable. A Perl 6 semi-clone of Netbeans' Matisse GUI designer based on wxWidgets would be an awesome start for a Perl 6 IDE + RCP (rich client platform). (Like Parrot, this should be designed to make its advanced tools available to Ruby, Python, Tcl/Tk, Smalltalk, Lisp, Java, C/C++, Mono, and so on.) It should also have the basic foundation of a world-class programming editor + documentation word processor that (somehow!) takes the best ideas from GVIM (vi/vim + GUI), XEmacs (emacs + X11), Knuth's Tex and "Literary Programming", and Mathematica's notebooks, yet also include the now-"semi-universal" Windows editing control keys (^x, ^c, ^v, ^z, ^y, ^f, ^a, ^s, ^p, ^n), plus drag-and-drop editing. It should also support remote pair programming. And of course it should incorporate a {large, smart, and fine-grained} encyclopedic Perl 6 cookbook for rapid prototyping.


Glossary

CPAN is the "Comprehensive Perl Archive Network", which is a very large web-accessible library, predominantly filled with Perl 5 modules.

C6PAN is the virtual Perl 6 version of CPAN, which you can think of as the rapidly growing subset of CPAN consisting of Perl 6 language modules. However Perl 6 to Perl 5 bridges will eventually make all of CPAN look like C6PAN, and vice versa. C6PAN contains a growing collection of Perl 6 docs as well.

"@Larry" is the small team of Perl 6 language design wizards headed up by Larry Wall.

"-Ofun" is Audrey Tang's guiding "optimize for fun" policy philosophy for Pugs.

Parrot is a register-based virtual machine, which is designed to be good at hosting dynamic languages (Perl 6 in particular, but it also aims to easily and efficiently accommodate Ruby, Python, and so on). Parrot is intended to be a modern successor to the older stack-based JVM (Java) and CLR (C#, etc.) virtual machines. Parrot also aims to support cross-language module sharing.

Perl 5 and Perl 6 are names of programming language dialects, whereas "perl5" and "perl6" are the corresponding (installed) names of compilers used to run programs written in these languages.

#perl6 is the Perl 6 IRC channel.

PIL is "Pugs Intermediate Language".

PIR is "Parrot Intermediate Representation".

Pugs is a prototype Perl 6 compiler front end (among other things) that is written in Haskell.

RT (as in references to an "rt ticket") is "Request Tracker", the issue (including bug) tracking and reporting system used in Perl development.

SVN is "Subversion", multi-user patch merging source control system.

YAML is "Yet Another Markup Language". "YAML(tm) (rhymes with "camel") is a straightforward machine parsable data serialization format designed for human readability and interaction with scripting languages such as Perl and Python. YAML is optimized for data serialization, configuration settings, log files, Internet messaging and filtering."

Copyright, license, and disclosure

This FAQ copyrighted and licensed 2006 by Conrad Schneiker under the most currently prevailing Perl 6 (Pugs) copyright and license. (If other arrangements are needed, try Conrad.Schneiker [at] Gmail.com.)

Anti-OSS-FUD historical disclosure: The production and distribution of open source software (and documentation) is (1) a fundamental capitalist right of (mutually consenting) voluntary exchange that is (2) also a noble and honorable civic virtue that (3) constitutes a modern generalization of the various widespread {18th, 19th, and 20th} century networks of (the better) fraternal organizations of business people who (4) generously donated their time, effort, and money to (5) collaboratively further community welfare, and (6) thereby (indirectly, and over the longer run) their own mutual economic development.

References

This document was based upon the original Perl 6 Users FAQ located at http://www.athenalab.com/Perl_6_Users_FAQ.htm

See Also

Personal tools