What is Perl 6?
chromatic writes "Perl.com has a new article entitled What is Perl 6?. It analyzes the changes to the language in light of the good and bad points of Perl 5 and provides new information about the current state of the project: Perl 6 exists, you can write code in it today, and it's more consistent and easier to use than Perl 5."
You can never be told what Perl is.
You just have to see it for yourself.
sorry, i just had to.
An old-timer with old-timey ideas.
Baby don't hurt me,
Don't hurt me
No more
That's the thing, though. PHP is the big name (from management's perspective), at least in the P category of LAMP, right now. Not that Perl's gone away by any stretch of the imagination, but the existing Perl shops are happy to keep on doing what they're doing, while the PHP advocates crow about how many new jobs are being done in their language.
So is Perl 6 going to bring about a Perl revival, or is it (as I suspect) going to fall flat when faced with Perl 5's quietly entrenched support and PHP's proclaimed grip on new uptakers? TFA mentions the reasons for cutting backwards compatibility (or at least reducing its priority) far too often for me to be optimistic there.
I think Perl 6 will catch on, eventually... but it's going to be more of an alternative language, not an upgrade, to Perl 5 for a long time yet.
I never really understood Data Structures until I learned Perl. I was consistently and thoroughly confused in my DS class. The language used there was C++. There was simply too much baggage in the language that obfuscated the very points we were being taught. If you can't get past the template syntax, how in the world are you going to be able to understand the data structure concepts?
Then I met Perl (5.003). What a difference it made! The data structures were built in, and on top of that, it was EASY to nest structures to build complex data types. It was like having a semester of Data Structures immediately made clear.
Then I found myself back with C++ again. First I wrote my own List classes. However I soon realized that STL made available exactly the types of data structures that Perl has. Maps, Lists, Vectors. And since I understood what I was doing in Perl, it was so much easier to catch on with C++.
Perl taught me C++. Who would have thought?
I can't define it, but I know it when I see it.
Rob
What makes Perl strong, in my opinion, is the community's interest in maintaining a large and well-tested library of useful code in CPAN. Without CPAN, it's not clear that Perl would be as alive and healthy as it is today.
What Perl 6 offers is a rejuvenation of the language. Perl 5 still works great (better than ever due to new efforts to stamp out even the most obscure bugs) but this new revision is attracting some *really* smart people who are bringing interesting new ideas to the language. Audrey Tang and Luke Palmer come to mind right away.
My greatest hope, however, is not that a revitalized Perl will squash the other dynamic languages (Python, Ruby, PHP, ECMAScript, etc) but will instead bring them into a state of interoperability. I really, really want Parrot to succeed so well that the other languages decide to target it as a backend so I can trivially call Python or C libraries from Perl and vice versa.
A.Two Kiwi oysters going at it.
From TFA:
Whipituptitude?!
That is awesome. Made up words a--
Whats this? Manipulexity?
How much awesome can you cram into a single sentence?
Three years ago, I could program in C, but had never used a scripting language (except bash, for very basic stuff). I needed to do some non-trivial manipulation of text files and figured that this was a good time to learn. Since others in the group were using perl, I tried perl.
I knew what I wanted to do, but needed to learn the language. I struggled with the awful syntax for three days. The breaking point came when I wanted a list of lists and realised that Perl "flattens" nested lists. How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]? In Python, it's trivial (that's how you'd write it), but in perl, nobody I talked to could give me an answer. It flattens it, unasked, to [1,2,3,4,5,6,7,8] and, try as I might, I can't see the point. (It turns out it's possible to have nested lists, but it's yet another example of perl's horrendous syntax).
Finally, I decided to give python a try. I spent an hour reading the python tutorial, and in another three hours, I had reimplemented everything I'd done in the last three days in perl, and an hour after that I'd finished the job. Python syntax was, and still is, the cleanest I've ever seen. It's an amazing language. And it changed the way I think about programming: it gave me an appreciation of functional methods (I now use ocaml a lot) and also changed the way I write C (vastly for the better).
That was it. No more perl for me.
People in the mid-1990s spoke of "overnight obsolescence", that Perl 6 would replace everything in a few weeks, and that you had better learn a new programming language every month. Over 10 years later, perl 6 is still in beta mode.
Hello.
We need 5 years experience Perl 6 programmers for 3D game. Reference: P6DNF.
-Woof woof woof!
The article talks about some of the defining features for perl. Well, one of the defining features in my perl experience has been Perl Data Language, pdl. PDL _is_ whipitupitude. Its a wonderful wonderful matrix library. And it comes with the best perl shell I know.
I had to break down a equation into a sequence of linear equations. So I hacked up some PDL in like 2 hours to do that. Couldn't have been easier, even though I'd never used PDL or its perldl perl shell; I just started typing in the interactive shell until it worked as expected and until I knew what I was doing. Then I needed the results in interger, so I rounded everything down, built a permuter and sorted the permuted results for each individual segment. That took three hours, but only because I kept botching the matrix multiplication. Even with huge datasets, generating hundreds of thousands of linear equations, each spanning dozens of datapoints, permuting the linear equations, sorting them and selecting the optimal, PDL would run it all my slow arse 800mhz crusoe laptop in seconds. Matlab couldnt touch it.
Thats the other really truly thing about PDL; the performance. If someone else would chime in and do it better justice, but my crude understanding is that it generates some kind of extremely optimized machine code on first use and runs whatever equations you've thrown at it like silk from that point on.
Little late and a little off topic, but PDL really is just a masterpiece of perl hackability. The PDL perl shell is truly spectacular; get some symbolic integrators and differential equation solving packages in there and I wouldn't need to break open Mathematica or Matlab ever again. Ok, long way away, pdl is really just about matricies, but it is really really sweet, and its shell is good for anyone who just wants to try something out really quickly in fully interactive perl.
That being said, I really cant wait to see where the perl6 VM is going.
G'night!
Myren
Here http://www.pugscode.org/ is something on the PUGS project, which is making an implementation of Perl 6 in Haskell, conformant to the spec.
Apparently they are having a lot of fun.
http://www.thebricktestament.com/the_law/when_to_
If the release of Perl 5 was any indication, Perl 6 is the single magic bullet that will kill all of my (Perl) code.
.NET.
Perl 6 may be more akin to a divine programming language, which makes the implimentation of complex data structures simple and sublime. Then again, it could all be a nasty trick to lead us away from the true path of enlightenment.
Perl 6 is not
Perl 6 is not controlled by any major corporation; I haven't decided whether this is advantageous or not yet.
If I were to have a child, would it be written in Perl 6?
Can Perl 6 be used to unlock the secret mysteries of the Bible code to reveal the end times?
Is Perl 6 really being developed by the descendants of Jesus Christ? Is the Pope trying to cover it up? Does the Pope know what Perl is? If so, is using Perl 5 a sin? How about Perl 6?
I bought a preview book on Perl 6 a few years ago. Is it still useful? Can I have my money back?
If Ruby was an upgrade to Perl, and Perl 6 is a an upgrade to Perl and Ruby, will Ruby need to changes their name in such a way as to play off of Ruby Tuesdays?
If I enter the Perl 6, can I change my mind later?
If Perl 6 is brillian, but no one uses it, is it still brilliant? What if it's awful and everyone uses it?
So very tired....
But if you need to do a longer project, pick up Programming Perl and read it (from front to end). Without that book, Perl can just be extremely weird, after reading the book it at least makes sense in its own world, no matter how unconnected that world seems to be to the rest of the universe :-)
I believe posters are recognized by their sig. So I made one.
Ok, Perl6 does indeed look cool. Lots of interesting things there. Sure, you can apparently write Perl6 code today and run it on PUGS (a Haskell implementation of Perl 6; that's gotta be speedy, eh?). But as is mentioned in the article, Perl6 was announced at OSCON 2000; that's 5.5 years ago. It's now become the posterchild for vaporware in the open source world, hence this article to keep the faithful hopeful (and to keep'em from sneaking off to Ruby, Python or even Io). Really, it just looks like the purpose of the article is to say "yes, we're still here working on Perl 6. We're working hard, we really are. Please, don't lose hope. This is hard work. It'll be here one day and it'll be great", while a lot of Perl folks who yearned for something better have already moved on to Ruby or Python.
I really hope that Perl 6 arrives one day. I'm pretty deep into using Ruby these days having left Perl 5 behind long ago (the part of the article about what's wrong with Perl 5 was really superfluous; maybe it was intended to convince the remainingn Perl folks who are happy with 5 to check out 6), but I'll give Perl 6 a look when it arrives. The grammar support alone looks pretty awesome; it'd be great to have a viable lex/yacc alternative. In the meantime I want to learn some languages that have a bit more immediate promise like Io. It seems that maybe the plans for Perl 6 were just too ambitious. Yes, it's great to start with a clean slate and try to revolutionize, but often it's evolution that wins out.
I like the use of "." for concatenation
"+" as an operator sugguests that the order of the items being operated on has no effect on the answer...
eg. 2 + 3 == 3 + 2
but
"two" + "three" != "three" + "two"
* In TFA1: whipituptitude
* In TFA2 referenced from TFA1: whipuptitude
With Perl, there is always more than one way to spell it.
Being bitter is drinking poison and hoping someone else will die
"sugguests that the order of the items being operated on has no effect on the answer..."
And a dot suggests a decimal point. Plus or double bar are used as concat
almost everywhere else. Using a dot was not very logical. But I guess that
follows the general philosphy of perl syntax anyway.
Not just another virtual machine nobody needs. Perl6 is also a consequent implentation of language development paradigms. Java started some of it with its so called "platform independent" VM. Microsoft jumped on that train with DotNet and its intermediate language for the CRL. Perl6 bundles those ideas together, gets rid of hierarchy constraints inherited from the old OO drafts, and adds complete costumizability to syntax and grammar while trying to keep the number of built-in functions as small as possible.
No other language does make it so easy by now to adapt the language itself to the needs of the special environment. You could for example write a module that forces strict inheritance to all of your objects, or implicitly puts all variables and values into a protected memory range, or dump your current program state onto a disk, everything within the blink of an eye.
Other implementations of introspection, like Java's Reflection API, provide the needed self-awareness of the code and the means for dynamic object handling up to some point, but that point reached, things tend to get rather ugly. Perl5 provided some "dirty hacks" for a part of that, but couldn't cover everything without breaking compatibility and, most of all, performance.
Still Perl6 won't be the sole answer to every question - as allways TMTOWTDI. But it's certainly interesting enough to keep an eye on it.
Perl 6 reminds me of the super-revamped, object-oriented COBOL that came out in the 90s -- by the time this perfect language was created (and it was a decent upgrade, although the OO stuff was so verbose it wasn't funny), COBOL 85 had such a huge installed base that COBOL 9x was irrelevant. The amount of code written to the COBOL 85 standard was immense, and most new development had moved on to other languages. Maybe Perl 6 can escape the Fortran 9x and COBOL 9x trap of being really great languages about a decade too late. The biggest hurdle Perl 6 is going to face is its own installed base. It will have to be 100% compatible with Perl 5 to get people with a code base of Perl 5 code to even think about using it. Plus, it needs to have a compelling story to tell. I was excited about Perl 6 five or six years ago.
Whenever I hear people saying things like this I think that they really lack visibility or understanding into the language's design process. Granted, the coming-to-life of Perl 6 hasn't been the quickest miracle we've seen, but I'm a hundred thousand percent positive that its being done in the best possible manner.
Think about it. Larry Wall accepted numerous RFCs from programmers of all walks, discussing Perl's problems / desires for new features / suggestions for new implementations / ideas how to change the syntax. He commented on each one, indicating whether (1) he agreed with the problem, (2) whether he agreed with the solution, (3) what, if anything, he thought should be done about it.
In the mean time, a radically new language glue system is introduced - Parrot. Perl had such wild success with XS - granted, Parrot isn't just about making language A talk to language B, but it's certainly an example of natural evolution.
As for Pugs, it's been fantastic. It's allowed lots of people to write real and working Perl 6 code (including lots of tests) to evaluate all aspects of the Perl 6 design before it goes into production.
Now, I'm not addressing you directly with this last part; rather, a greater community of Slashdot trolls. If you don't feel like Perl is for you, or if you feel like Perl is no longer for you, fine. Find your way to Ruby, Python, Java or whatever floats your boat.
But please, it's getting really goddamned irritating to have to sift through the comments of a handful of armchair morons that sit at home, interfacing with something called "comments.pl", eating doritos and talking about how the greater Perl community should just drop everything and go to language X, or repeating a tired meme about how the language is making no progress at all (when all they need to do to see the massive progress is read Audrey Tang's blog or visit pugscode.org). And then, there are some mods that feel it appropriate to mark clueless jabs as "insightful".
I am thankful of one thing - Perl's momentum. While everyone else is barking about how (name my scripting language) is great this week for doing web pages or some nonsense, there is still a huge community of devoted, bleeding edge language researchers and smart people, chisel in hand, forming Perl 6 from the rocks.
And while the naysayers are switching languages once a week as they make incremental advantages over eachother -- while they're totally clueless that so many of the 'advancements' in their own languages over the years have been 'borrowed' from or 'inspired' by perl, the aforementioned language scientists are preparing to do once again what Larry Wall did, intentionally or not, when he released Perl on the world - bring about a revolution.
Because in Perl
"1"."2" eq "12"
and
1 + 2 == 3
If a loosely typed language is using + for concatenation, it's poorly designed (you'd end up typing more to specify what you want done).
You need to know that the concatenation of two variables is not the same as adding them together.
Slightly relieved that Perl 6 switched from using underscore to tilde for concat - underscore is overloaded with so many other tasks already. Unfortunately ~ still requires shift to be pressed on my keyboards, but I guess they are running out of symbols, and at least I think ~ won't require you to keep putting spaces around it to disambiguate it from other meanings.