Live data from Hacker News

Why Did I Choose Perl When Building Crowdtilt?

dsog.info

111–120 of 143 posts

Re: Why Did I Choose Perl When Building Crowdtilt?

#111
post #102

I'm writing to beginner programmers. Please, please don't use Perl. Use Ruby and/or Python. Other competing scripting might be good (like lua) but I haven't used them. I do know however Ruby and Python are better. see https://sites.google.com/site/steveyegge2/ancient-languages-... 90% still holds true. This guy knows more than 99% of the Perl advocates on this thread (he's also smarter than me). Do another search on…

Wow. A five-paragraph I-hate-Perl rant by someone who obviously neither knows the language nor wants to.

Though I probably wouldn't recommend Perl as a first language for everybody either, that's some pretty weak arguments. Appeal to authority of other Perl haters only proves Perl haters exist.

For crying out loud, Perl doesn't have exposed pointers. Perl doesn't prevent the programmer from doing basic parameter checking in functions. Decent REPLs are available for Perl. How could "the Perl REPL" not work with readline if he just said there wasn't a Perl REPL in the previous sentence? Perl doesn't have the same opinion as him as to what sane typing is. Doing stupid stuff results in undefined (to him, at least) behavior. It's possible to implement action-at-a-distance in Perl.

Python and Ruby have their warts too, they're just not exposed in this thread because there's no hater around to quote out-of-context lists of surprising behavior.

Arguing not to learn Perl because the average Perl out there is ugly? Non sequitur. No one with an open mind blah blah blah? I've got opposing data points. (not to mention the true scotsman)

Particularly ironic to quote that MJD text from almost twelve years ago. All of the behavior he described, I can now mostly observe from Python self-appointed champions.

And now on HN as well.

(I'm not saying you have to use Perl. I'm just saying dismissing it for the "reasons" listed in parent post doesn't make sense.)

Re: Why Did I Choose Perl When Building Crowdtilt?

#113

Earlier quoted context omitted.

Yes, the sigils can make Perl code look noisy, especially as Perl uses curly braces and semicolons too. However, they do have a couple of nice benefits: firstly, they make variable interpolation easier (and less noisy!) than in other languages like Ruby and Python. Secondly, sigils make it easy to see what kind of data you are dealing with, obviating the need to scroll through your program to the variable declaration…

The sigils make variable interpolation easier only in the most generic case "interpolate $me". Anything more sophisticated requires a temporary variable.

You can avoid using temporary variables with the @{[...]} and ${\...} idioms:

  my $x = 1;

  say "$x + 1 = @{[ $x + 1 ]}"; 

  sub plus1 { $_[0] + 1 }

  say "$x + 1 = ${\plus1($x)}";

Re: Why Did I Choose Perl When Building Crowdtilt?

#114
post #40

Earlier quoted context omitted.

As has been alluded to in another comment: Which other languages that compare to perl have you actually looked at? Python has rich meta-programming. Ruby has (almost) single-handedly super-hyped and re-invented the idea of domain specific languages (DSLs). Lisp is of course all about this (as is Forth). Javascript builds on the ideas from Smalltalk and (especially) Self to allow you to crazy stuff with how objects wo…

"As has been alluded to in another comment: Which other languages that compare to perl have you actually looked at?" I am very familiar with all of the languages that you mention. They are all great languages in their own right. My comment however was about Perl's ability to easily evolve the core language via contributions from its community, as opposed to other languages that require a lenghty process performed by…

I didn't say I had to deal with perl code I didn't understand, just nasty perl code. Of course the coder in question is the problem, not the language as such -- I've just seen more obscure hacked together perl code than eg: python.

I'm perfectly aware this is a subjective opinion: I don't like perl very much. I never claimed everyone else should dislike perl -- in fact I stated the opposite -- I see why it appeals to some people.

> My comment however was about Perl's ability to easily evolve the core language via contributions from its community, as opposed to other languages that require a lenghty process performed by the core maintainers of the language.

> "Python has rich meta-programming." >> Who cares? So do most modern languages.

Well, your claim is that perl has strong meta programming, and that perl programmers use it -- implying that eg: python programmers choose not to, and rather sit on their hands waiting for Guido to bless their new data structure or syntactic sugar for improving arrays?

See eg: http://www.python.org/dev/peps/pep-0218/

I suppose this your "lengthy process" ? But the set module was available before it became part of the core language, so if you were the programmer that needed a new datatype nothing stopped you from implementing it and uploading it to the package index? (Although I don't remember quite how well the package index worked back in 2000 -- CPAN certainly has a long and solid history behind it :-)

For another example (again python):

http://kashif.razzaqui.com/30414548 "Javascript's Prototype Inheritance in Python"

As for ruby, note I said "super-hyped". Maybe I should've said "re-introduced", or "introduced to a new generation of programmers", rather than "re-invented".

> It may be strange to you because you are not very familiar with Perl.

Perhaps. I would be very much interested in some examples of the DSLs you speak of. I guess perls regex-handling would lend itself to be used as a poor man's Standard MetaLanguage?

Re: Why Did I Choose Perl When Building Crowdtilt?

#115

Earlier quoted context omitted.

Yes, the sigils can make Perl code look noisy, especially as Perl uses curly braces and semicolons too. However, they do have a couple of nice benefits: firstly, they make variable interpolation easier (and less noisy!) than in other languages like Ruby and Python. Secondly, sigils make it easy to see what kind of data you are dealing with, obviating the need to scroll through your program to the variable declaration…

I've not touched Perl aside from modifying and using basic scripts for process automation and administration tasks. But since you called-out Python and Ruby, I'm curious what you meant. In Python, for example, interpolation would look like: print "I ate a %s for %s" % ('banana', 'lunch) (or the newer way with nominally more keystrokes) print "I ate a {0} for {1}".format('banana', 'lunch') I've done plenty of PHP work…

"This is %(adjective)s readable Python in %(genetive)s opinion" % {"adjective":"more", "genetive":"my"}

> 'This is more readable Python in my opinion'

edit: variable names

Also, I agree that for this simple case, perl (and other's) simple dollar substitution is nicer.

Re: Why Did I Choose Perl When Building Crowdtilt?

#116
post #115

Earlier quoted context omitted.

I've not touched Perl aside from modifying and using basic scripts for process automation and administration tasks. But since you called-out Python and Ruby, I'm curious what you meant. In Python, for example, interpolation would look like: print "I ate a %s for %s" % ('banana', 'lunch) (or the newer way with nominally more keystrokes) print "I ate a {0} for {1}".format('banana', 'lunch') I've done plenty of PHP work…

"This is %(adjective)s readable Python in %(genetive)s opinion" % {"adjective":"more", "genetive":"my"} > 'This is more readable Python in my opinion' edit: variable names Also, I agree that for this simple case, perl (and other's) simple dollar substitution is nicer.

Since there was a mention of extending the language in this thread, there's also:

http://lfw.org/python/Itpl.html

Re: Why Did I Choose Perl When Building Crowdtilt?

#117
post #40

Earlier quoted context omitted.

As has been alluded to in another comment: Which other languages that compare to perl have you actually looked at? Python has rich meta-programming. Ruby has (almost) single-handedly super-hyped and re-invented the idea of domain specific languages (DSLs). Lisp is of course all about this (as is Forth). Javascript builds on the ideas from Smalltalk and (especially) Self to allow you to crazy stuff with how objects wo…

So, you acknowledge that your experience with Perl is outdated, yet you're sticking to your guns.

The particular claim was that Perl programmers extend the core language via Perl's ability to do meta-programming and that Perl is more flexible than other (comparable) languages. Further clarification with regards to DSLs show that the poster meant that Perl has been more flexible for quite some time (before Ruby hit in the western world) -- ie: from the time that I did look at Perl rather seriously.

At that time there were already quite a lot of movement within eg: python with improvements being made to the language, in the language itself.

So, yes, I guess I'm sticking to my guns.

Re: Why Did I Choose Perl When Building Crowdtilt?

#118
post #84
post #71

Earlier quoted context omitted.

Verbosity. class Point { has Int $.x is rw; has Int $.y is rw; method clear() { $.x = 0; $.y = 0; } } :)

Perl 6 is / will be sweet :)

Perl 6 is sweet, and will be sweeter when it has better performance. :)

Re: Why Did I Choose Perl When Building Crowdtilt?

#119
post #114

Earlier quoted context omitted.

"As has been alluded to in another comment: Which other languages that compare to perl have you actually looked at?" I am very familiar with all of the languages that you mention. They are all great languages in their own right. My comment however was about Perl's ability to easily evolve the core language via contributions from its community, as opposed to other languages that require a lenghty process performed by…

I didn't say I had to deal with perl code I didn't understand, just nasty perl code. Of course the coder in question is the problem, not the language as such -- I've just seen more obscure hacked together perl code than eg: python. I'm perfectly aware this is a subjective opinion: I don't like perl very much. I never claimed everyone else should dislike perl -- in fact I stated the opposite -- I see why it appeals to…

Well, ok -- I guess (after a bit more googling) I see what you mean:

http://www.catalyzed.org/2009/05/dawn-of-a-new-age-in-perl-h...

Now, while power obviously is power -- I don't see many immediate uses for that, that can't be done better within in python via magic methods etc.

But in case others are interested, here's a couple of links I also came across:

http://stackoverflow.com/questions/214881/can-you-add-new-st...

http://eli.thegreenplace.net/2010/06/30/python-internals-add... (Most definitely in the "don't do that"-category from a python point of view :)

If this (writing a new language) is really what you want, you would probably be better off playing with pypy and its restricted python, though:

https://bitbucket.org/brownan/pypy-tutorial/src/8cfb3cd72515... (Tutorial for writing your own interpreter with rpython)

https://bitbucket.org/cfbolz/pyrolog/src/aa127d31df0c/prolog... Working implementation of Prolog, built with pypy/rpython

Re: Why Did I Choose Perl When Building Crowdtilt?

#120
post #117

Earlier quoted context omitted.

So, you acknowledge that your experience with Perl is outdated, yet you're sticking to your guns.

The particular claim was that Perl programmers extend the core language via Perl's ability to do meta-programming and that Perl is more flexible than other (comparable) languages. Further clarification with regards to DSLs show that the poster meant that Perl has been more flexible for quite some time (before Ruby hit in the western world) -- ie: from the time that I did look at Perl rather seriously. At that time th…

And, incidentally, I was wrong:

http://news.ycombinator.com/item?id=4463536

Post reply on HN