Live data from Hacker News

Perl is 26 Today

modernperlbooks.com

131–140 of 194 posts

Re: Perl is 26 Today

#131
post #121

Earlier quoted context omitted.

I'm sorry if that wasn't clear, sharing doesn't only mean "making the data available" but also means high performance and direct access. Quite simply though: If you can't imagine different use profiles that make certain multi-processing paradigms better suited than others, then you shouldn't be having this discussion and should be getting more experience outside of what you're doing right now.

I'm just pointing what's solved the problem for me, and how it can be useful for others. I'm aware there's a performance overhead. > If you can't imagine different use profiles that make certain multi-processing paradigms better suited than others, then you shouldn't be having this discussion and should be getting more experience Conversely, there's also a huge gain in architectural simplicity which I hope you are aw…

I'm not saying i can't tell you, i'm saying i don't have the patience. I could throw the book at you and the library besides, but you showed quite clearly that you lack the experience to know which problems multi-threading solves. This means that both of our time is better used if you went and got the experience. I don't want you to shut up, i want you to go and learn something.

On the other hand, yes, i am an asshole. That's why i'll suggest you try and build a minecraft clone with a multi-process/single-thread solution

PS:

> Conversely, there's also a huge gain in architectural simplicity which I hope you are aware of. Though you have neither acknowledged nor disproven that yet

I absolutely said so. I expressed quite clearly that different multi-processing solutions apply to different categories of problems, which of course means that there are problems which simple, plain multi-process solutions excel at, for example webservers.

Re: Perl is 26 Today

#132

So when I went to Google I learned Python. I enjoyed the language and used it a lot, it has a solid support base and pretty much anything you wanted to do you could import a module to do it. When I went to Blekko they were a perl shop, which was a bit intimidating at first, but after programming in it for nearly 4 years now I find I can get from concept to first test faster in Perl than I could in Python. And I hadn'…

Can you please expand a bit on "Python for multithreaded things"? My understanding was that Python interpreter has a GIL, which limits the concurrency and performance.

Python has a standard library called multiprocessing [1] that uses multiple processes (surprise!) to get around the GIL.

[1]: http://docs.python.org/2/library/multiprocessing.html

Re: Perl is 26 Today

#133

So when I went to Google I learned Python. I enjoyed the language and used it a lot, it has a solid support base and pretty much anything you wanted to do you could import a module to do it. When I went to Blekko they were a perl shop, which was a bit intimidating at first, but after programming in it for nearly 4 years now I find I can get from concept to first test faster in Perl than I could in Python. And I hadn'…

Can you please expand a bit on "Python for multithreaded things"? My understanding was that Python interpreter has a GIL, which limits the concurrency and performance.

> My understanding was that Python interpreter has a GIL, which limits the concurrency and performance.

Python is in that respect essentially the same as Perl with Coro built-in. ( https://metacpan.org/pod/Coro )

Re: Perl is 26 Today

#134
post #97

Was introduced to Perl in a programming languages course in college in 1996/1997. Brought it to my first job, where it gained fame there for being the language that took a 12 hour process and ran it in less than a minute. (They had originally been trying to parse a huge log file with Visual Basic, I believe it was. Perl was made for, well, extraction and reporting...) Been programming in it full time ever since. Than…

One of my favorite Perl books, albeit a bit lesser-known is "Higher Order Perl" by Mark Jason Dominus.

Re: Perl is 26 Today

#135
post #113

Earlier quoted context omitted.

Could you explain what features or aspects made it quicker to get up and running with? I love Python and have never worked with a language that I felt let me get features out so quickly. Do you feel you've sacrificed readability as well? I've heard Perl is notorious for having a million ways to do everything, making reading it hard.

perl is more connected to things flowing through it. In python I was often fighting with the subprocess module to get things plumbed but in perl it was trivial to open a process to a pipe and then put a process on the output of that pipe. Much of the code I've written here does analysis for bad actors (robots and such) and perls regular expressions have been easier to get right sooner. (although the naming of results…

> although the naming of results in Python is quite useful

I assume you mean named captures?

    C:\>perl -E "'abc1234asf' =~ /(?\d+)/; say $+{one};"
    1234
> template toolkit

Please try Text::Xslate. :)

Re: Perl is 26 Today

#136
post #121

Earlier quoted context omitted.

I'm just pointing what's solved the problem for me, and how it can be useful for others. I'm aware there's a performance overhead. > If you can't imagine different use profiles that make certain multi-processing paradigms better suited than others, then you shouldn't be having this discussion and should be getting more experience Conversely, there's also a huge gain in architectural simplicity which I hope you are aw…

I'm not saying i can't tell you, i'm saying i don't have the patience. I could throw the book at you and the library besides, but you showed quite clearly that you lack the experience to know which problems multi-threading solves. This means that both of our time is better used if you went and got the experience. I don't want you to shut up, i want you to go and learn something. On the other hand, yes, i am an asshol…

By no means would I try and build a high bandwidth graphics pipeline that runs between processes. That's a very specific problem requiring a very specific solution. However it wouldn't be correct to abandon multiple process single thread for the (much more common, particularly on HN) situation of a web app that's running on a server with multiple logical cores in non-evented programming language.

> I expressed quite clearly that different multi-processing solutions apply to different categories of problems, which of course means that there are problems which simple, plain multi-process solutions excel at, for example webservers.

When? Please quote.

Re: Perl is 26 Today

#137

I'm a relatively new programmer. Been programming for around 4 years. I tried Perl, but felt like the world had moved on, so I never really committed to it. With PHP, Python, Ruby and Javascript... space seems tight for another scripting language. Languages like Lua have something special. What's special about Perl? Edit: I don't want to be hateful. The more the merrier obviously.

[deleted]

Re: Perl is 26 Today

#138

Earlier quoted context omitted.

Sorry for being petty, but what's this creeping pattern of folk leading with "So"? It reads poorly and sounds even worse.

It is a reasonable question. I tend to write like I talk, which the Chicago manual of style frowns upon. It isn't a particularly 'creeping' pattern, it is quite common amongst people with whom I have regular informal conversations. That said[1], I probably feel the same way about the use of 'because' in informal speech. Which was recently upgraded to include the form "because ." I don't find that a particularly compe…

There was a recent album release called "Because the internet". Absolutely horrific :-)

---

I think what gets me about leading with "So" (more so in spoken converstaion) is that it makes the speaker sound like they're constantly, and consciously, having to reframe things in a form that the poor dummy they're speaking to will understand.

Politicians do it a lot when answering questions.

I also recognise that it's more innocently used when telling a story.

Re: Perl is 26 Today

#139
post #136

Earlier quoted context omitted.

I'm not saying i can't tell you, i'm saying i don't have the patience. I could throw the book at you and the library besides, but you showed quite clearly that you lack the experience to know which problems multi-threading solves. This means that both of our time is better used if you went and got the experience. I don't want you to shut up, i want you to go and learn something. On the other hand, yes, i am an asshol…

By no means would I try and build a high bandwidth graphics pipeline that runs between processes. That's a very specific problem requiring a very specific solution. However it wouldn't be correct to abandon multiple process single thread for the (much more common, particularly on HN) situation of a web app that's running on a server with multiple logical cores in non-evented programming language. > I expressed quite…

> it wouldn't be correct to abandon multiple process single thread

I never said that should be done and in fact mentioned that as a solution/problem pair, see the bit about webservers in the PS of my previous comment. :)

(A web app is just a specialized webserver.)

> When? Please quote.

I did so in a much more concise form here:

> different use profiles that make certain multi-processing paradigms better suited than others

Re: Perl is 26 Today

#140

Earlier quoted context omitted.

It prints the greater variable between $x and $y. [$x => $y] creates an array reference. => is just a fancy syntax for a comma. So its actually [$x, $y]. [$x => $y]-> dereferences the array ref. $x Sorry if I'm unable to explain properly! Here's a script. #!/usr/bin/perl use strict; use warnings; my $x = 8; my $y = 9; print [ $x => $y ]->[ $x

- Why not just write ',' instead of '=>'? Is there an actual reason for this other syntax to exist and to be used? - Why does the array have to be explicitly dereferenced? Isn't it obvious from context? - Why count on the mapping from boolean to int being false = 0, true = 1? Pretty much everything other language that has such a mapping does false = 0, true != 0. In one line, a vivid reminder of why I find perl so aw…

Why not just write ',' instead of '=>'? Is there an actual reason for this other syntax to exist and to be used?

It's a trick so it's easier to remember because while both sections look similar, the operators between them are actually doing different things.

i.e. => is a fatarrow (comma), while with , results in

[ $x , $y ]->[ $x Which is, arguably, less easy to remember.

Why does the array have to be explicitly dereferenced? Isn't it obvious from context?

Probably because the first set or brackets is an array reference creation and the second is an array reference subscript? There may be rules that need to be followed for the language to be parseable?

Why count on the mapping from boolean to int being false = 0, true = 1? Pretty much everything other language that has such a mapping does false = 0, true != 0.

Perl's comparison operators return numerical outputs for true/false, as that's how Perl handles true/false. What value would you expect for true, if there isn't a dedicated type?

In one line, a vivid reminder of why I find perl so awful

Eh, not my preferred syntax either. I do find that it's possible cool though.

Post reply on HN