Live data from Hacker News

Perl 5.26.0 released

nntp.perl.org

91–100 of 165 posts

Re: Perl 5.26.0 released

#92
post #52

Earlier quoted context omitted.

Perl is still the only language I've seen that has a dedicated syntax for regular expressions. Every other language requires you to write your regexes as strings, which puts you squarely in backslash hell. (I'm sure there must be other languages with dedicated regex syntax, but I'm not aware of any.)

Ruby is a direct descendant of Perl and borrows its regex syntax.

Ruby used Oniguruma (and now Onigmo) for RegEx https://github.com/k-takata/Onigmo

Re: Perl 5.26.0 released

#93
post #88

Earlier quoted context omitted.

As a long time Perl programmer myself who has been doing Python for the last three years, I have to say that it is much easier to write unintelligible Perl code than Python. Not that you cannot write some gross things in Python if you try, but the language defaults towards readability and the community strongly encourages it. I recall a great talk a couple years ago at OSCON that Damian Conway gave about how you coul…

The one thing that I miss in Python is true anonymous functions. Perl has them. JavaScript has them. Ruby has them. Python just has lambda functions which can only evaluate an expression.

Meh. In Python you can put a def inside of any scope you want and do anything that you want with it. The fact that it winds up with a name in that scope doesn't stop it from being anonymous everywhere else.

At that point the difference is just syntax.

Re: Perl 5.26.0 released

#94
post #84
post #71

Earlier quoted context omitted.

What do you mean by Perl functions being modeled after POSIX functions? My only points of reference are POSIX being a UNIX system specification which defines both a C language reference and system userspace specification. I also have a vague notion of POSIX specifying the fundamental behavior of shells. I'm just not quite sure which point of reference to apply.

In addition to what others have said, perl also directly exposes errno via $!: $ perl -E 'unlink("/etc/passwd"); say (0+$!)' 13 $ grep 13 /usr/include/asm-generic/errno-base.h #define EACCES 13 /* Permission denied */ Of course $! is a special dual-val so if you treat it as a string you get the nicer strerror(3) equivalent: $ perl -E 'unlink("/etc/passwd"); say $!' Permission denied That said, some people prefer auto…

Wow, interesting. The language has type coercion, and makes full use of it. I likey :D

Thanks for the example too!

Re: Perl 5.26.0 released

#95
post #90

Earlier quoted context omitted.

If you want to read a directory, you use the functions opendir, readdir, and closedir. You can get a decent idea of what they do by looking at POSIX documentation. They have been modified to fit Perl better, so you still have to look at the Perl documentation as well. If you want to fork a process, you use the function "fork". If you want to call exec, Perl has it. You can even have the parent process wait on the chi…

I see what you mean. POSIX was basically a committee ratifying things that a bunch of systems people had come up with. So it gets to the point, it's reasonably concise, and there's little noise to wade through to do most things. Java was slowly designed by committee, taking inspiration from other languages. I just thought of something. Maybe it's relevant. IBM said "let make something totally different with this 8086…

I think Java's "all OOP, all the time" approach influenced their standard library design. I don't like the result.

"Modernism was based on a kind of arrogance, a set of monocultural blinders that elevated originality above all else, and led designers to believe that if they thought of something cool, it must be considered universally cool. That is, if something's worth doing, it's worth driving into the ground to the exclusion of all other approaches. Look at the use of parentheses in Lisp or the use of white space as syntax in Python. Or the mandatory use of objects in many languages, including Java. All of these are ways of taking freedom away from the end user 'for their own good'. They're just versions of Orwell's Newspeak, in which it's impossible to think bad thoughts. We escaped from the fashion police in the 1970s, but many programmers are still slaves of the cyber police" ( http://m.linuxjournal.com/article/3394 ).

Re: Perl 5.26.0 released

#96

Earlier quoted context omitted.

Yes, impressive community effort for a language that... Well... I have heard nothing good about in any "at the water cooler" conversation that I was ever in, over the past fifteen years or so. Except, of course, that Perl is awesome at regular expressions, an advantage that most languages must have caught up on, no? Not for nothing Perl shows up in most hated-lists all around town (top 10 at Stack Overflow).

Perl 5 isn't a 'cool' language, because it isn't trying to rapidly change itself, instead it just works. I use it just about every day (by my own choice!) and it can be a fine language to develop in. The libraries available in CPAN contain support for pretty much any task you could think of. Most of the horror stories that you'll hear about perl are from people who have tried to fix/maintain code that was written bad…

I think perl invites a kind of mindset from how the language is and how the initial community was.

Why does it have something called 'say' instead of something more intuitive like 'println'. Then there are worse examples: carp, cluck, croak. These are commonly used. They are from the same module of course. There is also Moo, Moose. I'm not sure but was there something called 'Mo' too? Commonly used of course but as you can see from the names - you can't tell what they are for.

So, I think from some of the choices made in how the language is, it ended up being more drawn towards unreadability than readability by attracting a kind of mindset that wanted it to be 'fun' in a way that only a clique could relate to and now if the language doesn't have broad appeal, I think it shouldn't be that hard for them to accept that fact.

Re: Perl 5.26.0 released

#97
post #23

Earlier quoted context omitted.

I moved from Perl to python around 6 years ago. There are more jobs available for Python, though probably more competition as well. I regularly see Perl jobs posted in London, but the wages are surprisingly poor, compared to what I could get for my Django knowledge.

I think your comment on wages is astute, and it's the same everywhere. There are Perl jobs around, but they're on legacy codebases in (parts of) organizations that are basically too dysfunctional / under-resourced / incompetent to upgrade them, and if you take the job you'll just be putting out fires and stagnating. When you take that into account, the salary would need to be at a real premium to make it worthwhile,…

The 2017 SO Developer Survey has Perl in 6th place for highest compensation in the world. https://insights.stackoverflow.com/survey/2017#technology-to... Interestingly, Perl places 5th in the USA for highest compensation, and it doesn't even make the lists of France, Germany, India, and the UK.

Re: Perl 5.26.0 released

#98
post #62
post #45

Earlier quoted context omitted.

> I think it cannot compete with Python at its current state. This has nothing to do with the language (I consider Perl to be vastly superior) but rather its ecosystem and lack of momentum. In this specific case, these are contradictory. Perl and Python had roughly the same amount of corporate backing (almost none) and Perl had a huge head start. If Perl as a language would be "vastly superior", Python would have nev…

Python's growth in popularity is largely due to its superior data science libraries and the backing of Google. Without these it wouldn't be where it is today. Perl's stewardship is largley responsible for its decline. If Perl6 hadn't taken 15 years to complete Perl's popularity might be different. Perl6 is far superior to Python and most popular languages. It's just not performant at string/regex handling which is ir…

> Python's growth in popularity is largely due to its superior data science libraries and the backing of Google.

Both are false. Data science libraries are quite new development that happened because Python got popular, not the other way around. Backing by Google (whatever you mean) was irrelevant, as the main selling points for Python dozen years ago was simple and readable syntax and nice web toolkits (a movement that followed Ruby with its RoR).

> If Perl6 hadn't taken 15 years to complete Perl's popularity might be different.

Perl6 didn't compete for popularity with Perl, because it was essentially non-existent back then. Perl popularity decline cannot be attributed to Perl6.

The thing is, Perl is a very complex language, but has competiton that is simpler grammar-wise and similarly powerful and expressive: Python and Ruby. It's easier for newcommers to learn Python or Ruby than Perl, so they rarely dig into Perl. This means that the number of people leaving the language (a normal thing for any language) is not matched by the number of young programmers, which leads straight to decline.

Re: Perl 5.26.0 released

#99
post #59

Earlier quoted context omitted.

Even now I start web-projects with Perl. It's not "cool", it's not "sexy", but there package collection ( http://cpan.org/ ) is __huge__. I find it unlikely that new people will suddenly rediscover perl, in the golang/node.js/python-centric state the world is in. But the people who love it, do continue to love it, and do continue to do useful and essential things with it.

The CPAN argument for choosing Perl was relevant about 10 years ago but if you look at http://modulecounts.com you'll find Ruby, Python, PHP, JS and Java have an order of magnitude more libraries to choose from. CPAN is not __huge__ by today's standards. Drupal alone has the same number of modules. The declining community also means many of the libraries on CPAN are unlikely to be maintained.

Hum, depends upon your definition of what's a module. from cpan.org front page:

The Comprehensive Perl Archive Network (CPAN) currently has 186,953 Perl modules in 35,278 distributions, written by 13,095 authors, mirrored on 248 servers.

Re: Perl 5.26.0 released

#100
post #93
post #88

Earlier quoted context omitted.

The one thing that I miss in Python is true anonymous functions. Perl has them. JavaScript has them. Ruby has them. Python just has lambda functions which can only evaluate an expression.

Meh. In Python you can put a def inside of any scope you want and do anything that you want with it. The fact that it winds up with a name in that scope doesn't stop it from being anonymous everywhere else. At that point the difference is just syntax.

And better clarity---I've seen anonymous callback hell in .js, no thanks.
Post reply on HN