Perl FAQ: How fast is Perl and other trivia

Perl Trivia FAQ

The most common questions I get about Perl are:

  1. How fast is Perl?
  2. How popular is Perl?
  3. Who uses Perl?
  4. Can Perl scale up?

You can detect the underlying question in all of these: Should I invest my time into learning Perl?

How fast is Perl?

The short answer is that Perl is just as fast as other scripting langauges. This also means that Perl is also just as slow as other interpreted scripting languages when compared to C.

perl_vs_c.jpg

Figure 1: Perl vs C

ruby_vs_c.jpg

Figure 2: Ruby vs C

python3_vs_c.jpg

Figure 3: Python3 vs C

php_vs_c.jpg

Figure 4: PHP vs C

The differences in speed between interpreted languages like Perl, Python, etc. is insignificant. In projects where RAD (Rapid Application Development) and Agile programming is used, interpreted languages have several advantages.

  1. Rapid prototyping, no write/compile/run cycle.
  2. RAD allows more iterations per hour of expensive Agile developer time.
  3. Cross-platform

What about Java?

For comparison, I thought I’d include Java vs C. You can see that Java is about half as fast as C, and about 30 times faster than Perl/Python/etc.

java_vs_c.jpg

Figure 5: For comparison, Java vs C

The moral of all of these graphs is clear: if you need speed, you need C or another compiled language. Otherwise, any language you use will probably be fast enough for almost any task. fter all, Facebook was built on a scripting language — PHP. Twitter was built with Ruby. Craigslist and Booking.com are doing just fine with Perl. Perhaps the speed of the language you use really isn’t as important as having a good idea in the first place.

How popular is Perl?

Measuring popularity of a language is a hazardous undertaking. Do we mean which language has the most job listings (C)? Or which language has the most churn for Github open source projects (Objective-C)? Or which language has the most discoverable files on the Web (PHP)? Which language is most popular for web sites (PHP)? Which language has the largest pool of programmers (Java)? Which language runs on the most computers (JavaScript)? Which language will lead to the highest pay (Rails)? Does it even matter if a language is popular (maybe)?

You can decide for yourself by looking at the unscientific resources below whether Perl is popular.

The Tiobe IndexOne

One common measure of language popularity is the Tiobe Index, where Perl has been in the top 10 list for about 20 years. On this index, C/C++ and Java usually garner 40+% of the ratings, while the the remainder of the Top Ten range from 2% to 4%. In this list Perl is currently more “popular” than many other so-called popular languages, including Visual Basic, Ruby, Assembly, F#, and R.

Langpop

The cool thing about http://Langpop.com is that it’s a compilation of many different sources of data— Google searches, Github repo activity, Craigslist job postings, academic discussions of Lambda The Ultimate, Reddit, etc. On Langpop Perl is among the top 15 programming languages when all sources are compiled.

perl_popularity_langpop.jpg

Figure 6: Perl popularity on Langpop.com

IEEE Spectrum

The IEEE Spectrum rating is based on data taken from Twitter, GitHub, Stack Overflow, Reddit, Hacker News, Career Builder, Dice, and IEEE Xplore Digital Library. You can filter search results by language types: Web, Mobile, Enterprise, and Embedded. Here’s the current data (Aug, 2015) filtered by the term “Web”.

iee_spectrum_by_web.jpg

Who uses Perl?

Perl has been around for almost 40 years and is used almost everywhere in government, financial services, information technology, retail, communications, mixed services, energy resources and manufacturing, and education. The list quite enormous Here’s a list

Can Perl Scale Up?

Yes. http:Craigslist.org, http://Booking.com, http://Priceline.com, http://IMDb.com, http://LiveJournal.com,
http://Slashdot.org, http://Ticketmaster.com, and http://Duckduckgo.com are all big Perl web sites. On the seamy underbelly of the Web, Perl has been a big player in the world of adult web sites — Youporn and adultfriendfinder are two high-traffic examples.

More Perl users: http://perltraining.com.au/whyperl.html#who

High traffic Perl web sites

craigslist_alexa.jpg

Figure 8: Craigslist.org Alexa rating

booking.com_alexa.jpg

Figure 9: Booking.com Alexa rating

duckduckgo_alexa.jpg

Figure 10: Duckduckgo.com Alexa rating

bbc_iplayer_alexa.jpg

Figure 11: BBC iPlayer Alexa rating

How Emacs inspired Matz in creating Ruby

Matz (Yukihiro Matsumoto) and Richard Stallman
Matz (Yukihiro Matsumoto) and Richard Stallman
I just found this 2013 article about two of my favorite things, Emacs and Ruby, on the fabulously opinionated ergoemacs.org site. When Yukihiro Matsumoto created Ruby in 1993, he was already a confirmed Emacs user and Emacs Lisp hacker. Matz explains in his 2012 LibrePlanet Conference presentation (slideshow) that his knowledge of the Emacs source code influenced his design of Ruby’s core features. Checkout the links below to get the whole story.

Resources

Drupal 8 is seven times bigger than Drupal 7

Drupal 8 has arrived, and it’s big, very BIG. I thought it would be fun to measure exactly how big and compare it to some of the other PHP-based frameworks we know and love. I’ll use Drupal 7 as the baseline.

Table 1: Drupal’s expanding code base
Framework Lines of Code
Drupal 6 21,417 (25%)
Drupal 7 86,686 (100%)
Drupal 8 606,382 (699%)

For comparison, here are a couple of popular non-Drupal packages

Table 2: Moodle is still the Big Kahuna of PHP projects
Framework Lines of Code
WordPress 144,850 (167%)
Drupal 8 606,382 (699%)
Moodle 3 1,170,358 (1,350%)

 

Relative sizes

Drupal 6

Drupal 7

WordPress

Drupal 8

Moodle 3

My line counts were made by downloading the lastest versions of Drupal 6, 7, 8, WordPress, and Moodle, then counting the lines with Sloccount. Sloccount is a marvelous way to total up  millions of lines of source code.

Learn You Some Shell

Here’s the list of shell programming resources I recommend to my students.

Basic skills for Unix newbies

These tutorials cover the basic skills you need to perform basic tasks on Unix systems. Since 99% of all web sites are deployed on Unix/Linux, you really do need to know this stuff.

  1. Command Line Crash Course This tutorial stands above the others because it provide lots of examples and exercises. Best of all, it’s honest, and comes with a full blast of Zed Shaw.
  2. UNIX Tutorial for Beginners
  3. Learning the Shell
  4. Unix for Mac OS X Users
Shell Programming

Once you learn basic Shell skills, you’ll want to learn about Shell programming.

Books

Unix Shell Programming by Michael Kochan is my go-to shell book.

College Courses

The best course I know of is Greg Boyd’s face-to-face CS 160A and 160B courses at CCSF. Take them if your live in the Bay Area.