8 ms·
Desperate Perl Hacker
- jrockway 16y agoIt's interesting that he mentions how OOP is important, but not that Perl has one of the most featureful object systems in existence.
- Jach 16y agoIs there a nice chart between comparisons of OOP implementations and kick-ass features between languages? I know Python, CLOS, Ruby, and Perl all can mop the floor with Java and C++ with features, but how do they compare with each other?
- coderdude 16y agoYou might find this page useful: http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(object-oriented_programming) http://en.wikipedia.org/wiki/Comparison_of_programming_langu...
- prog 16y ago> Perl has one of the most featureful object systems in existence. Having primarily used Python for scripting, I am not too familiar with Perl. Could you explain a little more what you mean by this?
- sigzero 16y agohttp://search.cpan.org/~doy/Moose-1.08/lib/Moose.pm http://search.cpan.org/~doy/Moose-1.08/lib/Moose.pm
- sabat 16y ago* Perl has one of the most featureful object systems in existence * That's an overstatement. Perl is in no way actually object-oriented. It's a feature that's tacked on, but it doesn't help you write better code. If you think Perl's object architecture is featureful, take a look at Ruby. It'll blow you away.
- telemachos 16y agoI may be wrong, but I think he's talking about Moose, not Perl's native OO style/system. (Though I suppose you could also argue that the native system is pretty nice too, if it allows you to create Moose on top of it.)
- staunch 16y ago$perl += 1;
- sh1mmer 16y agoI heard a lot of moaning about this at OSCON. I'm going to be blunt. I actively dislike Perl, not Perl developers, but Perl. This is because I believe it not only gives people the rope to hang themselves with but encourages them to do it in 6 different ways. The problem that I have most though, is the reaction to this silly bit of fun. Instead of proving that Perl is awesome and showing what you can do with it, I mostly heard a lot of griping. I'd really love to see Perl 6 succeed and those guys do something amazing, new and innovative that breaks from the mold that I think of them in. But until they do, I'm not going to listen to their whining. P.S. Tim is also right there are lot of great things we got from Perl, but that doesn't mean they should be allowed to coast on them forever.
- rjbond3rd 16y agoThey ship a new language, compiler and virtual machine next week (Perl 6 Rakudo Star).
- jrockway 16y agoPerl 6 doesn't have much to do with Perl 5 except that the same guy created both. Think of Perl 6 as Perl 5's Clojure. Heavily inspired by the original, but a totally new and different language. (Think of how non-radical PHP 4 -> PHP 5 and Python 2 -> Python 3 were, and how hard it was to get people to switch. Now imagine differences 100x those, and you can start to see Perl 6's relationship with Perl 5. P5 is going to be around for a long time; it's a great language, and people are going to be using and improving it for a while. P6 is a good language too. They both happen to have the same name, though, which apparently confuses people.)
- sigzero 16y agoP6 is to P5 as VB.NET is to VB. It's the same language but not really.
- ekiru 16y ago> Think of how non-radical PHP 4 -> PHP 5 and Python 2 -> Python 3 were, and how hard it was to get people to switch. Now imagine differences 100x those, and you can start to see Perl 6's relationship with Perl 5. While the radical difference between Perl 6 and Perl 5 might discourage adoption, I wonder if the less radical changes of PHP 4 -> 5 and Python 2 -> 3 may have contributed to their slow adoption. After all, if there is no radical benefit you will receive from switching your code to a backwards-incompatible new version of your language, it can be hard to justify doing so.
- ryanf 16y agoSo why is Perl so unfashionable? He mentions OO and readability, but if Perl has "one of the most featureful object systems in existence", does that leave just readability? I'm curious (as someone who knows very little about Perl) what the actual reasons are for Python and Ruby having stolen so much of Perl's thunder.
- Lewisham 16y agoIt is pretty much the OO and readability. I worked with Perl for years, and, much to my shame, I really didn't understand a lot of many of the CPAN modules I relied upon. I read the poddoc and then copied the syntax they used and edited to my needs. Perl provides many, many different ways to achieve the same thing. This is somewhat by design, in the idea that Perl should match your own intuitive style. But most people's styles are not yours, and it becomes impenetrable. IMHO Ruby's strength over Perl is the much stronger OO, Python's strength is the focus on "there is only one way to do it", which lets most people be able to grok most of your code. I couldn't go back to Perl by choice now. I first jumped to Python just to get some sense of clarity in my life, but now I prefer Ruby due to how its extreme openness means there are some really awesome gems out there.
- wazoox 16y ago> Python's strength is the focus on "there is only one way > to do it", which lets most people be able to grok most of > your code. Unfortunately this is not my way of doing it, and that's why I'll always prefer Perl to Python.
- sigzero 16y agoThat is so true. There really is never "only one way to do it" because Programmers think differently.
- stcredzero 16y agoIn other words, coding standards are always useful.
- neilk 16y agoI like Tim's assessment of Perl's strengths. There's this idea in the Perl community that it succeeded due to Larry's theories about syntax, but I think that's a bit of a myth. Everybody forgets that when Perl was created, the idea of a 'dictionary type' as a standard feature was a pretty exotic notion, and the idea of wasting such jewels of computer science on sysadmins and philosophy majors was almost scandalous. And of course now we have entire languages built on dictionary types, like Python and Javascript, and nobody thinks it's weird. I wonder what the Perl of our time could be. If someone dragged all the neat bits of Haskell into a language that mere mortals could use, that might be a start. And in fairness the Perl 6 people think they can bring parsers into the mainstream. Personally I think they're a bit overobsessed with syntax, but I'd be happy to be proven wrong.
- Niten 16y agoI think Perl 6's Rules are a natural and important extension to the language. Perl has always been a tool of choice for text processing; but people tend to [ab]use regular expressions even where a real parser would be much more appropriate because their language -- Perl, Python, Ruby, C#, pretty much any commercially popular language these days -- gives you regular expressions on a platter, and their presence in the core language or standard library sort of enshrines regexes as a tool of choice. Look at it this way: pretty much any "Programming ______" book will at least touch on that language's regexp implementation. How many such books currently cover implementing basic parsers for non-regular grammars? So yeah, if Perl 6 can bring parsers to the mainstream by providing easy, visible tools to implement them, and even simply by making parsers something you learn about in the course of learning Perl, that'll be a huge win for us all.
- gtani 16y ago"Programming ______" book will at least touch on that language's regexp implementation. How many such books currently cover implementing basic parsers for non-regular grammars? (i think Expert F# might also, i can't remember) http://book.realworldhaskell.org/read/using-parsec.html http://book.realworldhaskell.org/read/using-parsec.html http://programming-scala.labs.oreilly.com/ch11.html#ExternalDSLsWithCombinatorParsers http://programming-scala.labs.oreilly.com/ch11.html#External...
- lsc 16y agoeh, from a sysadmin perspective, the real advantage is that perl5 is perl5 and it has been essentially the same for what, 10 years now? If you are stuck on a RHEL system (or anywhere else where you expect the server to remain up without major revisions for 3-5 years) maintaining the two or three versions of your scripting language is a pain in the ass. (yes, you have to do this on RHEL 5 if you support python, usually. the base system requires a pretty old python runtime, so you need another if you want the new stuff.) I remember working on perl when you still needed to keep both perl4 and perl5 around on a system... today, though, perl5 is the scripting language you can depend on having, that you can depend on being there and compatible. This is also the major resistance to perl6. Goddamnit, perl5 works. I don't want to go back to the bad old days when i had to write everything in sh (or test it across two major revs of perl) if I wanted it to run properly on all systems. I know that the language writers always claim backwards compatibility is a priority, and it is, kindof, but, for example, don't try to upgrade the base python on a RHEL5 system. you /can/ but it's a /huge/ pain in the ass and it means you will have to do more work every time yum or some other python-dependent base bit is upgraded. for us, perl occupies the niche that bash occupied in 1997. Now, it /can/ do more, but we are utterly dependent, at this point, on the bash replacement.
- tene 16y agoPerl 5 isn't going anywhere, nor does anyone claim that it is. Perl 5 is still being actively developed, and it's still going to be in the future. Perl 6 has worked out to not be so much a Perl 5 replacement as just another language in the Perl family.
- regularfry 16y agoIsn't that exactly why Perl 6 can't possibly do as well as Perl 5 did?
- chromatic 16y agoIf you assume that the only Perl 5 programmers would ever have an interest in Perl 6, perhaps.
- larard 16y agoThe perl community have been searching for the best way to overcome the perception that "perl is dead". (The constant bickering that it isn't the case reminds me of the holy grail http://www.imdb.com/title/tt0071853/quotes?qt0470614 http://www.imdb.com/title/tt0071853/quotes?qt0470614 ) They need to focus on "Where perl has been" while it has been out of the limelight because, believe me, perl still rocks for productivity and performance. Moose has revolutionized the object system (a system that was so flexible that it just gave you the parts and said "go build it") Perl::Critic has created a baseline which all production scripts should be above. PSGI and plack have changed the way you build and deploy and perl webapps. In fact, the perl community and the current stars of CPAN have come so far, and have had so much going on that I have difficulty keeping up with the massive strides they are taking, let alone summarize those changes here.
- m0nty 16y ago> The perl community have been searching for the best way to overcome the perception that "perl is dead" Release. Perl. 6.
- adam-_- 16y agoIt's a shame it got called Perl 6... Perl 5 has been cracking along and is by no means stale: http://www.nntp.perl.org/group/perl.perl5.porters/2010/04/msg158820.html http://www.nntp.perl.org/group/perl.perl5.porters/2010/04/ms...
- larard 16y ago"perl6 is another language in the same family as perl5. It is not meant to replace or succeed perl5. They are incompatible yet complementary." The success of perl 5 is in no way determined by perl 6. Perl 5 development continues unabated. As jrockway says here, "Think of Perl 6 as Perl 5's Clojure". Though my personal opinion is that the naming, and the confusion it creates, sucks and makes it really easy to think that perl (5) is dead because perl (6) hasn't been released yet.
- chromatic 16y agoSince the announcement of Perl 6 10 years ago, there have been fifteen stable releases of Perl 5. There have been 31 releases of Rakudo Perl 6. Pugs had half a dozen. What more do you want?
- stcredzero 16y agoPerl didn't introduce dictionaries first. Awk and Smalltalk did that before Perl. Perl got the idea from Awk. Also, note that Tim's probably right about string manipulation. A lot of times when Smalltalk was perceived as slow even when it was fast, had to do with string manipulation. (And bad programming!)
- neilk 16y agoYeah, I know about the whole dictionary thing. I'm not saying this was the factor that caused Perl to succeed. There were a lot of reasons, one of which was that Perl was unafraid to have multiple reasons for people to join their community. ;)
- sprout 16y agoIf you finished the first sentence after the bullets: >Yes, there were other languages with some of these characteristics before Perl. But Perl had all of them...
- draegtun 16y agoWhy oh why does he write so much FUD in the post? Is all this Perl’s situation is not terribly happy and ...Perl’s somewhat beleaguered status really called for? Is he even correct? Well here's a fascinating stat from OSCON 2010. The language with most (presentation) tracks was... wait for it... Perl! * Perl - 17 tracks * Python - 16 tracks * Java - 13 tracks * Javascript & Ruby 7 tracks each Interesting eh? :)
- jbellis 16y agoThe history is relevant there, though: OSCON started as a perl conference and expanded to other areas later. (FYI, a "track" is a group of related talks, not a single presentation.)
- draegtun 16y agoYes OSCON grew out of the Perl conference. The Perl conference still happens each year (see YAPC, last one being only a few weeks ago). re: track - OK to clarify within the Perl track there were 17 presentations. See http://www.oscon.com/oscon2010/public/schedule/topic/Perl http://www.oscon.com/oscon2010/public/schedule/topic/Perl)
- stephenjudkins 16y agoTim's current position is something any professional developer should reflect upon. Even if the tools or language one currently uses are popular (and growing more so) at the moment, there's a good chance that they will eventually enter into long-term decline, like Perl has. Ruby users may now feel on top of the world, since despite its flaws the Ruby community is vibrant, exciting, and lucrative, but one day we too may be protesting that "Ruby isn't dying", despite all evidence to the contrary. Being honestly aware of the strengths and weaknesses of the tools one uses, and being willing and able to move to other tools if necessary, are attributes that will probably help one have a much happier career.
- newman314 16y agoI still like perl despite the disdain heaped onto it. I have yet to see a good python or ruby way of doing the following: for $line (@array) { print $line unless $seen{$line}++; } So, IMO perl still has pretty useful and unique bits. It's still up to the programmer to write beautiful or ugly code (I'm not claiming I write beautiful code at all).
- JadeNB 16y ago> for $line (@array) { > print $line unless $seen{$line}++; > } The impulse to golf is strong …. How about $seen{$_}++ or print for @array ?
- Natsu 16y agoIt's very clever. That's why I always use the non-clever version for my code, except with foreach instead of for, just so that it reads like English. Clever is fun, though. I do understand the temptation. I admit to having done crazy stuff like turning a JAPH into a vulnerability scanner (in retrospect, the "fork until there are 256 of you and scan an entire subnet at the same time" thing wasn't that great). But I usually find myself wanting to come back to the code and know what I was thinking. Being too clever makes that difficult.
- newman314 16y agoGolfing aside (I don't golf), I guess this pattern struck me as being natural and not really trying to be clever. Used in small doses and when you need something quick and dirty, it has been immensely useful, much like vlookup() in Excel.
- Natsu 16y agoDepends on which pattern you're talking about. I was talking about inverting everything and using the magic of $_ everywhere. If you mean just the idea of using a hash to mark things you've seen before, though, that is very, very useful. But I would write it as: foreach $item (@list) { # Print every item in the list skipping duplicate items. print $item unless $seen{$item}++; } Because then I don't have to think about what's happening with all the magic $_ variables Perl is tossing around. Sure, they're convenient. And I do use them some of the time. But when things break, I'm usually glad that I was explicit about what I was doing rather than relying on Perl's magic to know what I intended to do. Maybe that's why I like Perl so much? I tend to code in as strictly disciplined a manner as I can manage, so I don't end up regretting it later.
- njharman 16y agoReadability is important. Maintainability (and by corollary readability) is PARAMOUNT. Post mentioned most programming is string manipulation. Well even more code must be maintained. It is the #2 tool feature / programmer skill. (#1 is being able to get shit done and thus create something needing maintenance).
- draegtun 16y agoRelated post: http://news.ycombinator.com/item?id=1546864 http://news.ycombinator.com/item?id=1546864