Live data from Hacker News

Perl 7 is going to be Perl 5.32, mostly

perl.com

421–430 of 573 posts

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

#421

I've been a perl zealot since 2005. I didn't even know "python" existed until around 2008 when I found a script file with a ".py" file ending in a fresh ubuntu install. I started going to perl conferences sometime after 2010 when someone on irc informed be about them. I learned so much in those conferences, mainly about the alternatives to cgi and the modern OOP "framework" named "moose". I thought I was in heaven. I…

[deleted]

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

#422
post #191
post #141

Earlier quoted context omitted.

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

That's like saying they're both as fast if you amputate one of Perl's legs.

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

#423
post #407

Earlier quoted context omitted.

> perl has been the same since 2002 if you ignore perl 6 then you might as well ignore python 3. And even still, python 2 is dead. There are only a handful of languages as well maintained as Perl 5. https://en.wikipedia.org/wiki/Perl_5_version_history Perl maintains strict backwards compatibility. I can run code that was written decades ago. I really am curious what features you think Perl 5 lacks. > Another issue is…

I haven't seen that much hate for Perl on HN. I personally used it for quite a while and liked it a lot. But I think it's reasonable to consider it a legacy language these days, next to Fortran, Ada and TCL. Are these languages still used in some niches? Certainly, TCL is still big for scripting ASIC/FPGA design tools last I checked. Similarly Perl projects will still be used and maintained for a long time, it may we…

[deleted]

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

#424
post #377
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.

I took some similar benchmarks recently: https://code.ivysaur.me/interpreter-binary-perf Perl5 won the dec2bin benchmark. The other thing I learned was that PHP's binary/decimal functions are two orders of magnitude slower, despite its core interpreter performance being best-in-class.

On the other hand PHP has a PCRE jit option which manages to beat even Perl's regex implementation.

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

#425
post #407

Earlier quoted context omitted.

> perl has been the same since 2002 if you ignore perl 6 then you might as well ignore python 3. And even still, python 2 is dead. There are only a handful of languages as well maintained as Perl 5. https://en.wikipedia.org/wiki/Perl_5_version_history Perl maintains strict backwards compatibility. I can run code that was written decades ago. I really am curious what features you think Perl 5 lacks. > Another issue is…

I haven't seen that much hate for Perl on HN. I personally used it for quite a while and liked it a lot. But I think it's reasonable to consider it a legacy language these days, next to Fortran, Ada and TCL. Are these languages still used in some niches? Certainly, TCL is still big for scripting ASIC/FPGA design tools last I checked. Similarly Perl projects will still be used and maintained for a long time, it may we…

[deleted]

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

#426

Earlier quoted context omitted.

It wasn't the language, it was Numpy. Everything that is built on top of Numpy is what made Python so popular. And I guess Perl also never had its Django (or Rails).

> And I guess Perl also never had its Django (or Rails). It’s got two of them - Catalyst (older still works fine) and Mojo - newer and shinier. I think python is a better fit for mathematical work. I like to say that python helps you think more like the computer does, and that perl helps the computer think more like you.

Catalyst was no match for Rails. Mojolicious could have been had Miyagawa's PSGI/Plack appeared on the scene half a decade earlier.

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

#427
post #73

Earlier quoted context omitted.

String parsing - Perl5's forte - is still dog slow with Perl6/Raku and year after year we hear that will change in the future. Don't hold your breath.

Raku's big strengths lie, IMO, in the command line scripting capabilities (the MAIN function), parsing with grammars and powerful new regex syntax, and as a glue language. It's relatively easy to bind to external libraries and work with them. Look at how easily raku binds to a python charting module in this article: https://www.perl.com/article/plotting-with-perl-6/

But if it's slow at really basic stuff users will ignore it, surely?

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

#428

Earlier quoted context omitted.

I loved Perl back in at the turn of the millennia. My first data science equivalent projects were in Perl. To this day I can not find anything quicker to prototype in. Python is slow in comparison. Perl is great for quickly hacking something together for R&D purposes. Also, if you need to write something custom, Perl runs so much faster than Python and R. I, like many people, stopped using Perl beyond a quick script…

Do you mean faster to write, or faster to run, or the combination of both?

Both. Perl is around 20x slower than C for common tasks, while Python is around 133x slower than C for common tasks like looping, depending on what you're doing of course.

Perl is the ultimate mockup language in that you can crank out code very fast and get good bug free results. It lets you write in the way you think where other programming languages force you to write a specific way. Ofc you can get good at Python, so good at it you might get as fast as Perl. And Python is easier to read. The advantage of Perl, writing like you think, makes it difficult for anyone but you (or someone else who thinks like you) to read and maintain your code. The ugly code stereotype comes into play from this.

Perl isn't like Python. It's great if you want to write a one off script for doing quick analytics or a one off script that checks something on a server. It's fantastic for that. Python, you'd need to google around for a library, hope you find one, grab it, write a 100 lined file, and then finally be done, where Perl was a quick one-liner to do the same thing. Ofc the Perl is going to look like garbage and not be maintainable and the Python is going to look golden and be maintainable. They both fit a different need and different use case.

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

#429
post #401

Earlier quoted context omitted.

Ruby is just as dead. Only thing it had going for it was Rails.

In Startup Land Rails is still thriving. Check out jobs on Angel.co and HN Who's Hiring.

I think you mean in San Francisco Startup Land...the other startup lands are less wedded to Ruby these days

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

#430

Earlier quoted context omitted.

Until some joker writes an unless/else block. Gah. I hope someone implements an elsunless keyword /s

I've never been a fan of unless blocks (as opposed to the unless postfix, which is a bit easier to swallow). The lower precedence spelled out boolean operators (not/and/or) mean you can just use if not instead, which is just as readable in most cases and isn't confusing in the else case. e.g. unless ( $foo ) { } if ( not $foo ) { }

yeah I tend to avoid unless - definitely in blocks, but it's ok for some postfixes
Post reply on HN