News for hackers. Stuff that matters.
Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @10:57AM (#16214526)
Perl Pessimism: https://trends.google.com/trends/explore?date=all&q=perl

I have happy memories of Perl, and it started me on the path that led to a nice career of Python awesomeness. Thanks, Perl! That said, I can't imagine a plausible scenario where I'd ever consider using it again. I almost certainly wouldn't use it professionally because it's not exactly going to light up a resume. Yes, there are still Perl shops. But no, there aren't very many of them, and I'd be highly suspicious of an engineering department still writing new code in it today without a very good reason.

Re:Perl 6 Optimism by kamaal on Tuesday January 23, 2018 @12:20PM (#16215246)
>>Yes, there are still Perl shops. But no, there aren't very many of them

That's because any shop that needs to get job done quickly is a Perl shop. During my early career I even knew a architect who had sort of put a blanket ban on any Perl to be written. He was only stumped people were largely acting like pirates, were writing and running directories full of Perl code all the time.

Only a week back, I needed some stuff to be written. Talked to a Java guy, he tells me he can do it in a week. Told him to never mind. Went back to my desk and wrote in a afternoon in Perl. And we are a Java shop and write Java most of the time. But its just that Perl is unbeatable in getting things done.

And yeah Python. It doesn't even remotely hold a candle to Perl in terms of practicality and getting things done. Readability and all that, but frankly beyond that there is nothing in Python. Not even multiline lambdas, half baked, half implemented functional programming features. IO looks like somebody held a gun to the implementors head and he added it because he had to.

Some times I even find, sed and awk to be a million times more useful than Python.

Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @12:31PM (#16215360)
> That's because any shop that needs to get job done quickly is a Perl shop.

Be careful with that wild generalization. I’ve seen lots more “get job done quickly” in Ruby than Perl (but neither as much as with Python recently). I have nothing bad to say about Perl, but it’s not really defensible to claim it’s used as commonly as other languages.

Re:Perl 6 Optimism by tomc1985 on Tuesday January 23, 2018 @12:57PM (#16215602)
Just remember there is a lot of perl creeping around the linux ecosystem; it may not be fashionable today but availability of the perl command is still more common than python, second only to bash/sh.
Re:Perl 6 Optimism by tomc1985 on Tuesday January 23, 2018 @12:56PM (#16215587)
HA! That gun-to-the-head bit is so true. Sometimes I feel like the only person who dislikes Python for its design principles.
Re:Perl 6 Optimism by petre on Tuesday January 23, 2018 @11:23AM (#16214732)
We are one of those Perl shops. The reasons why we're still using it are: old codebase started in 2004, >95% rewritten, the language is stable, fast enough and it scaled well for our needs after we rewrote the web services using Mojolicious. I'd also pick Perl any day over PHP or Python.

We also write a fair amount of Javascript on the frontend but moving the backend to Node.js doesn't add any benefits. It just makes things harder, having to track constantly moving targets, using many different tools to accomplish the same jobs, having to fork stuff just to get it to work properly.

Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @12:37PM (#16215424)
That’s on the short list of “oh, that makes sense” reasons.
Re:Perl 6 Optimism by systems on Tuesday January 23, 2018 @01:02PM (#16215670)
"The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."

― George Bernard Shaw

Not all great decisions are rational, follow your heart be happy

For me, Python is an uninspiring language, yet it inspired many people to build great things, a decision that to me, sound so .. irrational

Re:Perl 6 Optimism by emmelaich on Tuesday January 23, 2018 @10:28PM (#16220084)
The trouble with that syllogism is that some take it to mean that all unreasonable men create progress.
Re:Perl 6 Optimism by systems on Wednesday January 24, 2018 @09:24AM (#16222851)
I would even say most unreasonable men fail

Very few succeed, but those who do, make big changes

It is a high risk high reward type of decision

But honestly, Perl 6 is not that bad of bet, there while small, a lively community around it filled with brilliant developers

Re:Perl 6 Optimism by mattgreenrocks on Tuesday January 23, 2018 @11:25AM (#16214761)
I'd advise you to remain curious beyond what's good for your resume, especially if you want to stay sharp and ahead of the curve. Perl 6 has some neat features, particularly around grammars and parsing, that make those tools easier to use for day-to-day problems.
Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @12:35PM (#16215395)
To be sure! I’m not allergic to Perl and I like seeing the cool new stuff going on there. But afterward, I prefer to take those learnings and apply them to work I’m doing in other languages.
Re:Perl 6 Optimism by raiph on Tuesday January 23, 2018 @03:12PM (#16217168)
To begin to transfer P6 grammar/parsing features or techniques to another language you'd have to bundle NQP and one of its backends. Does that sound worthwhile?

Also, how would you handle strings in this other language?

In P6 and its grammar engine, a string is a sequence of characters, where characters are defined as the thing a human thinks of as a character.

Almost all other languages have adopted either a byte or a Unicode codepoint as being equivalent to a character, both of which are really profound problems that are still not being confronted to this day.

For example, the draft docs for Python 3.7 don't even mention characters (by which I mean what a user thinks of as characters, not bytes or codepoints).[1]

[1] https://docs.python.org/3.7/search.html?q=grapheme&check_key...

Re:Perl 6 Optimism by jlg23 on Tuesday January 23, 2018 @01:18PM (#16215846)
If programming languages' impact on resumes would be a sensible metric I had never learned LISPs, prolog or MLs. Those experiences have been the key to many well-paying gigs, even though I more often than not was hired for some mainstream language/stack.

I too would hesitate to use it in a commercial context, but only because its development stalled for 15 years, leaving us with almost no developers that still speak perl and still work in the trenches... perl's cost of adaption in comparison to other dynamic languages skyrocketed :(

Re:Perl 6 Optimism by orev on Tuesday January 23, 2018 @12:04PM (#16215076)
So many things are already written in Perl, so moving to another language just for popularity’s sake unnecessarily introduces another standard in an environment. There might be reasons a new language is needed, but sticking to Perl and Bash, if that’s mostly what your environment has, makes sense in many cases.

The popularity argument only makes sense in regards to hiring new people, which is a fair point.

Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @12:33PM (#16215378)
I don’t disagree with the first part. That’s a legit reason to stick with what you have.

But yes, it is going to make hiring more challenging.

Re:Perl 6 Optimism by 1024core on Tuesday January 23, 2018 @12:09PM (#16215126)
As a former Perl programmer, dabbling in Python, I keep getting reminded how awesome Perl is.

For example: I'm collecting some stats indexed by (small) ints. In Perl, I'd just say

    $collection[$index] = $stat;
Try that in Python when $index is not received in order.

Edit: Fixed typo; meant "$stat" and not "%stat"

Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @12:24PM (#16215279)
In Python:

    dict[index] = stat
...works much the same.
Re:Perl 6 Optimism by arunix on Tuesday January 23, 2018 @01:02PM (#16215665)
The Python version blows up if the slot isn't already populated. The Perl version works in either case (there is a typo in the Perl code though).
Re:Perl 6 Optimism by amyjess on Tuesday January 23, 2018 @01:10PM (#16215750)
Only if you're using a list, not a dict. I just tried it in the REPL:

    >>> foo = {}
    >>> foo[3] = 72
    >>> foo[64] = 80
    >>> foo
    {3: 72, 64: 80}
Re:Perl 6 Optimism by arunix on Thursday January 25, 2018 @08:27AM (#16230591)
The difference is more dramatic once you have two or more dimensions:

    >>> foo = {}
    >>> foo[3][4] = 42
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 3
Compared to:

      DB<1> $foo{3}{4} = 42

      DB<2> x \%foo
    0  HASH(0x7f9f4315c940)
       3 => HASH(0x7f9f432bb148)
          4 => 42
Re:Perl 6 Optimism by pseudalopex on Monday January 29, 2018 @07:34AM (#16257095)

    tree = lambda: collections.defaultdict(tree)
    foo = tree()
    foo[3][4] = 42
Re:Perl 6 Optimism by occams_chainsaw on Tuesday January 23, 2018 @12:28PM (#16215329)
I don't think I'd want or need to try that...
Re:Perl 6 Optimism by zyxzkz on Tuesday January 23, 2018 @01:48PM (#16216193)

     \%stat;
Re:Perl 6 Optimism by cygx on Tuesday January 23, 2018 @01:29PM (#16215980)
Re:Perl 6 Optimism by loggedinmyphone on Tuesday January 23, 2018 @11:50AM (#16214978)
Is there anything "suspicious" about using Perl other than it's not as popular as Python, according to Google Trends?
Re:Perl 6 Optimism by kstrauser on Tuesday January 23, 2018 @12:50PM (#16215536)
No, there’s nothing inherently wrong with it. I’ve run across two distinct sets of Perl mongers, though:

- “We have lots of deployed code and don’t want to rewrite the whole thing.” That’s valid (although I still urge them to consider the hiring challenges down the road).

- “I’ve used Perl exclusively since I downloaded it over dialup and I’m not interested in those shiny new languages the kids like.” Run screaming.

Re:Perl 6 Optimism by loggedinmyphone on Tuesday January 23, 2018 @01:54PM (#16216252)
I've never met a Perl developer who doesn't know and use other languages. By contrast it's much more probable that a "kid" writing Python or JavaScript has never been exposed to anything else.

When you say you wouldn't use Perl again, that's a fine personal choice, but has zero to do with the merits of the language or the people who use it.

Re:Perl 6 Optimism by tomc1985 on Tuesday January 23, 2018 @12:54PM (#16215570)
There's also the "I really like Perl and I wish more people took it seriously" set (which I consider myself to be a part of)
Re:Perl 6 Optimism by jrs95 on Tuesday January 23, 2018 @01:13PM (#16215765)
I believe he’s grouping all of those people in with his second description
Re:Perl 6 Optimism by tomc1985 on Tuesday January 23, 2018 @01:19PM (#16215853)
Yeah, no
Re:Perl 6 Optimism by vgy7ujm on Tuesday January 23, 2018 @12:37PM (#16215423)
No. It's not suspicious or dangerous in any way compared to Python.