Live data from Hacker News

Perl 5.26.0 released

nntp.perl.org

111–120 of 165 posts

Re: Perl 5.26.0 released

#111
post #52

Earlier quoted context omitted.

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

As far as I can make out these regex engines are very close to Perl5.

Re: Perl 5.26.0 released

#113

Earlier quoted context omitted.

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

I'm biased, I've release bits for Moose but ... Django, React, Rails, Spring, : can you tell what they are used for from the names? Does this mean that Python, Javascript, Ruby, and Java are "drawn towards unreadability than readability by attracting a kind of mindset that wanted [them] to be more 'fun'"?

In fact Moose, Catalyst, Starman, etc were all projects specifically named more fun _becasue_ their authors saw other communities not naming things "DBIx::Class" or "ExtUtils::MakeMaker" and wanted to bring some of that fun to Perl.

Re: Perl 5.26.0 released

#114
post #6
post #3

Guys I am genuinely asking this and I have zero intent on bashing on Perl. What is the position of Perl industry right now? how much it can compete with Python. Where does it compete? is it on losing side ? P.S. I am student and I have no real perspective on what is going on in industry right now.

The only big company I know that uses Perl extensively is booking.com, and I think that has more to do with any technical merit from the language, and just that is what they started and it was working for them. To be honest, I think Perl still powers a whole lot of systems, and certainly is a powerful tool for someone who is a Unix sysadmin, but this kind of job is dying. And as a language, I think Perl has nothing o…

> Unix sysadmin, but this kind of job is dying

I don't think this job is dying, but rather evolving. Of the Unix admins I learned under, only the ones who were also okay programmers and adapted have a great job right now. The writing is on the wall for those that can't/refuse to program. I had an interview with Facebook and they were bragging about laying off 100's of sysadmins with a machine learning model.

Also, this is anecdotal, but of my friends who are software engs only, I make more as a "Systems Engineer" or "DevOps Engineer" or whatever buzzword by knowing systems and a moderate level of programming, but it is the same skills from the 90's applied to the "cloud".

Re: Perl 5.26.0 released

#116
post #103
post #93

Earlier quoted context omitted.

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.

You're declaring the function within that scope. You can do this in other languages too. In Javascript, I can declare a function within a scope too: function myFunc () { var myFunc2 = function () {}; return myFunc3().then(myFunc2); } This isn't some Python-specific thing. > At that point the difference is just syntax. Isn't that the case with most things? If I said that I missed curly braces, that's "just syntax" too…

I think the parent poster was referring to the fact that the critical thing is that a) you can define a function within the scope of another function, and b) you can return the inner function. To do this requires something called a closure, which in general involves some of the local variables being transferred to the heap.

You're right that almost all dynamic languages have this feature, but to give you two notable languages that don't: C doesn't allow defining inner functions. Pascal allows to define inner functions, but doesn't allow you to return them. C++ does allow you to define inner functions (actually functor classes) and allows you to return them, but you need to be explicit about the capturing process.

Re: Perl 5.26.0 released

#117
post #73
post #62

Earlier quoted context omitted.

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…

Perl is not more readable than Python. I know that "readable" is a subjective trait, but Python is 1 cm away from being pseudocode. And when a programming language is basically the thing we write when we don't have any tools to assist us, that says a lot about the language's syntactic quality, including its readability. Both the data science libraries and Google's backing come from this. And to be honest, I don't rea…

[deleted]

Re: Perl 5.26.0 released

#118
post #94
post #84

Earlier quoted context omitted.

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!

It actually goes a bit beyond type coercion. Larry Wall is a linguist. The language is actually contextual. There's numeric vs. string context for scalars and scalar vs. list context for assignments and returns.

The list of features is impressive, but taken together all at once can be daunting. I think that's why there's so much distaste for it in certain camps. It's actually possible in a function to test whether the caller wants a single value or a list and adjust your return accordingly. It has anonymous functions. It has closures. It has map() and sort(), either of which apply a custom block of code to a list. You can easily write user-supplied functions that do that, too. It has dictionaries / associative arrays (called "hashes" in the community since that's how they are implemented), regular arrays, scalar values, and a number of different object systems from which to choose.

Re: Perl 5.26.0 released

#119
post #104

Earlier quoted context omitted.

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

That's not a requirement of anonymous callbacks. That's just a symptom of poor coding standards. It can happen in Python too.

And yet the two go hand in hand. Have never seen it in Python, though have never used twisted either.

Re: Perl 5.26.0 released

#120
post #103

Earlier quoted context omitted.

You're declaring the function within that scope. You can do this in other languages too. In Javascript, I can declare a function within a scope too: function myFunc () { var myFunc2 = function () {}; return myFunc3().then(myFunc2); } This isn't some Python-specific thing. > At that point the difference is just syntax. Isn't that the case with most things? If I said that I missed curly braces, that's "just syntax" too…

I think the parent poster was referring to the fact that the critical thing is that a) you can define a function within the scope of another function, and b) you can return the inner function. To do this requires something called a closure, which in general involves some of the local variables being transferred to the heap. You're right that almost all dynamic languages have this feature, but to give you two notable…

Right. Anything that you could want to do with an anonymous function, you can.

It is less frustrating for me than the fact that the scoping rules for a var in JavaScript mean that you're likely to scope to the nearest function call rather than loop. Despite having anonymous functions, doing what I would want to do with them in JavaScript is often much harder than doing it in Python.

Post reply on HN