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 - Common Criticisms

From PerlNet

Jump to: navigation, search



Perl 6 has been criticised by various authors as being both too complex and unnecessary. There have also been complaints about minor details such as operator selection and whitespace choices. This article attempts to discuss some of these criticisms.

The Criticisms

The Apocalypses and Exegeses are too hard to understand

In the beginning, Larry Wall worked through the Perl community's RFCs and wrote the Apolcalypses. These were very complex documents created mainly as a brain-dump for the language creators' later reference. The Exegeses were Damian Conway's user documentation based on the Apocalypses. Both sets of these documents are now kept for historical purposes with another set of documents - the Synopses being kept up to date.

Perl 6 is being documented as it is written, with the Official Perl 6 Documentation easily accessible to everyone.

Perl 6 will break compatibility with Perl 5

Perl 6 code will indeed no longer be backwards-compatible with Perl 5. This is part of the redesign of the language that aims to make it more consistent and powerful, due to the fact Perl has evolved from Perl 1 to Perl 5 (and through the Perl 5 series). However, it is planned that a Perl 6 compiler will default to running Perl 5 code until it encounters the "use v6;" line, which will instruct it to start executing Perl 6 code. Furthermore, it will be possible to use Perl 5 modules from within Perl 6; so the CPAN will remain the essential tool that it is.

The PONIE project (now stalled) is working to provide a native Perl 5 engine for Perl 6. In addition, there is a plan to write a Perl 5 to Perl 6 code translator.

Perl 6 will be too different from Perl 5

It is not uncommon to hear common criticisms against the fact that Perl 6 will be far too different from Perl 5. "Perl 6 is going to be a very nice language. Too bad it's not going to be Perl." (to paraphrase on what was said about Fortran '90).

One cannot disagree that Perl 6 is a very different language from Perl 5. However, Perl 6 stills share many similarities with Perl 5, such as most of the operators, functions and conventions. The difference between Perl 5 and Perl 6 are there for a reason - to improve the consistency and power of the language.

Perl 6 is too complex

Perl 5 is more than 10 years old, and Perl itself is more than 20! Perl 6 is being designed to be a good solution for 20 to 30 years. As such, new and innovative features are being added to the language; such as hyperoperators, junctions and a new and improved object oriented system. Yet most of the changes are being designed to make the language easier and more intuitive. For example, many new programmers mix up the sigil changes when looking up items in arrays and hashes; so these won't change anymore. Other programmers try to treat references like arrays (or hashes) for lookups - so Perl 6 will now allow this.

Finally if a programmer finds some of Perl 6's features too hard to use, they can still choose to write Perl 5 code, or just not use those features.

Perl 6 is unnecessary (Perl 5 is enough)

The Perl 5 code base is large and unwieldy. Although much of the work for Perl 5.8 (and the planned 5.10) has resulted in massive improvements to that code base, full backwards compatibility has always come before language improvements. As a result, many desired improvements are effectively impossible.

A full engine re-write, while maintaining meticulous backwards compatibility, is unlikely to solve many of the existing problems. Perl 5's subroutines are slower than they should be (due to creating and populating @_, setting up lvalues etc) while using Perl's object oriented features is even slower. Multiple-method dispatch requires extra work on the programmers behalf to the point where most programmers don't use it. Furthermore, the Perl 5 syntax is a big problem - we can't tell whether a file contains a valid Perl program until we run it.

Perl 6 frees its designers from the problems that the backwards compability has forced on Perl 5, and allows the creation of a new object system, methods with named arguments (which most other programming languages already have) and much more. With the new grammar system it should be easy to tweak individual programs without source filters and write both code generators and write Perl parses which don't need to evaluate code.

The core Perl 6 language is too large

Perl 6 does have a few more operators than Perl 5, but this doesn't necessarily make the language harder to learn. Most programmers do not base their decision to learn a language on how large the language is. Instead such decisions are based on curiousity or need. The best way to learn a language is by using it.

Perl 6 Has Been Taking Too Long. Isn't it the Second System Effect?

The second system effect is when computer programmers designing the successor to a elegant and successful system become too ambitious and design something that is both over-kill and unimplementable.

While Perl 6 isn't ready for production, it is possible for people to start programming in it via Pugs. Further, many of the Perl 6 features have been back-ported to Perl 5 via the Perl6:: module name space, and the planned 5.10 release. Although there's still no official release date (it's a volunteer project after all), Perl 6 is improving daily.

See Also

Personal tools