To quote from the original article, "The first thing people will tell you is that Perl is hard: hard to learn, hard to use, hard to understand. Since Perl is so powerful, the logic goes, it must be difficult, right?" The answer was: wrong, and since Perl 6 despite some of the rants (possibly reported rather than) stated in the thread mentioned in the intro, will still very much be Perl, it will continue to hold. The question is very clearly settled down by $Larry's interventions there:
Of course he explains better than I ever could some important points the most relevant of which to the current discussion are:
What could be easier, more naive and intuitive?say "hello, world";
To illustrate the latter point, one should not forget that Perl has a philosophy, but also that at the same time the fact that it is driven by pragmatics and not vice versa can make it transparent and digestible step by step. Similarly Perl 6 will sport very refined and conceptually intricate features possibly inspired by other languages or created anew, but they won't go in the way of the "casual programmer", whatever such a beast could be, as is cleary shown by another quote of $Larry's:
This being Perl, we will not tell people that they're using a thread continuation monad, because that would be scary. Something like "thread control objects" sounds much friendlier. Perl is all about letting people think they know what's going on until they really need to know what's going on.
Implicitly, we've touched upon the points that the author of the original article more strongly stresses, which are:
As far as the first point is concerned, in Perl 6 there will clearly be even more WTDI both in terms of single statements and of overall logic, so if the argument held, it will hold even more.
As for the second point, Perl 6 will borrow from even more languages. Again, the added features won't be forced upon the user. Two relevant examples that spring to my mind are argument passing to subs and the given statement.
Let's get it straight: Perl 5's argument passing into subs is fascinating. Fascinating in terms of how much you can get out of such a simple scheme. Yet, Perl 6 will allow you to pass parameters in a more intuitive way with any degree of sofistication, i.e. specifying their type or not. It's all up to you and how expressive you want to be.
In particular in a clpmisc discussion I pointed out that
Since I mentioned Perl 6 above, in it eventually we will have more convenient ways and less ambiguity in passing parameters. We will still be able to use @_ & C. but who does really need them when you can do
sub addprint ($n,$m) { say $n+$m } # ?
To this, Abigail, who is known to be a Perl 6 non-enthusiast, answered:
And this is an advantage? Limiting yourself to two arguments?
In Perl5, you aren't tempted to use named variables, so you get your arguments in an array. And given an array, it's natural to allow a variable number of arguments:
sub addprint {my $sum = 0; $sum += $_ for @_; print $sum, "\n"}
The counter argument, gently brought by "David Formosa (aka ? the Platypus)" is that you can still do:
sub addprint (*@num) { say [+] @num };
Even more importantly: this syntax is useful if you wanted to single out some other parameter, but then if you don't need that, you're not loosing good old faithful @_ altogether - there's still place for useful pronouns:
sub addprint {say [+] @_}
Now, does Perl 6 appear to be hard?
On to given which is Perl 6's switch statement, a beast not really existing in Perl 5 and likely to be very used in the former. For one thing it will be familiar to people coming from languages which have one. But there's one minor flaw in current Perl's borrowing from other languages: it borrows too literally. So people coming from e.g. C like to use C-style for loops. And similarly for other constructs. For all these people speaking baby Perl experienced programmers will always repeat to learn the more proper Perlish slang instead. Which however annoying in the beginning is very useful in the long run on letting one along his or her learning way. Now, Perl 6 makes this process even more robust by renaming that particular for loop to something different altogether, namely loop, so that its semantics is still there for when one could really need it. But at the same time it will make it easier for the same person to meat early what that in most cases will be the preferred and most useful kind of loop. Having chosen C<given> instead of C<switch> keeps in line with this philosophy and will also make clear the reach of the new construct by underlining its naturality with keywords chosen in accordance with the ubiquitous prevasiveness of natural languages principles in Perl.
Since we've touched upon loops, it is worth reminding that while Perl 5 is not hard, some elements of it can be confusing, a very common one being the
my %loops = (while => 'handles', for => 'lists');
kinda situation. But in Perl 6 both the following constructs will be exactly on the same par:
for =$fh { ... } for @array { ... }
Now that's great news to me. (Although it's not news, really.) But this is just an example of a whole new approach that brings further what's already been done with current Perl. To sum up: Perl 6 is a much bigger, possibly more complex, hopefully more powerful language than Perl 5. But all the added structure comes in an orthogonal and consistent way - and that's its magic, the main difference with previous releases being in fact that in those the magic was somewhat ad hoc, here it becomes structural. And people should recognize regularities at a glance, thus also perceiving the magic with them. So I'm sure one can boldly say that Perl 6 is not hard.
|
|---|