Hacker News new | ask | show | jobs
by corty 2180 days ago
Both I would guess.

Perl in serial is already faster to run than Python, and as soon as you start using threads Perl blows Python straight out of the water. The only reason that stuff like tensorflow or numpy is not as dog slow as the rest of python is that they are bindings to c(++) or fortran libs.

Writing faster is debateable, but Perl has tons of niceties like embedded regex syntax, string interpolation, one-line if/unless that make Perl both more concise and less boilerplatey, which arguably also makes it faster to write.

There is also "faster to maintain". Perls compatibility means that there is almost none of the churn e.g. Python has with regard to syntax and semantics changes. Perl code from almost 3 decades ago usually works quite fine, whereas Python code breaks in every minor version upgrade and needs a complete rewrite for major versions

2 comments

I've been writing Python for a good while now and I haven't seen too many issues between minor versions.

As for major versions...well...there's only been one significant change in this area (2 to 3) so I feel like maybe you're hyperbolizing a little :-)

Python 3 was released in 2008, Python 2.7 had some kind of release last year but my memory is that up to about 2013 there was still a serious question of 2.7 vs 3 when you started a new project ("I know we should use 3, but then we can't have x-lib!").

So it happened once but it took up about 25% of the last 20 years.

A little. But there were changes from e.g. 2.5 to 2.7 and in the earlier 3.x versions that broke stuff. That never happened with Perl code here.
>Perl in serial is already faster to run than Python

Not it isn't.

>The only reason that stuff like tensorflow or numpy is not as dog slow as the rest of python is that they are bindings to c(++) or fortran libs.

So if I make a foo.py file and run the code, it runs faster. "but it's really c(++) or fortran!" doesn't matter in the slightest.