Perl's Extreme Makeover 408
PurdueGraphicsMan writes "There's an article over at Yahoo! about the upcoming version of Perl (version 6) and some of the new features (RFC list). From the article: "Although Perl 5's expressions are the most sophisticated available and aspired to by other programming languages, "no one pretends for a moment that they're anything but hideously ugly," said Damian Conway, a core Perl developer and associate professor at Monash University in Australia.""
Trolling, maybe (Score:2, Interesting)
We're all going to die (Score:5, Interesting)
Back to Pac Man and Vi then...
Ruby... (Score:1, Interesting)
Anyone who intimately knows 5 (Score:5, Interesting)
a) start learning 5 anyways
or
b) wait till 6 is released, because going from barely having a grasp on 5 and then trying to learn 6 would just confuse myself?
i realise that all the perl5 code in the world won't suddenly cease function the minute perl6 is released, but still..
I can see the value in perl, and what a great tool it is, but for some reason i have a hard time wrapping my lil brain around it. It's a bit less "structured" or "consistent" than say C is. I suppose it has to be that way in order to do what it does, though.
Perl6? Try Ruby... (Score:0, Interesting)
a madman. Or both.
I used to really like Perl, but these days I'm writing bigger and bigger
programs using interpreted languages. Perl is *really* getting on my nerves.
I'm not waiting for Perl 6, I'm writing all new code in Ruby (or Python if
Ruby doesn't have the needed 3rd-party libraries).
Ruby is what Perl *should've* been, and what Python will be in a couple more
versions (it got popular before they finished designing it, it seems).
I'm sure Perl 6 will be like getting a blow job from Larry Wall himself, but
I've had enough of Perl's community and their "cleverness". I want languages
that help me write programs, not that are good for writing haiku in.
However there are two things I"m looking forward to: 1) better regular
expression syntax
a common runtime between perl, python, and ruby, that way I can use all sorts
of libraries in my code, no matter what the language I happen to be using.
Why was Perl5 so Popular? (Score:5, Interesting)
Too many cooks (Score:4, Interesting)
I understand that Perl6 is supposedly an evolution of the language, but there are so many suggestions for so many features and changes that the language itself seems to suffer from the too many cooks problem. With everyone and their brother suggesting features, the language itself becomes a mish mash of these features without a central theme tying it all together. Even if you said that DWIM was the central theme, can you really justify that when WIM is not what the language does because the feature that I'm using was designed by someone who had a completely different idea of what he meant?
In the past Perl has added functionality that was useful and you can see where the language has its partitions. Base Perl (datatypes, simple arithmetic, simple string manipulation), nested datastructures, regexes, OO, and so on. While admittedly a mess, each addition to the language brought more power and ease. Perl6, OTOH, seems to be adding feature after feature without regard to whether it makes the language easier to use, only more powerful.
So you end up with a new interpreter that won't run your old scripts without modifying the scripts. At the very least it should automatically default to Perl5 syntax unless otherwise told to use Perl6 syntax. Unfortunately, in the push to evolve, Larry and Damian (and the rest of the lunatics) have foregone automatic backwards compatibility.
I'll probably migrate, but not for a while.
Hmmm (Score:5, Interesting)
Re:Anyone who intimately knows 5 (Score:5, Interesting)
Quite possibly very naive question from a non-perl (Score:5, Interesting)
Is Parrot something akin to the JVM /
If I'm reading all of this right Parrot may well become everything Sun wants Java to become / MS wants
Of course, if I have the wrong end of the stick here I apologise. Perl isn't my strong suit.
This parrot ain't dead (Score:2, Interesting)
I'm amused to see that the name 'Parrot', originally coined for an April Fool's joke [oreilly.com] over at O'Reilly, has now been used to christen the bytecode interpreter for Perl 6. Life imitating art I guess.
As for the 'extreme makeover' ... I hope it loses a bit of the excessive punctuation ...
Re:why rev a language ? (Score:5, Interesting)
I agree with the main topic that other languages aspired to its expressiveness. The problem, from the point of view of a Perl hacker like me, is that some of them have actually outdone it, primarily by creating similar power, expressiveness, and simplicity but without being so ugly *and* being OO. Ruby and Python are pretty much the motivators for the upgrade.
I hope they don't ruin a good thing (Score:1, Interesting)
these regular expressions were not "powerful enough for many data-parsing tasks
I will be the first to applaud Larry Wall and the Perl developers if they can clean up regex. However, I feel tinkering with a notoriously complex thing may make it worse. Or at best, may make more of an ugly thing. What we don't need is the new unreadable way and the old unreadable way of creating regexes. What fun it will be to debug code.
Frankly, how can you increase the power of regex and minimize the complexity of code. If you make regexes more powerful, you might as well make another high-level language for text processing. Let's hope they can pull it off.
Frankly, I for one like the power of Perl's regexes and I hope they succeed.
Re:No, Python (Score:3, Interesting)
I just like ruby more. I find it easier to learn, even faster to code in, and language development is just as fast, if not faster than python.
Re:A picture worth 1000 words (Score:4, Interesting)
Re:Why was Perl5 so Popular? (Score:2, Interesting)
I stick to Bash for most things involving text processing.
SNOBOL (Score:3, Interesting)
Spitbol could do things like:
funcof is then called with the newly assigned variable (pre_paren), and it's result is inserted as an expression to complete the match.
then whatever matched funcof(pre_paren) is replaced by the results of replacement(parenmatch)
skipto is a builtin, but funcof and replacement would have to be user-defined (and they can be defined on the fly).
Perl6 appears to have similar functionality, but (IMHO) I don't think it's going to be quite as nice as the SNOBOL syntax.
Unfortunately, I'm not good enough at compiler design to write my own spitbol interpreter, or I would.
The one problem with snobol is that it was created before the idea of structured programming came along, so it is goto-structured... (although somebody then came up with ratbol which was essentially a preprocessor to provide RATional structure to snoBOL)
Re:Expressions .. (Score:3, Interesting)
> So does a man standing next to, you holding a gun to your head, saying "INDENT THOSE BLOCKS!".
Certainly, but somehow Python doesn't make me feel quite as nervous.
Besides, there are too many availeability and cost issues with men-standing-next-to-you-holding-gun-to-your-head
whereas Python is 100% free, which I've found to be much more convenient.
Re:SNOBOL (Score:4, Interesting)
Oh, and just to keep on subject:
SNOBOL is considered to be the parent of unix regexpressions and awk which led to Perl. Unfortunately, the children inherited a much castrated version of snobol's string manipulation capabilities which have only now been reasonably addressed in perl6.
If nothing else, I suggest that people interested in the history of pattern matching take a good look at snobol.
Ever heard of comments? (Score:5, Interesting)
If you're looking at code *you wrote* for over an hour without understanding it, you only have yourself to blame. Unless you're coding in brainfuck [catseye.mb.ca], I suppose.
tch
cLive ;-)
Re:for the naysayers.. (Score:2, Interesting)
man awk
Re:Perl: The Beginning (Score:5, Interesting)
s/(.*?\s+)\(.*?\)/$1/g
Looks like an explosion in the ascii factory to me!
Performance (Score:3, Interesting)
Amen. I think this is because the interpreter / VM is usually optimised for the most obvious way of doing things. If you try and improve the performance of your code with tricks and shortcuts, you're basically trying to outsmart the Larry and the other internals hackers.
Re:Expressions .. (Score:3, Interesting)
Its called DISCIPLINE and its not that hard. Someone makes rules for the dev team and then they are followed and then your code is clean and readable. Why should the language force you to be disciplined? Good programmers know to program following some kind of standard.
And why does everyone bring up PHP? PHP is nothing but Perl with all the best parts taken out and everything thrown into the core language. PHP breaks all the rules of good disciplined programming. With Perl you can shoot yourself in the foot but at least the newbies stay away from it enough to keep the damage to a minimum, and it has controls such as 'strict' and Taint mode so you know when you are shooting yourself in the foot. PHP on the other hand gives the newbies a shot-gun and says 'point this at your head'. PHP coders that actually understand the basics of good programming are few and far between. And trust me there is more than one way to do things in PHP as I've been fixing the problems created by the former 'programmer' in my company for the last year.
Re:python & ruby are fine,but they lack {}'s a (Score:3, Interesting)
Here's an idea: get over it. It isn't that big of deal, and either choice is vastly more readable than perl.
Let the flames begin!
Re:quick question.... (Score:3, Interesting)
Re:No, Python (Score:2, Interesting)
Re:Expressions .. (Score:2, Interesting)
OO Perl? (Score:3, Interesting)
Re:Whew, backasswards compat-with Perl 5 (Score:3, Interesting)
But how does eval $string work in a runtime with no compiler?
Re:No, Python (Score:2, Interesting)
Almost every language has text processing capabilities. Here's a dirty little secret most people don't know . . . regular expressions for bioinformatics work is not as important as people would like you to believe. The fact of the matter is, most of the data bioinformatics researchers encounter is structured data. Simple string parsing and tokenization is all that is needed. Regulars expressions past the most simple are rarely encountered. In fact, a lot of the data a bioinformaticist encounters is in either XML, tab-delimited, or CSV. For the text processing part of my tasks, I have often used awk to blow my way right through a text file. Of course perl can do the same thing, but I'd like to point out that awk is great when so much of your data is in tabular format (we've got databases everywhere in this field). I also find Java's String, StringTokenizer, BufferedReader and Writer mixed with the FileReader and Writer classes to work great with text files too.
This brings me to my last point. Perl is horrible for some areas of bioinformatics. A lot of people employed in so-called bioinformatics positions spend like 90% of their day parsing through text files. Most people don't know that there are bioinformaticists who spend very little of their day doing that, but instead are developing algorithms and such that usually require a different language. For instance, I'd hate to run a Hidden Markov modeler with the Viterbi algorithm coded in Perl :) Or how about a massive simulation during haplotype reconstructions in perl? Or maybe a support vector machine in perl? Hee, you get the idea. For these tasks C is often chosen. Particularly if one employs parallel programming. I encourage bioinformaticists to explore other languages besides perl so that they have a vast array of expression for the multi-facted charges a computational biologist is expected to handle.
Re:Ever heard of comments? (Score:2, Interesting)
Re:Expressions .. (Score:3, Interesting)
Funny. I feel the same way about PHP. It's routine for me to take some broken, busted stuff written in Perl or c or whatever, and redo it in PHP in 1/4 the lines.
As Jethro Tull once said:
"You know what you like, and you like what you know".
I can "do" Perl, but it brings me much grief to do so. While I find PHP consistently readable and understandable, pretty much no matter who wrote it.
Oh, and BTW, since I've taken the time to "get" regex, I don't even find it ugly. The earlier example about $stuffinParen or whatever was hideous, and not nearly as understandable to me as the simple, concise, original example. Einstein once said:
"Everything should be made as simple as possible -- but no simpler!".
Still uglier than *this* notation (Score:2, Interesting)
They should be replaced by something better, such as Xerox' Extended Regular Relation Calculus [xerox.com]: Here [xerox.com] are some examples.
The nice thing about it is that it's fully declarative and bi-directional, i.e. a:b can be applied substituting a by b or vice versa (if run backwards), whereas the traditional
pattern-action paradigm that Perl has inherited from awk is only partially declarative (only the pattern).Another interesting property is that xfst, one of Xerox' compilers, allows naming and re-use of subexpressions:
(all without any ugly '$'sAbstraction by naming is a powerful feature, as Abelson and Sussman (SICP) and other good elementary textbooks point out.
Maybe anybody wants to volunteed to build something like this into Perl6 instead?