Live data from Hacker News

Perl 7 is going to be Perl 5.32, mostly

perl.com

141–150 of 573 posts

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

#141
post #100
post #52

Earlier quoted context omitted.

On my 4-core i7 Macbook Pro: time ./startup_time.pl 0.016s time ./startup_time.py 0.295s Parsing a 20Mb log file with a regex: time ./parse_log.pl 0.683s time ./parse_log.py 1.534s For which metric are you claiming Perl is slower than Python?

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 even there Python relies on external libs.

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

#143
post #34
post #16

Earlier quoted context omitted.

What do you mean by cheap? Also, perl is incredibly inefficient: it's even slower than Python. Also, how is Perl any less stable than other languages? Are you saying the language doesn't change much or that it doesn't crash?

- Efficient: from prototype to deployment, it's a matter of days. The choice of styles let people use paradigms they are familiar with, meaning they do things quickly. - Cheap: it does not cost much to hire someone to write perl. If they don't know how yet, the choice in style let them be efficient quickly. The code to be deployed is very lightweight, both in CPU and RAM usage. - Stable: no API break. No new module t…

The reason that code written 20 years ago still runs fine is that they rolled back 20 years of changes!

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

#144
post #127

Earlier quoted context omitted.

Perl's syntax is really confusing. Especially for example how variables have symbols for different types ($ for scalars, % for hashes, @ for arrays). And if you want to for example pass an array to a function you have to send it manually referenced with like method(\@myArray) which then inside the method is contained in a $scalar. Compared to Python for example where you'd literally just pass the array to the method…

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

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

#145
post #68

Earlier quoted context omitted.

This seems to be a common experience - people say it felt powerful and modern in the 90s, because it was . For those who started programming in the 00s and 10s it looks clunky and weird compared to the other options.

That doesn't add up because today's most popular languages - JS, Java, Python, PHP and Ruby - were also released in the 90s.

It does add up because Perl was released in 80's and became popular in the 90s, when the other newer languages you listed were designed and released. In the early-mid 90's, "CGI"/"CGI scripts" was synonymous with Perl - it was the backend tech

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

#146
post #132

Are they still renaming Perl 6? I think it is a tad confusing to have 5 and 7 being so similar, and the 6 in between so radically different. I can't be the only one.

It's explained in the announcement. Perl 6 was already renamed to Raku, but calling the new Perl version Perl 6 would be confusing, so they are directly jumping to 7. They even show other examples of version jumps.

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

#147
post #3

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.

Yep, I know of one company still actively using Perl for a large part of its infrastructure. It has its use cases.

Are they named after a very large tropical rainforest?

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

#149

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.

IMDB was written in Perl, notoriously. Seeing that the layout has not changed in ages, I can only assume it's still Perl.

I'd imagine a bigger rewrite effort would have led to a more slick iteration on the UI, and it seems the legacy HTML templates are still baked in.

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

#150

Earlier quoted context omitted.

One more: add a proper exception handling setup.

Yeah that too! People keep saying perl is a bad language or something and the other languages can't even get implementing closures right. I've always liked the references syntax, probably the most complained about feature. Its just pointer thinking. You could probably collapse `$array[$x]->{"foo"}->[0]` to `$array[$x]{"foo"}[0]` and save some keystrokes.

> probably collapse $array[$x]->{foo}->[0] to $array[$x]{foo}[0] ...

Yup, one's been able to collapse exactly like that for more than twenty years.

https://metacpan.org/source/LWALL/perl5.002b3/pod/perlref.po...

That's from 5.002, from last century, and it wasn't introduced on 5.002.

Beginning from v5.20, one's also been able to use the postfix dereference syntax, turning:

say join "\t", @{ $foo->{bar}[0]{quux} }

into:

say join "\t", $foo->{bar}[0]{quux}->@*;

Whether that's better or worse, it's debatable.

Post reply on HN