Live data from Hacker News

Why Perl?

bits.shutterstock.com

101–110 of 118 posts

Re: Why Perl?

#101
post #99

Earlier quoted context omitted.

> I'd like to reply to your Unicode link with another link: > > http://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default/6163129#6163129 To which i have to say that both the Great Unicode Shootout as well as that answer are written by the same person. The point being: Yes, Perl's Unicode support is not perfect. But honestly? It's still the best you can get out there. > >Exceptions are bu…

Thanks for your answer. I'm very aware how to search an array in Perl. I really concentrated to much on searching in my text, whereas the critic should have been for array handling in general which i find far more inferior to other languages. From my other comment: Example: Looking for an element and deleting it? (Taken from perlmonks.org) my @array = qw( your array here ); my $search_for = "here"; my( $index )= grep…

I guess i'll have to repost this here. :)

The correct answer should've been:

   @list = grep { $_ ne 'dogfood' } @list;

Re: Why Perl?

#102
post #98

Earlier quoted context omitted.

Ok, more responses: > i can't say i love the language at all That is a sample of one. Try visiting a YAPC and you'll see a sample of 1000+ that is opposite to your's. >> often can find the core developers in charge of some code > i browsed a lot through CPAN and a huge part of modules hasn't been touched for years What you said has nothing to do with what you quoted. CPAN allows you to email those authors and the vas…

> That is a sample of one. Try visiting a YAPC and you'll see a sample of 1000+ that is opposite to your's. Sure, i never said that no one likes Perl. I'm well aware that many people like Perl. This may sound harsh, but here is my impressions of the people i've personally talked to that use Perl (please don't take that personal, i'm well aware that there are A LOT of good programmers out there): - Typically too lazy…

Regarding the "perl5 not in parrot" citation, i found some pretty good hints at this problem:

From the Perl Wikipedia page:

It is often said that "Only perl can parse Perl",[49] meaning that only the Perl interpreter (perl) can parse the Perl language (Perl), but even this is not, in general, true. Because the Perl interpreter can simulate a Turing machine during its compile phase, it would need to decide the Halting Problem in order to complete parsing in every case. It's a long-standing result that the Halting Problem is undecidable, and therefore not even perl can always parse Perl. Perl makes the unusual choice of giving the user access to its full programming power in its own compile phase. The cost in terms of theoretical purity is high, but practical inconvenience seems to be rare. Other programs that undertake to parse Perl, such as source-code analyzers and auto-indenters, have to contend not only with ambiguous syntactic constructs but also with the undecidability of Perl parsing in the general case. Adam Kennedy's PPI project focused on parsing Perl code as a document (retaining its integrity as a document), instead of parsing Perl as executable code (which not even Perl itself can always do). It was Kennedy who first conjectured that "parsing Perl suffers from the 'Halting Problem'",[50] which was later proved.[51]

Also interesting is the proof that Perl cannot be parsed:

http://www.jeffreykegler.com/Home/perl-and-undecidability

In general the saying "only perl can parse perl" has to have some root... http://www.google.de/search?q=%E2%80%9COnly+Perl+can+parse+P...

Re: Why Perl?

#103
post #102
post #98

Earlier quoted context omitted.

> That is a sample of one. Try visiting a YAPC and you'll see a sample of 1000+ that is opposite to your's. Sure, i never said that no one likes Perl. I'm well aware that many people like Perl. This may sound harsh, but here is my impressions of the people i've personally talked to that use Perl (please don't take that personal, i'm well aware that there are A LOT of good programmers out there): - Typically too lazy…

Regarding the "perl5 not in parrot" citation, i found some pretty good hints at this problem: From the Perl Wikipedia page: It is often said that "Only perl can parse Perl",[49] meaning that only the Perl interpreter (perl) can parse the Perl language (Perl), but even this is not, in general, true. Because the Perl interpreter can simulate a Turing machine during its compile phase, it would need to decide the Halting…

Oh yes. I am perfectly aware of the impossibility of static analysis of Perl. You do have to execute Perl in order to be able to say definitely what any Perl construct will mean.

I'm just confused how this precludes inclusion of Perl5 in Perl6.

Re: Why Perl?

#104
post #98

Earlier quoted context omitted.

> That is a sample of one. Try visiting a YAPC and you'll see a sample of 1000+ that is opposite to your's. Sure, i never said that no one likes Perl. I'm well aware that many people like Perl. This may sound harsh, but here is my impressions of the people i've personally talked to that use Perl (please don't take that personal, i'm well aware that there are A LOT of good programmers out there): - Typically too lazy…

> And you don't believe how many people like this are out > there (not related to Perl, but in every area)! This is the core point i was making. You have people who couldn't care less about their tool in every human endeavour. You knowing some doesn't mean that on average Perl devs don't love it. To elaborate a bit more: At my last $work i was in a team of four, who preferred to use bash for most things. This however…

I think we have reached the depth of discussion threads on HN, so i'd like to thank you and tzs for your comments and this (imo) good discussion.

The use of map is nice, BUT it shows partially what is wrong:

1. there are too many non-obvious ways to do simple things (this means that out of 10 programmers you will typically see 10 different solutions to a simple problem)

2. i have a problem with using functions for "different" usecases as what their name implies.. in my world eval simply evaluates code and map is short for "apply function to every item" not "filter out an item"

- i hate doing "go over every item in a list and execute a function that returns the item if it is not 'dogfood' and return that new list, overwriting the original one" when all i want is "delete 'dogfood' from my list"

As good as your answers were, you've shown me some good points and that your community indeed is very helpful, i am not convinced of this language. Both of you said yourself that there are quirks in the language. "still try to decide what exceptions look like" after how many years of perl? That was my thought ;)

At the end of the day i will still try to find and fix bugs in other peoples perl code, curse frequently and hope that people move on to the next language..

Re: Why Perl?

#105

Earlier quoted context omitted.

> you'll see that Perl 5 is far from stagnant. You mean CPAN is far from stagnant. CPAN is nice, yes, but I don't think CPAN alone is enough to invite newcomers to Perl. Perl 5 itself is stagnant. New features are not developed in Perl 5 but Perl 6. Perl 6 ist still not mature after several years of development. I tried it on Parrot yesterday, it ran way slower than Perl 5. Who ever would use it when even the Perl ad…

> Perl 5 itself is stagnant. I'm sorry to say, but you're merely showing that you're not aware of core development of Perl. Not a mistake of your's, mind, marketing of perl core dev is terrible and i need to start fixing that, but there's a lot going on: https://github.com/stevan/p5-mop http://perl5.git.perl.org/perl.git/shortlog http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/ http://perldoc.perl.org/index-hi…

> marketing of perl core dev is terrible

A link "Current Developments" in perl.org would be helpful. Thanks for the links but I'm not interested in minor changes of Perl 5 (Unicode etc.). I was very interested in the new features of Perl 6.

No matter, I lost my patience and left Perl years before and returned into the Lisp and Scheme world where I was before. Sometimes I still use Perl 5 but merely for small scripts.

Perl 6 got stuck in Parrot while Lisp enjoys a revival in Clojure, Qi/Shen and Racket Scheme which are all usable and under heavy development.

The new Lisp versions support multiprocessors and compile to JVM, Javascript (V8), Lisp, Scheme or C. Lisp and Scheme macros are still superior. In Qi/Shen I can even write attribute grammars in BNF style. I can compile my source to standalone native EXE files which are really fast. For that reason I prefer Scheme and Lisp over Python and Ruby. I don't need Perl 6 anyymore!

Re: Why Perl?

#106
post #92
post #44

My perspective on Perl is that it's like a Dremel tool. If you've ever had a household project that requires a tool you don't have or skill you don't know, you can usually take your Dremel out, dig through the gift pack of attachments that you received for Christmas, and find a way to do what you need to do. Will the results be pretty? No. Is it the best way to get the job done? Probably not -- but it's good enough.…

> My perspective on Perl is that it's like a Dremel tool. Or, perhaps less literally, like a Swiss-Army chainsaw. http://catb.org/jargon/html/S/Swiss-Army-chainsaw.html

That's great... I somehow never ran into that before. Thanks!

Re: Why Perl?

#107
post #104

Earlier quoted context omitted.

> And you don't believe how many people like this are out > there (not related to Perl, but in every area)! This is the core point i was making. You have people who couldn't care less about their tool in every human endeavour. You knowing some doesn't mean that on average Perl devs don't love it. To elaborate a bit more: At my last $work i was in a team of four, who preferred to use bash for most things. This however…

I think we have reached the depth of discussion threads on HN, so i'd like to thank you and tzs for your comments and this (imo) good discussion. The use of map is nice, BUT it shows partially what is wrong: 1. there are too many non-obvious ways to do simple things (this means that out of 10 programmers you will typically see 10 different solutions to a simple problem) 2. i have a problem with using functions for "d…

I do appreciate the grace you've shown in replies.

> 1. there are too many non-obvious ways to do simple things

To a person who learned Lisp first your pythonish ways would be similarly non-obvious. Obviousness depends always on previous knowledge and you seem to know a lot about python; and as such expect things to operate like there.

Consider how confused a foreigner would be when he hears the word "bowling" and does not know about the sport and thinks it has to do with bowls.

> map is short for "apply function to every item" not "filter out an item" - i hate doing "go over every item in a list and execute a function that returns the item if it is not 'dogfood' and return that new list, overwriting the original one" when all i want is "delete 'dogfood' from my list"

But that is what filter does. Literally, there is no other way to implement this, unless you're operating with linked lists, which are not arrays. Filter is a map with a negated search func - wait, i'm an idiot. it should've been grep. But yeah, filter is just a grep with a negated search function.

  @list = grep { $_ ne 'dogfood' } @list;
Let me ask you a question though. In Perl, if i have a list of objects representing links and i want to remove all SSL links, i can do this:

  @links = grep { $_->protocol ne 'https' } @links;
How would i implement this in python? Does array.remove() accept lambdas as parameter? Or would i need to go another way?

> At the end of the day i will still try to find and fix bugs in other peoples perl code, curse frequently

Good luck and hop by on IRC! It will increase your curse frequency a LOT. (Until you meet mst and start to pick things up from him.)

Re: Why Perl?

#108

Earlier quoted context omitted.

> Perl 5 itself is stagnant. I'm sorry to say, but you're merely showing that you're not aware of core development of Perl. Not a mistake of your's, mind, marketing of perl core dev is terrible and i need to start fixing that, but there's a lot going on: https://github.com/stevan/p5-mop http://perl5.git.perl.org/perl.git/shortlog http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/ http://perldoc.perl.org/index-hi…

> marketing of perl core dev is terrible A link "Current Developments" in perl.org would be helpful. Thanks for the links but I'm not interested in minor changes of Perl 5 (Unicode etc.). I was very interested in the new features of Perl 6. No matter, I lost my patience and left Perl years before and returned into the Lisp and Scheme world where I was before. Sometimes I still use Perl 5 but merely for small scripts.…

I linked you to a repo where a meta object protocol for the perl core is being developed and you say you aren't interested in minor changes?

Shine on you crazy diamond! :D

Re: Why Perl?

#109
post #104

Earlier quoted context omitted.

I think we have reached the depth of discussion threads on HN, so i'd like to thank you and tzs for your comments and this (imo) good discussion. The use of map is nice, BUT it shows partially what is wrong: 1. there are too many non-obvious ways to do simple things (this means that out of 10 programmers you will typically see 10 different solutions to a simple problem) 2. i have a problem with using functions for "d…

I do appreciate the grace you've shown in replies. > 1. there are too many non-obvious ways to do simple things To a person who learned Lisp first your pythonish ways would be similarly non-obvious. Obviousness depends always on previous knowledge and you seem to know a lot about python; and as such expect things to operate like there. Consider how confused a foreigner would be when he hears the word "bowling" and do…

I'll visit that channel when back from vacation for sure.

To do what you want you could use list comprehensions or the filter(function, sequence) function:

List comprehension:

  links = ["https://securesite.com", "http://unsecuresite.com", "https://sec2.com", "http://unsec2.com"]
  [url for url in links if not url.startswith("https")]
  >>> ['http://unsecuresite.com', 'http://unsec2.com']
filter() + lambda:

  links = ["https://securesite.com", "http://unsecuresite.com", "https://sec2.com", "http://unsec2.com"]
  filter(lambda url: not url.startswith("https"), links)
  ['http://unsecuresite.com', 'http://unsec2.com']
I'd go with the list comprehension, from your use of map i'd guess you'd go with the filter ;)

Of course you'd replace the url.startswith with whatever your criteria is.

Re: Why Perl?

#110
post #109

Earlier quoted context omitted.

I do appreciate the grace you've shown in replies. > 1. there are too many non-obvious ways to do simple things To a person who learned Lisp first your pythonish ways would be similarly non-obvious. Obviousness depends always on previous knowledge and you seem to know a lot about python; and as such expect things to operate like there. Consider how confused a foreigner would be when he hears the word "bowling" and do…

I'll visit that channel when back from vacation for sure. To do what you want you could use list comprehensions or the filter(function, sequence) function: List comprehension: links = ["https://securesite.com", "http://unsecuresite.com", "https://sec2.com", "http://unsec2.com"] [url for url in links if not url.startswith("https")] >>> ['http://unsecuresite.com', 'http://unsec2.com'] filter() + lambda: links = ["https…

Ah, that's kinda what i expected. Suddenly the two languages look fairly similar, no? :)

Also, list comprehension doesn't look bad to me. It's just a slightly weird and more verbose syntax of doing map, while filter does an in-place operation.

Post reply on HN