7 ms·
What is "Modern Perl"?
- toddh 16y agoPython?
- perlgeek 16y agoI kinda thought the trolls were mostly on reddit, sad to see their rise on hackernews too.
- toddh 16y agoYou see a troll, I see a lack of introspection on your part.
- perlgeek 16y agoHow much reflection do you spend on a single-word comment? Python is not Perl, how can it be Modern Perl? I know that some people think that Ruby and Python continued the tradition of scripting languages that Perl brought to mainstream, and that they are both modern in some sense, but that doesn't make them Modern Perl in any way. Would you care to expend the thoughts that you think my introspection should have produced, that let the reply not be troll?
- toddh 16y agoWhat length of comment is required for you to begin introspection? This does a good enough job: http://martin.drashkov.com/2009/11/why-perl-lost-it.html http://martin.drashkov.com/2009/11/why-perl-lost-it.html. I personally look to lack of advancement of the language and lack of adoption for new ventures. Google adopted Python for GAE, for example. Heroku used Ruby for their PaaS product. When you look at new devops tools they aren't written in Perl. So, it's not a matter of what is better, it's more a matter of other scripting languages are now in the slot/brand/niche/mindshare where Perl once would have been. So in that sense they are the modern perl.
- chromatic 16y agoWhen you look at new devops tools they aren't written in Perl. That statement seems to assume a zero-sum game and begs for non-anecdotal evidence. (Paul Graham wrote Hacker News in Arc instead of Ruby on Rails or Django; clearly they're losing ground too!)
- sliverstorm 16y agoIf you interpret it as a joke, it is amusing. It's not that I don't like Perl. In fact, I use Perl and have NEVER used Python.
- bad_user 16y agoIt's missing the amusing part. Here's better trolling: The notion that everything is a stream of bytes is utterly braindead. The notion that regexps are the solution to all problems is equally braindead. Just like Perl. Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. (by Jamie Zawinski <jwz@netscape.com>)
- chromatic 16y agoWhat about Python do you find better than modern Perl? Besides Pygame and NLTK, there's nothing in Python I can't do faster, easier, or more maintainably in Perl. I much prefer Moose to Python's barely-there OO, and nothing compares to the availability (and testing and other infrastructure) of the CPAN.
- toddh 16y agoIt's a joke pointing out how Perl has fallen behind in the marketplace. I've written as much Perl as your average bear, to see it lose out has been sad.
- chromatic 16y agoBy which objective measurements has Perl "fallen behind in the marketplace"? TIOBE is nonsense and noise, and the State of the Computer Book Marketplace has flaws that would make a first year business student blush. I know there's some nebulous buzz factor, but I'm asking about verifiable measurements.
- phaylon 16y agoIt might be worth noting that Perl is simply stronger than it appears. The community has very easy ways to communicate information, since Perl has a very good infrastructure. CPAN is easy and doesn't distinguish between rank or other privileges; there's RSS feeds for about everything and you can get a large crowd simply by releasing; Many forms of bugs that are dependent on architecture/environment can be caught by automated testing, or by community members reporting their installation logs through their CPAN client; We still use mailing lists (some of which are closed) because they're easy to manage and are well suited for long big-traffic discussions; we use IRC because of its advantages, and many early developments happen on irc.perl.org, separated from the rest of the IRC world (this isn't bad, just a simple reason); We didn't do forums and online communities that well in the past, but it's starting. There is PerlMonks, but it was always very Perl-specific. Blogging has been adopted by the community a lot, and you can feel its impact when you see more and more people asking about the projects the community enjoys the most at the time (Moose, Catalyst, Dist-Zilla & Co). I heard "Yea, we still make heavy use of Perl in our company, but we didn't follow the community, because isn't Perl on a decline?" many times at CeBit this year. So it's kind of a chicken-and-egg problem. Overcoming it isn't an easy task, but we're heading in the right direction and there's a couple of very smart people working on it.
- Xurinos 16y agoAlso, I rarely see listed Devel::REPL. Excellent, excellent tool. Run re.pl with perl -d, and you have half the useful REPLness of CL.
- draegtun 16y agoI usually leave a terminal window with Devel::REPL up, often with DBIx::Class running (an ORM and yet another Modern Perl module). Excellent for prototyping with a database and great alternative to normal SQL command line interface.
- viraptor 16y agoIt's ok... It's better than nothing, but sometimes it can be pretty confusing (one can argue that's correct, but it's definitely not what I'd expect). $ my @a=(1,2,3) $ARRAY1 = [ 1, 2, 3 ]; $ my $r=[1,2,3] $ARRAY1 = [ 1, 2, 3 ];
- draegtun 16y agoThats just standard Data::Dumper output so nothing to worry about: $ say $_ for @a; 1 2 3 $ say $_ for @$r; 1 2 3 You can switch on the Data Dumper Concise plugin (Devel::REPL::Plugin::DDC). It will still display @a has a array reference but its nicer to look at: $ my @a=(1,2,3) [ 1, 2, 3 ] $ my $r=[1,2,3] [ 1, 2, 3 ] It's ok... It's better than nothing Come on its a lot better than nothing! Checkout the plugins on CPAN because this really makes it a very powerful tool: http://search.cpan.org/search?query=devel%3A%3Arepl%3A%3Aplugin%3A%3A*+&mode=module http://search.cpan.org/search?query=devel%3A%3Arepl%3A%3Aplu...
- viraptor 16y agoI meant the array reference that looks weird even if you're listing an array. Well... it is a usable REPL, but I'm used to running IPython+pdb as my login shell. `re.pl` cannot be really compared there.
- jaxn 16y agoI have a friend who has done some really neat stuff with Modern Perl. I think that is the perfect name since it seems to be just using modern methods of development with Perl. So, here is a serious question for the Perl geeks though: Is Modern Perl basically TMTOWTDI falling out of favor? It seems like the article is saying "This is probably a better way" (TIPABW?)
- phaylon 16y agoI'd say there is and always will be more than one way to do it. Even if a language manages to constrict usage of the syntax to the guidelines, one layer of abstraction higher up it's all choices once again. There have always been good and bad practices in Perl. Without change and reevaluation, how should there be progress? I regard Modern Perl as the aggregation of the community's knowledge, experience and best practices with regard to designing software. I'd like to emphasize the last part of the former sentence, since I believe Perl's continuing influence and ability to find new talents is at least in part depending on the nature of the community. And especially the fact that it doesn't matter where a good idea come from. If the Python guys come up with something smart, more power to them, because we might be able to use their experience. And at the same time, I think Perl wouldn't have been such a success for a long time if it hadn't been as flexible as it is, catering to people coming from other styles and other environments. Yes, the Perl community might have a common way to do it, and in this day and age even a library that does it all for you, and stuff you wouldn't even have thought of yet, but that doesn't mean you can't come up with something better. With the ability to extend the grammar in Perl 6, I believe this will go full circle. Since then everybody in the Perl community will be able to experiment with language design, find bugs, write proof-of-concepts, and so on.
- draegtun 16y agoIs Modern Perl basically TMTOWTDI falling out of favor? Instead its morphed into TIMTOWTDIBSCINABTE, which fortunately is lovingly referred to as "Tim Toady Bicarbonate" :) In full... There's more than one way to do it, but sometimes consistency is not a bad thing either ref: http://en.wikipedia.org/wiki/Theres_more_than_one_way_to_do_it http://en.wikipedia.org/wiki/Theres_more_than_one_way_to_do_...
- draegtun 16y agoAlso see perl5i for a hypermodern version/vision/patch of Perl 5: http://search.cpan.org/dist/perl5i/lib/perl5i.pm http://search.cpan.org/dist/perl5i/lib/perl5i.pm
- hernan7 16y agoJust one request from this old Perl hack: please make it easier to learn than Ancient Perl. If you need to be an expert on Vanilla Perl to be able to "get" Modern Perl, then it's going to have a hard time getting traction. Like those Java web frameworks that you needed to be a JSP guru to be able to grok. Oh well, back to my usual Ancient Perl hacking...
- bigiain 16y agoWhile I quite like the article, I'm amused to note that 5 out of the 10 "aspects of Modern Perl" are things I screwed up, struggled with, and standardised on - in a project back in the late '90s. Tests, 3 arg open, strict and warnings were all things that came to prominence (at least in my head) shortly after the Perl4 - Perl5 update. To a lesser extent "best practices" (the same concept but before the book was published) and "care and marketing" were all things being discussed and in clpm back around the same time everybody was worried about y2k issues. Even the OO stuff was well underway, with things like Abigail's "inside-out objects" being experimented with and discussed well before the start of the Moose project...
- draegtun 16y agoAnd this is all good news because it shows that Perl is progressing and continually improving. For eg. from Perl 5.012 you can now do this: #!/usr/bin/env perl use 5.012; use warnings; That use 5.012 now automatically switches on use strict along with all the extra Perl 5.12 features (http://search.cpan.org/~jesse/perl-5.12.1/pod/perl5120delta.pod http://search.cpan.org/~jesse/perl-5.12.1/pod/perl5120delta....). Perl + CPAN + time = programming darwinism :)