|Do you know where your variables are?|
(Ovid) Re: Thoughts on Perl6 - Love it? Hate it?by Ovid (Cardinal)
|on Jan 10, 2002 at 20:45 UTC||Need Help??|
I know that a lot of people are nervous about Perl 6, but they shouldn't be. Yeah, there is talk about co-routines, curried functions and things like that, but that's going to make the language more powerful. Interestingly, even though many features are going to be added to the language, it's going to be even easier to use.
Some things I like:
The variable prefix notation will be based on the variable type and not on the access method:
Programmers routinely get those wrong when they're first starting with Perl. Now they'll get them right.
More compiler hints and optional strong typing! This is going to overcome one of the biggest objections to Perl!
While this has not been nailed down, the first example above hints to the compiler that you will mostly be using integers in the array, so the compiler will optimize for it. However, you can stick the occassional string in there.
The second example tells the compiler that there will only be integers in the array. This will likely throw an exception (maybe at runtime?)
How about lexically scoped subroutines? Now, you'll be able to have truly private methods and ensure that they are only called as methods. No more letting people call methods as subroutines and getting things screwed up.
Access to your caller's lexically scoped variables through a MY pseudo-namespace. While I'm not sure about this, it does mean that you'll be able to do exports to your caller's lexical scope without globals. Yay :)
Parrot will be separate from Perl and we should have the ability to program directly in it for runtime benefits. In fact, if the work on byte-code compilers comes to pass, we'll be able to write Java applets in Perl. Look out Java, here we come :)
There's a lot more, but that's all I can think of off the top of my head and I need to get to work. The only real downside I see to Perl 6 is that it likely won't be out until late 2003 or 2004 :(
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.