Live data from Hacker News

Why Perl?

bits.shutterstock.com

51–60 of 118 posts

Re: Why Perl?

#51
post #17

The thing I admire most about Perl is that the libraries written for it tend to be more complete than what I've seen in other, similar languages. I think this is due to its age. This may not seem important, but when you need a complete implementation of something you'll likely find it in a Perl library before you will in a Python or Ruby library... just my experience.

Age is not the real reason. Perl was first released in 1987, while Python was released in 1991, Tcl in 1990, and Ruby in 1995. I believe that Perl's success is due to the fact that it was written to scratch an itch. Larry Wall didn't care much about making a pretty language. He cared about creating a useful language. To this end, it was picked up quickly by Unix junkies everywhere. The other big issue, that's often o…

Larry Wall didn't care much about making a pretty language.

This suggests that Larry Wall was happy to create a kludgey language for the sake of just getting things done.

I don't have any references around to back this up, but given Wall's background in linguistics, and his demonstrated interest in language features, I have to believe he was interested in creating a coherent, thoughtful, as well as practical, language.

Perhaps you nor I find the results pretty per se, but the language does have its own aesthetic which apparently many find to have a kind of beauty.

Re: Why Perl?

#52

One of the main points that caught my eye while reading this was the fact that the author mentioned that Perl programmers love their language. As a Perl hacker, I couldn't agree more, and that's the main point I guess. Sure, CPAN is awesome (there is even a module for controlling USB rocket launchers - http://search.cpan.org/~pen/Device-USB-MissileLauncher-Rocke... ) and everything is open source, but the thing I lov…

We shape our tools and thereafter our tools shape us. -- Marshall_McLuhan

It's not that Perl makes it natural for people to express their thoughts. It's simply that your mind was trained to think in Perl.

Re: Why Perl?

#53

The great downfall of Perl is that it's slow: http://shootout.alioth.debian.org/u64/which-programming-lang... 60X slower than C. 30X slower than Java If sed/awk/grep/sort/tr is not up the task, sure, try Perl for those one offs. For serious computation? Fuggedit.

> The great downfall of Perl is that it's slow:

What about Perl6 and LLVM?

My personal experience with Perl5:

- It has incomparable expressiveness. Only APL is more expressive. But more expressiveness makes source code less readable.

- Perl's regexp engine is the best - no doubt about it.

- I would never use Perl for big projects. Its odd syntax ($, sometimes %,... before variable names etc.) is terrible for long term maintainability.

Re: Why Perl?

#54
post #38
post #15

Earlier quoted context omitted.

Sadly not true enough for many languages. But I think equally true for the languages considered its successors: Ruby and Python.

From what I've seen of at least Python, it can't really touch CPAN (yet?). It is not the same width of neither modules nor infrastructure (CPAN Testers, etc.). And the lack of code blocks irritates the life out of me. But I get why it is a common education language, like Pascal in its days. Edit: Mithaldu wrote this up well.

I was responding directly to the "loved" part, but now I realize that was not clear. For the record, I think everything but CPAN applies to Ruby and Python. And your personal irritations are not really relevant to people who use it, just as my personal irritations with Perl are relevant to people who use (and maybe love) it.

Re: Why Perl?

#55
post #28

This is my view on Perl after coding occasionally with it for 2-3 years. For the last 6+ months i've been coding Perl 8 hours per day. In general i'd consider myself at least average in those languages (meaning this list includes my favorite language(s) and ones that i came across for projects and never looked back): C, C++, Java, Javascript, Python, Groovy, Visual Basic, C#, PHP. To be honest i don't agree at all (a…

Didn't read all of it yet, but one thing i can answer right now:

The modules you mentioned have been superceded by better ones like XML::Twig, Config::INI::Reader/Writer and HTML::Treebuilder (and likely a lot more that i don't recall presently). Also, those bugs you point at are of medium amount, and not exactly crippling. Similar libraries in other languages likely have similar bugs, but they're less known because there's no unified bug tracker.

> Unicode Support is horrible

http://www.nntp.perl.org/group/perl.perl5.porters/2011/07/ms...

Really now?

Re: Why Perl?

#57
post #50

Earlier quoted context omitted.

It doesn't need it. It just gets it because the ecosystem is there and automatically does it for everything. The database interfaces get it, the Windows Process Memory access library gets it, the Hiragana learning tool gets it. Doesn't matter how big or small the project is, the service is provided for free, for all. That is why i said the other languages have a long way to go yet; no matter how much you try to shift…

yes, but the point is if the utility provided by these "dists" would be mostly useless for other languages, then it's hardly honest to use said feature to promote CPAN (and therefore perl) against other languages. the review system is a questionable advantage too, as I don't want to go digging through 16 SMTP packages to find the best one, and especially as I suspect most people install CPAN modules through the comma…

> yes, but the point is if the utility provided by these "dists" would be mostly useless for other languages, then it's hardly honest to use said feature to promote CPAN (and therefore perl) against other languages.

Jeeze, you're barely making any sense. I have to wonder if you're trolling here. My point was about the utility of the ecosystem, which is useful for any language. The dists i mentioned are just examples of distributions you could find on CPAN other than Moose which all receive the same treatment.

> I suspect most people install CPAN modules through the command prompt (or via their distro's package manager), rather than digging through a website.

The installation is done via command line, but it is always preceded by research on the websites. Would you exclusively buy movies by title alone without looking at reviews?

> I also note that Python tends to adopt the best packages into the standard library...

Perl core developers do include useful things as well, but they are fairly strict about which ones, since they prefer to leave them on CPAN so they can be developed and released at a faster pace than the core. And in fact, the core is increasingly being viewed merely as a tool to access CPAN.

Re: Why Perl?

#58
post #27

Earlier quoted context omitted.

"In Ruby, ordinary variables lack sigils, but "$" is prefixed to global variables, "@" is prefixed to instance variables, and "@@" is prefixed to class variables."[0] Okay, I don't know Ruby well enough to know if these are commonly used features, but the statement that there are no sigils is false. [0] http://en.wikipedia.org/wiki/Sigil_(computer_programming)#La...

Ruby even uses some predefined globals (eg $_) that are pretty much straight out of Perl. http://www.tutorialspoint.com/ruby/ruby_predefined_variables...

Ruby even uses some predefined globals (eg $_) that are pretty much straight out of Perl.

They exist, and while I'm a fan of $: over $LOAD_PATH I don't think I've even seen $_ used in the wild.

Re: Why Perl?

#60
post #43
post #12

I've said it before and I'll say it again: other imperative scripting languages feel like incomplete subsets of Perl. And the community is fantastic.

This is the language that doesn't have proper function arguments, exceptions, objects, etc, and you're calling OTHER languages a subset? Sorry, I just don't see it. What exactly is so awesome in Perl that isn't easily done in Python/Ruby/Scala/D/Haskell?

> proper function arguments

  my ($a, $b, $c) = @_; # this works
Or I can do things like

  my ($first, @rest) = @_;
giving me features which require all manner of annoying syntax in Python.

> exceptions

http://search.cpan.org/~nilsonsfj/Error-TryCatch-0.07/lib/Er...

or just eval and see what the output is.

> objects

Edit: I was being an asshole Perl has a decent object system out of the box and Moose for those times when you want type constraints.

  package MyClass;
  use base 'Parent';
  
  sub new { my $class = shift; bless { prop1 => undef },   $class; }
  
  package main;

  my $obj = new MyClass;
> etc

Lexical scoping, anonymous coderefs that can be passed as data, modifiable syntax, reference semantics, and the regex engine I see other languages comparing theirs too.

Post reply on HN