Live data from Hacker News

Perl is 26 Today

modernperlbooks.com

121–130 of 194 posts

Re: Perl is 26 Today

#121
post #84

Earlier quoted context omitted.

shrug The queue module takes complex data structures, provides them to processes, which when finished doing whatever they do, send them back to other queues and in turn more processes. It works, complex data structures are being shared. There's no nightmarish locking issues. Not sure what else you want. Are you entirely sure you're not discounting the solution because It's Not What Java Does?

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 aware of. Though you have neither acknowledged nor disproven that yet - based on your last comment, I think this is because you are an asshole. That's not an ad hominem attack, but rather an assessment of your personality after conversing with you here.

I have tried discussing with you technically, and not acknowledging other's points, then responding with "if you can't imagine my points, I can't tell you" is not how a rational, polite adult with a technical viewpoint converses with others.

Re: Perl is 26 Today

#122

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'…

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

Re: Perl is 26 Today

#123

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 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.

I can't wrap my mind around this complaint. "Why should you count on Perl treating booleans the way Perl treats booleans? Other languages don't treat booleans the way Perl treats booleans, so obviously you shouldn't rely on Perl treating booleans the way Perl treats booleans."

It's almost as if there were some democratic notion of boolean semantics where every language you know gets one vote.

Re: Perl is 26 Today

#124

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'…

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

Here's more information on the linguistic development of starting sentences with 'So':

http://chronicle.com/blogs/linguafranca/2011/12/02/so-it-tur...

Re: Perl is 26 Today

#125

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…

This is obviously written to be clever/cute, not readable. If you just wanted the max of something, you could just write: $x > $y ? $x : $y; (This is the ternary operator borrowed from C, which still is a little confusing.) You could also just use an if / else statement, or write your own min/max functions. Or you can use min() and max() functions imported from List::Util module which can return the min/max from an entire list: http://timmurphy.org/2012/02/01/min-and-max-functions-in-per...

Re: Perl is 26 Today

#126

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.

Re: Perl is 26 Today

#127
post #113

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'…

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 in Python is quite useful).

When I was at Google I started using Python to create a CMS of sorts for my toy website (robotics.mcmanis.com) which got to the point of being able to push some stuff but more complex stuff was a pain. So it sat there. Then rebuilding that with perl and the template toolkit it was a bit easier and I was much happier with the result. I still don't have a lot of time for it (like none for the last few months) but I got the framework for putting up a new "article" down to a pretty smooth process and managing all the internal links worked well.

Perhaps it is that I programmed in C for so long that my synapses are more attuned to reading code with braces. But I find I can look at perl and intuit its function much more quickly than I can do the same for Python.

Re: Perl is 26 Today

#128

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'…

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 compelling upgrade.

[1] Another habitual favorite of mine.

Re: Perl is 26 Today

#129
post #111
post #99

Earlier quoted context omitted.

Dancer or Mojolicious are more like Sinatra or Flask, not like Rails or Django

Indeed. Perl does have Jifty and Gantry which do have out of the box support for the M part of MVC, but for whatever reasons they never became as popular as Django/Rails.

With perl I always include the M inside my application class/module.

And I use only VC from the web framework.

That way, i get thin controllers only for url mapping which in that case will access my application class/module instance.

Thats where the real code will be, in my application and not-in-the-web-framework.

With this environment its easy to switch and test other web frameworks avaliable because i will only need to create the thin controllers and re-use my templates. Plus, when i need a cronjob, i use my application without the VC.

In the end the real deal is: dont tie your application with webframeworks. Always use the M inside the application and from the web framework use VC only with thin controllers.

Put the real code inside the aplication. Make the framework use the application. Dont make the framework your application.

follow me @ https://github.com/hernan604

Re: Perl is 26 Today

#130

Earlier quoted context omitted.

I would say "pretty fantastic" is an understatement...CPAN is the gold standard of library support

Maybe, for the modules that build and actually have useful documentation. That seemed to me to be depressingly uncommon.

What platform are you on? I can't remember the last time I tried to install a module on a modern Linux distribution and had problems with it. Docs might be weaker than I'd like in some cases, mostly because of not enough examples (the curse of most documentation, IMHO).

I don't develop on Windows or Mac, since I work on server-side software, so I might just be blissfully ignorant of a serious problem.

Post reply on HN