Live data from Hacker News

Perl 5.26.0 released

nntp.perl.org

81–90 of 165 posts

Re: Perl 5.26.0 released

#81
post #71

Earlier quoted context omitted.

Perl has great Unicode support. Not just Unicode regexes, but a lot of built-in Unicode support ( https://perldoc.perl.org/perlunicode.html ). I have no idea if other languages have caught up, though. Perl doesn't have anything like Python's GIL. People have other complaints about threading in Perl, but you can count on things running in parallel more often. I believe Larry Wall is correct that he borrowed more from…

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.

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 child's pid.

This isn't a big deal to everyone, but I like POSIX, and I like knowing that if I want to do something new, there's a good chance I can start with "how would I do it in C on a POSIX system?" I have many complaints about Java, and one is that their original standard library appears to have been modeled on early versions of MFC, even though Sun had access to a superior API, since they had plenty of experience with shipping a POSIX operating system.

Re: Perl 5.26.0 released

#82
post #20
post #15

Earlier quoted context omitted.

I don't use Perl for anything that I suspect will amount to more than 1,000 lines of code. But for smaller scripts that automate tedious tasks or massage data to connect two otherwise software systems or generate a report-ish overview of a database/table, it is very hard to beat. Ruby comes close, but then again, Perl has been relentlessly optimized and fine-tuned over the last ~15 years, so for the stereotypical use…

on the contrary perl5 has been relentlessly de-optimized and destroyed over the last ~15 years by its maintainers. how did you get to this interesting opinion? do you really believe the p5p marketing hype? perl5.6.2 still blows away all newer releases performance and memory usage wise. 15 years ago the author was still active.

It's sad you're being downvoted. I've found similar sentiment elsewhere, and I'm interested to learn more.

stableperl (http://blog.schmorp.de/2015-06-06-a-stable-perl.html) is a fork of perl 5.22 with a couple of tiny reversions that re-enable access to some internal state required by certain CPAN modules.

The author talks in other blog posts (http://blog.schmorp.de/2016-12-29-griefing-the-perl-api.html, http://blog.schmorp.de/2015-11-12-tidbits-why-coro-crashes-o..., http://blog.schmorp.de/2015-12-15-tidbits-cgipm-a-data-point...) about the decline of Perl's cohesion.

It's sad to see.

--

EDIT: And now I'm being downvoted.

I have no problem with Perl, I watched the Perl 6 presentation when it was released with great interest.

Perl remains on my list of languages to learn (I know, I know...). It's up there. And that's why I said I was sad to see datapoints like the one I linked. I want Perl to keep going strong, and I hope it lasts another 20 years. I guess I added this comment because I wanted to find out if there was anything I could do.

Re: Perl 5.26.0 released

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

Perl has a core function called 'unlink', which maps directly to unlink(2). Same for stat, rmdir, link, etc. They're good for when you want something more than what the coreutils give you, but don't want to compile some C.

Oooh, I see. Nice!

Re: Perl 5.26.0 released

#84
post #71

Earlier quoted context omitted.

Perl has great Unicode support. Not just Unicode regexes, but a lot of built-in Unicode support ( https://perldoc.perl.org/perlunicode.html ). I have no idea if other languages have caught up, though. Perl doesn't have anything like Python's GIL. People have other complaints about threading in Perl, but you can count on things running in parallel more often. I believe Larry Wall is correct that he borrowed more from…

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 autodie: https://metacpan.org/pod/autodie

Re: Perl 5.26.0 released

#85

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…

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 could essentially turn Perl into a custom language that exactly fit your needs. I walked out of there thinking "wow! That is incredibly awesome, and yet I would never consider it for a business environment." Perl is an appealing language for people who like languages. I count myself as one of those. But I cannot deny that Python makes so much more sense for teams of more than one person.

Re: Perl 5.26.0 released

#86
post #77

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

How many of those "water cooler" conversations you had with someone who actually knew and used perl for at least a few projects? Most of perl hate I hear is from people who've seen like 2 perl one-liners in life and got scared by $, @, and %'s in syntax...

I used to use perl regularly. It was installed a lot of places and was superior to the other common options. The tooling for things like python,.net langs, and C++ are decades ahead now. It's just less error prone to use those. Part of that is because of Perl's grammar; part of that is the culture of the language.

Also, a lot of the CPAN modules have been orphaned for over a decade and npm/matt's script archive level quality on average.

Re: Perl 5.26.0 released

#87

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…

> instead it just works

All of those other languages "just work" too. I'm not really sure what you're getting at with this comment.

I worked with Perl 5.x in for 4 years a while ago. It's not as bad as people really think it is. That said, there are a lot of things that can cause you to go wrong. For example: source filters. Super powerful, but if implemented wrong can make debugging a nightmare.

Re: Perl 5.26.0 released

#88

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…

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.

Re: Perl 5.26.0 released

#89
post #38
post #7

Earlier quoted context omitted.

Perl is still awesome at regular expressions compared to other languages. It has better Unicode regex support than almost any other language. If you need to do intricate Unicode regexes, then your main choices are Perl and libraries for other languages which port Perl features, not always well-supported.

Unicode regexes is a pretty small edge case. Is it because Perl is awesome, or because Unicode sucks?

Most people who understand what a can of worms those systems are start leaking a little grey matter from their ears when someone mentions the phrase "Unicode Regex".

I have mental images of driving a wildly overpowered monster truck with no brake lines over a minefield. And then I start to consider the implications of passing the /i flag in...

Re: Perl 5.26.0 released

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

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 system, let's make everything open and not lock it down." Apple said "let's do something different with the Macintosh, let's enforce absolute control over the hardware and software so we can perfectly unify them."

Maybe Sun got fed up with SunOS and said "let's make a language and runtime that's totally different - something so different that it resists influence by platform architecture."

Post reply on HN