Live data from Hacker News

Perl 7 is going to be Perl 5.32, mostly

perl.com

191–200 of 573 posts

Re: Perl 7 is going to be Perl 5.32, mostly

#191
post #141
post #100

Earlier quoted context omitted.

Lets see the code? Regex has always been a Perl selling point, and you're just benchmarking the Python Regex library (written in C) against Perl's regex library. That's not a fantastic basis for a comparison.

Perl 5: #!/usr/bin/env perl use 5.026; open my $fh, ' ) { chomp; say if /\b\w{15}\b/; } close $fh; Python 3.8 #!/usr/bin/env python import re with open('logs1.txt', 'r') as fh: for line in fh: if re.search(r'\b\w{15}\b', line): print(line, end='') Why isn't it a fair comparison? The startup time is generic and string parsing is a major feature of, say, web development. I didn't say Perl5 numerics match Python's but e…

The python code should run much faster if you don't print..

Edit: perl is still faster, to be clear

Re: Perl 7 is going to be Perl 5.32, mostly

#193
post #127

Earlier quoted context omitted.

For many years Perl subroutines didn't even have method signatures so you had to unroll @ on the first line of every sub. I think even today it may still be considered experimental. Jeez!

Yeah it's pretty archaic. Shortest hand way of doing it is like this: sub method { my ($self, $a, $b, $c) = @_; } $self being a reference to the current module (ala Javascript's 'this')

$self is only for OOP so not needed in a regular subroutine.

Re: Perl 7 is going to be Perl 5.32, mostly

#195

They last line of the article summarizes it well: > Perl 7 is v5.32 with different settings. Your code should work if it’s not a mess. Expect a user release within a year. Are there actually people that are still deploying new things in Perl? The only times I see it is for legacy stuff, and then only because the script is too much of a hassle to be rewritten.

I used to work for a company that used Perl as their primary language. The codebase was millions of lines long, modules (pm files) with like 1000 methods and 10,000 lines, a total mess and it had 0 unit tests too. Almost beyond salvageable. Left a bit of a sour taste. They're trying to migrate to AWS but AWS don't even natively support Perl in their libraries. There's a few third party libraries in CPAN but nothing a…

> There's a few third party libraries in CPAN but nothing as comprehensive as what's available with official libraries for other languages.

That is true. This alone might be a good reason to look elsewhere for new projects.

However, for existing Perl codebases, PAWS is comprehensive and popular library, and is generated from the official botocore: https://github.com/pplu/aws-sdk-perl

Re: Perl 7 is going to be Perl 5.32, mostly

#196
post #102

Earlier quoted context omitted.

I've heard Python's object system isn't that different under the hood.

You even have the same boilerplate of the first argument to a class member function being the object itself.

Yes. I was thinking mainly of Perl's symbol table which I believe is also how OO is implemented in Python.

Re: Perl 7 is going to be Perl 5.32, mostly

#197
post #42

Earlier quoted context omitted.

I used to work for a company that used Perl as their primary language. The codebase was millions of lines long, modules (pm files) with like 1000 methods and 10,000 lines, a total mess and it had 0 unit tests too. Almost beyond salvageable. Left a bit of a sour taste. They're trying to migrate to AWS but AWS don't even natively support Perl in their libraries. There's a few third party libraries in CPAN but nothing a…

Perl used to have one of the most extensive module libraries. One of the things I miss about Perl was it’s more sensible module namespace convention (Eg Net::... for networking related) vs the more hip but confusing and hard to discover naming of node modules.

Yes, the hierarchical namespace for modules was super nice. Migrating to a flattened package structure of npm was a disappointment. I ended up encoding the same type of structure in internal npm package names, e.g. "@myorg/net-aws-.." and "@myorg/file-..."

Re: Perl 7 is going to be Perl 5.32, mostly

#198

Earlier quoted context omitted.

> You learn perl, and you've learned nothing but Larry Wall. Yes, this is why it's nice. You don't have to worship at the foot of an industry which slavishly tries to implement a misunderstanding of a system some dude made up 40 years ago to get around problems in other systems some other dudes made up before that. It's weird on purpose. And it's backwards-compatible-crufty on purpose. Today I can run Perl code writt…

Not a Microsoft fan, but simple C / Windows API code from 25 years ago would likely compile and run on Windows 10 unchanged. My limited experience with Swift suggests that even 25 hours ago could be a tall order...

Moreover, a Windows .exe compiled 25 years ago will also likely just run.

Re: Perl 7 is going to be Perl 5.32, mostly

#199
I worked on Perl for a while, liked it. Back in 2008/9, the only option for Perl on Windows was Activestate Perl, whose community version was missing lot of features that would have made it much less painful(I am thinking of PPM particularly). That was one of the biggest gripes I had with Perl. We moved everything to Python as soon as we could get comfortable with it and haven't looked back since.

Regarding Perl's one liners, I feel they are what makes Perl very useful, but my preference is AWK over Perl for that.

Re: Perl 7 is going to be Perl 5.32, mostly

#200

Earlier quoted context omitted.

Perl was my first encounter with regular expressions. To this day, no language I've used does it better and cleaner. This includes Python, Boost/C++, Java, JavaScript, LISP, Go and Rust.

Favorite syntactic sugar feature: the /x modifier which makes the regex ignore spaces and comments, meaning you can break your regex into multiple lines and comment them.

Have you ever read O'Reilly's "Mastering Regular Expressions" by Friedl? He does a deep dive into the weird guts of regex modifiers.

I was obsessed with that book one summer and wrote a bunch of parsers after learning incremental techniques (/o I think), and then 8 months later I could no longer remember how anything that I wrote worked. Lol me.

Post reply on HN