12 ms·
Perl is 25 years old today
- adrianhoward 14y agoWork stuff is mostly Ruby, Python and PHP. Entertainment is Clojure (mmmmm.... Lispy goodness) and Haskell ATM. But for my own stuff I still reach for Perl. Best testing infrastructure on the planet and that, in combination with CPAN, lets me get shit done.
- peteretep 14y agoI interviewed you once ... approximately forever ago ... and you told me at the time you were just switching to using Ruby for fun stuff, while using Perl for work. I'm glad you switched back, and appreciate your excellent CPAN modules!
- adrianhoward 14y agoI have completely forgotten the interview I'm afraid - but I'm glad you're glad ;)
- frozenport 14y agoThis one is a real perl see -- | \|/ http://stackoverflow.com/questions/7617852/whats-the-difference-between-carp-croak-cluck-confess-and-verbose-options http://stackoverflow.com/questions/7617852/whats-the-differe...
- meaty 14y agoI vomited a little when I read that :)
- RyanMcGreal 14y agoI was going to downvote your comment, but then I clicked through and read the linked question and commentary.
- bcoates 14y agoI don't get what the issue is, I don't even know Perl and it seems pretty straightforward to me: Carp is a library with a set of mnemonic assertion functions for libraries to signal usage errors committed by their callers. Do people just prefer one function with a bunch of fiddly little enums or something?
- IheartApplesDix 14y agoPeople prefer what they've already learned.
- meaty 14y agoIn my case I prefer sensible pragmatic names with some sort of hierarchy rather than random words from the dictionary.
- kamaal 14y agoDid get the point of your comment, are you are trying to convey that you have problems with the Perl philosophy- "There is more than one way to do it(TIMTOWTDI)"?
- frozenport 14y ago1. Yes 2. I also don't like that their naming convention doesn't reflect functionality. How would you assign carp, cluck, croak and confess functions?
- kamaal 14y agoYou have chosen a very small topic to discuss the vast range of advantages TIMTOWDI offers. Now bear with me for a minute while I explain you this whole thing. Have you worked with a language where your though tool just wasn't for you? Have you felt that language was pushing down its own self believed principles down your throat? What happens when programmers face such situations? They just leave the tool and go to something else. Perl is one of those few tools that adapts to the programmer, rather than expecting the programmer adapt to it. Now like every other design choices you can ever make, it has its own tradeoffs. Being flexible, adaptive, powerful and quick to evolve means at times you have to sacrifice a little consistency. You can sure present your arguments and your design perspective against it, but your design again will have its own trade offs. Why so many different ways of doing things? For example why do we have something like 'map' and 'foreach' in Perl? You won't understand this when you have used and written code that leverages these keywords to their power. Its more or less like explaining why Ice cream is delicious to somebody who has never eaten it. Unless you taste it yourself won't truly understand. Perl is quick to learn. You can learn as much Perl to do the kind of work you can do in Python/Java/whatever. But as you learn more Perl, you become productive at solving problems. You can do it quickly, with succinct code with more powerful syntactical features. EDIT:Corrected typo.
- czr80 14y ago"rage of advantages" - somehow this seems to perfectly capture TIMTOWDI ;-)
- 3amOpsGuy 14y agoBefore i switched to Python as my general purpose language, i used to be a bit of a Perl fanatic. I've still to come across a language that lets you get your ideas down as quickly. It's full of fantastic time savers, e.g. the for(<>) construct and the format output functionality cover a bunch of common use cases in minimal keystrokes (let me pipe in some data, analyse it, then spit it out in a clean report). It can hurt readability but for small one offs, it often doesn't matter.
- ryporter 14y agoI'm in a similar boat. I've largely switched to Python as my scripting language (except for one-liners), but I'll still defend Perl against those who dismiss it out of hand. After using it an Amazon, I've seen firsthand how productive one can be with the language; and, if you're careful (following, e.g., the guidelines in "Perl Best Practices" by Conway) it's very possible to write maintainable code as well.
- gvalkov 14y agoI hear you on the one-liners issue. Python is unhelpful when it gets to that - there are no -n, -p, -l switches or special variables like there are in Perl and Ruby. It's a shame really, since all the building blocks needed to implement a useful mode for writing one-liners are there. In fact, I have a work in progress module that tries to address this issue: https://github.com/gvalkov/python-oneliner https://github.com/gvalkov/python-oneliner
- slurgfest 14y agoThis is an interesting idea, but if you need an extremely terse DSL which doesn't look anything like Python and has to be learned anew, why not just use Perl directly? Maybe for environments where you can't install Perl?
- gvalkov 14y agoThanks. My approach is actually pretty minimal. Just a read-print-loop (-n, -p), a few local variables (equivalents of $_, $~, $. etc) and a shorthand import syntax to take away some of the verbosity. There are other projects, such as pyp[1], that are more ambitious, but put you through a learning process. By all means, everybody should use what they are comfortable with. Ruby and Perl allow you to write extremely terse and awesome one-liners, the likes of which will never be possible in Python. But if the first solution that pops into your head is a Python one, why not use that? [1] http://code.google.com/p/pyp/ http://code.google.com/p/pyp/
- kamaal 14y agoHere is another article covering a good deal of detail about Perl in its first 25 years, Its a great read: http://news.perlfoundation.org/2012/12/the-first-twenty-five-years.html http://news.perlfoundation.org/2012/12/the-first-twenty-five...
- kablamo 14y agoThe stats in the link are interesting. I recently discovered the Code::Statistics module (https://metacpan.org/module/Code::Statistics https://metacpan.org/module/Code::Statistics). It tells you the cyclomatic complexity of your code which wikipedia tells me is basically the number of possible paths through your code. It might be fun to see that run against the Perl core. I also like looking at the number of lines of code. If your features go up while complexity and lines of code go down -- that could be a good sign.
- maligree 14y agoI'll raise the glass: here's to Perl, for being the first language I could actually get shit done in. Unmaintainable? Who cared. Got shit done. Too many ways to do things? Who cared. Got shit done. I have this totally false feeling that BACK THEN* we wrote IRC bots and we were happy. And `perl -e '"A"x800'` was the destroyer of worlds. * - shit, I just realized I'm young.
- 5teev 14y agoI like that Perl tends to do what you wanted it to do, rather than what you told it to do. Bugs in other languages are often because of vice-versa.
- smoyer 14y agoTwenty-five years already? Now it can retire with full benefits.
- ojosilva 14y agoHere's Perl 1.0, published by Larry on comp.unix.sources 25 years ago ("Revision 1.0 87/12/18 13:07:40 root"). https://groups.google.com/group/comp.sources.unix/browse_frm/month/1988-02 https://groups.google.com/group/comp.sources.unix/browse_frm... Perl Kit, Version 1.0 Copyright (c) 1987, Larry Wall You may copy the perl kit in whole or in part as long as you don't try to make money off it, or pretend that you wrote it.
- mstevens 14y agoSlightly self-promotion, but you can get a variety of old perl sources at http://www.etla.org/retroperl/ http://www.etla.org/retroperl/ (collected by someone non-me, I can't remember who though) I had thought someone had done a perl 1 release that built on modern systems, but on a quick hunt I can't find it.
- perlgeek 14y agoThe perl source repository quite many historic releases also, and the first few commit messages also contain the accompanying release notes. See for example https://github.com/mirrors/perl/commit/8d063cd8450e59ea1c611a2f4f5a21059a2804f1 https://github.com/mirrors/perl/commit/8d063cd8450e59ea1c611... for the perl 1.0 annoucement (click on the [...] link to get the full commit message).
- mstevens 14y agoooh, cool, I didn't know that was there. My more active interest in perl was pre-git :)
- antoni 14y agoWhat can I say, it's time to die.
- berntb 14y agoA karma 3 account. Where are the Perl-hating trolls coming from on HN? (I thought Guido said that it was time to stop trolling, so it isn't Python people now?)
- smoyer 14y agoHate is an emotional response that humans have ... how can you tell if the comment was trolling or simply a visceral response? I don't hate Perl (I first learned CGI programming with it), but I do think there are better ways to write maintainable, enterprise scale software. There are two main problems with Perl (as I see it): 1) The language is so permissive that it allows newbs to write bad code but still obtain results. Habits, both good and bad are learned! 2) Perl experts seem to delight in writing code that's "tricky" (for lack of a better word). It's like a contest to see who can wring the most out of one 80-character line of code and it leads to mid-to-low functioning Perl programmers being confused.
- berntb 14y ago>> The language is so permissive that it allows newbs to write bad code but still obtain results I can't see any relevance for a professional choice if newbies can shoot bigger holes in their foot with a certain tool. That is a natural result of a powerful tool. >> Perl experts seem to delight Anecdotal. Ten years old description of half humorous use (and exercises). Also very different from best practices even then -- and especially different from how many/most work today. Let me also note: If Perl wasn't better in many ways, you trolls would make serious arguments instead of "experts seem to delight"... [Or as you wrote above "Twenty-five years already? Now it can retire with full benefits."] But I'll bite a little. Perl has the best OO system of all the scripting languages (Moose). The CPAN is the gold standard for scripting languages (and probably everything else). The testing culture is afaik second to none. The same goes for Unicode support. And so on.
- VLM 14y agoI've found over the past decade or so that when I write a "perl" program I'm really writing about five lines of glue code around multiple CPAN packages. Well maybe more than 5 lines for control flow, some business-logic error handling, etc. When I write in another language I spend a long time looking for a library like the ten I'd find in CPAN, sometimes I find one but often enough not, then a long time complaining about how if I used perl I'd have access to the perfect CPAN module and therefore already be done with the whole project, then basically reimplement the CPAN module in the smaller inferior language, then finally write glue logic to link stuff together. I never fail to be amazed when I see pages and pages of an inadequate homemade xml parser written in an inferior language or maybe a blizzard of regex, and then hearing bragging about how in Perl the elegant alternative language code would closely resemble line noise. No, in Perl, those pages and pages of buggy code would instead closely resemble one line: "use XML::Simple;" Repeat a zillion times over. My "perl" programs / systems actually shrink in length over time rather than expanding, which is unusual in smaller languages.
- mahmud 14y agoCPAN might be centralized, but Java libraries are far superior. This is not a pissing contest, but a fact. The java runtime makes everything else look amateurish and unprepared. Debugging, profiling, introspection and distribution, all built into the platform. Attach to any running process and analyze away. Perl is good when it works, but when it doesn't, it's cryptic stack traces and `exit -1`, nothing meaningful.
- berntb 14y agoHalf the point of CPAN is "installability", it is trivial to d/l and install lots of modules. There is also CPAN Testing which drastically helps portability. Can Java really compete with a Perl module that has a long list of dependencies (50+ is a pain but will work) and some code tying it together...? [That was the example in the GP post.] With all due respect to the Java runtime (if not its memory use :-( ), it is part of a totally different ecosystem compared to the usual suspects of the scripting languages. (And I'd argue that it is always easier to debug a scripting language than C/C++/Java, except maybe just for long running server processes.)
- j98h 14y agoI like perl "expression": perlguts, bless, sv_2mortal, etc i feel we are listening the same song :)
- FigBug 14y agoPerl is 25. Python is 21. Lua is 19. Ruby is 17. Interesting how I consider Perl an 'old' language, and the others new languages. I guess it says more about how revolutionary Perl was at the time and how quickly it became widespread. The only other language I know of that went from 0 to everywhere in under 5 years was Javascript.
- podperson 14y agoPHP probably gets in there somewhere. (I looked up the history -- I did not know that PHP was first implemented in Perl.) PHP was first created in 1994, so it's 18.
- davorg 14y agoThat's the same age as Perl 5.
- felideon 14y agoCommon Lisp is 28, which a year younger than C++ and not much older than Perl. So not a dinosaur language as some people think. <g>
- prodigal_erik 14y agoLisp was invented 54 years ago. The Common Lisp standard is the capstone on an unusually long and fractured history of development. Fortunately many of those good ideas have trickled down over the decades, making mainstream languages steadily less terrible, and competing proprietary implementations are no longer commonplace.
- derleth 14y ago> Lisp was invented 54 years ago. The Common Lisp standard is the capstone on an unusually long and fractured history of development. Hm. If we do this, then C++ is merely one 'capstone' on the history of Algol development, which is about as old as Lisp is.
- 14y ago
- runarb 14y agoUnfortunately it looks like the interest in Perl may be fading a little according to Google trends: http://www.google.com/trends/explore#q=perl%2C%20python%2C%20&cmpt=q http://www.google.com/trends/explore#q=perl%2C%20python%2C%2... (Perl vs Python for comparison)
- Mithaldu 14y agoPlease do yourself a favor and mouse over the letters indicating news headlines. :)
- knighthacker 14y agoHappy Birthday, Perl :). At Crowdtilt, we are proud to have the majority of our stack Perl based. w00t w00t CPAN :)
- bobochan 14y agoCame here looking for someone else wishing Perl many happy returns as it reaches this august landmark. I have been working as a programmer for 25 years and started using Perl in 1993 or so. I cannot express what it felt like to have this incredibly powerful tool that seemed to integrate all of the sed, awk, shell, and C code that I had for research. Using Perl absolutely felt like magic, particularly for analyzing text. I love Python, Ruby, and Lua too, but Perl will always be the tool that quickly gets things up and running.
- hippich 14y agoI believe most mainstream languages used for web development are quite old now. And today it is matter of personal taste to choose one over another one unless you are constrained by coding standards. To me Perl is awesome :) Too bad I do PHP for a living, but I still enjoy it when doing something for myself. Like last time I learned about web framework Mojolicious ( http://mojocasts.com/ http://mojocasts.com/ ) and built http://gotldr.com http://gotldr.com and http://hntldr.com http://hntldr.com leveraging Mojolicious and Redis - https://github.com/hippich/perl-tldrer https://github.com/hippich/perl-tldrer . It took me few evenings, but I really enjoyed tinkering it.
- indubitably 14y agoAnd Perl 6 is 24
- draegtun 14y agoConsidering perl5 is only 18 years old then somethings gone very awry there :) Perl6 is looking quite fresh considering how old you think it is. I just submitted an article I'd seen to HN which shows how a formula like... 4.7kΩ ± 5% ... can be parsed inline with Perl6 code. http://news.ycombinator.com/item?id=4939204 http://news.ycombinator.com/item?id=4939204
- indubitably 14y agoI was just joking :) It's interesting to me how often people cite "Unicode in code" as some sort of amazing thing. I once posted on S.O. about the idea that maybe we should have a programming language where the vast array of options in Unicode were exploited to make things like Regular Expressions more readable (avoiding the backslash plague alone would be worth it). I got smacked down by people complaining that they didn't know how to type anything but ASCII. Sigh.
- draegtun 14y agoJokes tend to get downvoted on HN and there's been a few (to many) jokes in this HN post :( Your's the only one I didn't downvote because decided to leave a comment instead. re: Unicode - Perl6 does already use unicode characters for some of its operators. Take the Hyperoperator »« (http://perlcabal.org/syn/S03.html#Hyper_operators http://perlcabal.org/syn/S03.html#Hyper_operators): my @a = 1..5; my @b = 6..10; my @c = @a »*« @b; # => 6, 14, 24, 36, 50 And there are >> & << synonyms for those who find using unicode chars too odd: @c>>++; # => 7, 15, 25, 37, 5
- indubitably 14y agoItalicizing "jokes" is a very serious accusation.
- ChuckMcM 14y agoI've got an interesting relationship with perl. My first exposure was back in the 80's when I was at Sun and perl was, to my taste, a shell scripting language with the complexity of APL and the readability of Forth. I hated it. When I took the job at Blekko they said "We do most of our stuff in perl" and I was dubious about that. However, now that I've been exposed to V5 for a couple of years and have probably written a few thousand lines of code in it, I find its easier to write a quick hack in than Python, and it certainly has a better 'command line' feel than Java. But it wasn't until I started coding up a quick CMS type gizmo for making HTML pages that I truly "got" the power of CPAN backing it up. There is a lot of stuff there. Folks like me who gave up on the language in the V3/V4 days as "hopelessly hacky" should re-visit it.
- trhtrsh 14y agoThe V3/V4 days ended in 1994, before Java 1.0 was released. http://perldoc.perl.org/perlhist.html http://perldoc.perl.org/perlhist.html
- ChuckMcM 14y agoI was first exposed to perl at Sun Microsystems in 1989, I started working on Java in 1992. http://stuff.mit.edu/afs/sipb/user/marc/hotjava/doc/people.html http://stuff.mit.edu/afs/sipb/user/marc/hotjava/doc/people.h... (top left corner)
- ante_annum 14y agoDo people really still use Perl? It seems to have yielded greatly to other languages in the past few years.
- Mithaldu 14y agoAbsolutely: http://stats.cpantesters.org/trends.html#stats6 http://stats.cpantesters.org/trends.html#stats6
- IheartApplesDix 14y agoAre you joking? Most of the internet runs on Perl.
- Raz0rblade 14y agoshould have died 20 years ago its an awful language in my opinion
- kenshiro_o 14y agoI haven't written a single line of Perl for over a year now and can't remember much of the language - and I am sure I would not even be able to understand my own code anymore! Perl is a very handy and powerful scripting language but it should not be considered as a durable solution. Whatever is quickly hacked using Perl should be probably rewritten in a much more structure language, especially if you plan on maintaining this code.
- singingfish 14y agoOf course one can also write perl with care and attention. Perl::Critic, the Moose family, and appropriate use of the CPAN really helps with that discipline.
- chromatic 14y agoWhatever is quickly hacked... ... in any language should probably be cleaned up if you plan on maintaining it.
- trhtrsh 14y agoAs always, XKCD sums up the situation: http://xkcd.com/224/ http://xkcd.com/224/
- draegtun 14y agoBirthday cake! https://twitter.com/TimToady/status/281119953741029376 https://twitter.com/TimToady/status/281119953741029376