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…
Perl 7 is going to be Perl 5.32, mostly
421–430 of 573 posts
Re: Perl 7 is going to be Perl 5.32, mostly
#422Earlier 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
Re: Perl 7 is going to be Perl 5.32, mostly
#423Earlier 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…
Re: Perl 7 is going to be Perl 5.32, mostly
#424Earlier 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.
Re: Perl 7 is going to be Perl 5.32, mostly
#425Earlier 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…
Re: Perl 7 is going to be Perl 5.32, mostly
#426Earlier 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.
Re: Perl 7 is going to be Perl 5.32, mostly
#427Earlier 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/
Re: Perl 7 is going to be Perl 5.32, mostly
#428Earlier 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?
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
#429Earlier 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.
Re: Perl 7 is going to be Perl 5.32, mostly
#430Earlier 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 ) { }