Is Perl aimed at creating fast runtime programs?

I recently had a friend.

"see perl was never designed to be fast"

  • It's true?

The relevant piece of information I can find is from Wikipedia :

The language should be practical (easy to use, effective, complete), and not beautiful (tiny, elegant, minimal).

But he does not speak directly about speed. I think that with all the text processing it should do, execution speed really matters for a language like Perl. And with all the strange syntax, elegance has never been objective, I agree.

  • Was high speed one of the goals of Perl design?
+6
perl language-design language-features
source share
5 answers

Perl has always strived for practicality, and not for anything (even close to) some purity of the ivory tower, where several goals are given absolute priority and others are ignored (completely or almost like that).

As such, I find it reasonable to say that maintaining a reasonable execution speed has always been considered important for Perl, but there are other factors (especially flexibility and ease of use) that are usually more important, so if you need to choose between one of them and execution speed, another factor will generally benefit if the effect on execution speed is not really serious.

+7
source share

There is one important aspect: algorithms. Perl's secret weapons are algorithms that support certain language features and the CPAN library.

Good algorithms outperform the original execution speed for non-trivial problems. It usually takes more effort to select and implement algorithms in C-type languages ​​than in Perl. This means that during the afternoon coding for some small tool, the perl version often outperforms the C version because it was easier to create good data structures using hashes and using functions provided in the language and in the libraries.

+9
source share

After running the Perl script (i.e. after loading and compiling everything) it can be very fast. This is what yucky compile-every-time is, which is a little nasty.

However, I believe that people really don't need to worry about how fast Perl can be. They waste all their time introducing stupid projects that do a lot more work than they need to do, misunderstanding key technologies or just being piercing. It’s not uncommon for me to help someone in getting their things to order faster, simply by setting up the right places. However, this does not apply to Perl. People have this problem with every language.

+8
source share

I would say that a language designed for optimal performance at runtime will not have constructs that allow compilation at runtime. So no, maybe.

+3
source share

It became a design goal with Perl 5.0. But keep in mind that it is still interpreted, so it is quickly interpreted.

+1
source share

All Articles