0

When we did web development in 1996 it was CGI, FCGI and Perl on the backend. Now why is Perl not that popular anymore and instead we use Java, Python, Go, PHP, C# and everything but Perl? To me it seems that Perl should be good since it has had long time to mature. What happened that causes Perl to lose its applicability as server language?

Niklas Rosencrantz
  • 8,008
  • 17
  • 56
  • 95
  • 2
    If "long time to mature" was what mattered, we'd all be coding in COBOL. – Gort the Robot Aug 24 '13 at 16:57
  • 4
    Because Perl was written by a crazy person – aaronman Aug 24 '13 at 16:58
  • 3
    Because since the 90s, the discipline of computer programming has matured a bit, and people have gained a better understanding of the importance of readability. This has led to messy languages like Perl and C++ falling into disfavor. – Mason Wheeler Aug 24 '13 at 17:01
  • @StevenBurnap My Government still codes in COBOL, yes. – Niklas Rosencrantz Aug 24 '13 at 17:05
  • 2
    Also, your premise is a bit flawed. Java, Python and PHP are all around 20 years old, while C# is over 10. All four are quite mature. Go is not mature, but is only popular in the sense that many people are intrigued by it. It's not yet a common language in production. – Gort the Robot Aug 24 '13 at 17:10
  • 2
    To answer the new question - it's not that perl is outdated, but cgi and fast cgi are outdated models. –  Aug 25 '13 at 14:08

2 Answers2

8

The model for web programming in the 90's was to launch an application that used the common gateway interface to launch another process that was forked by the web server.

Forking a process is a rather heavy weight operation. For perl, this means spinning up the interpreter, running it, and then letting the process terminate. When working with heavy loads, this became prohibitively expensive (memory and cpu).

FastCGI reduced the overhead of CGIs by reusing the process, cutting back on the heavy forking of a process. This is more inline with application servers, which leads us to...

The development approach today is to have an application server in a language that has a light weight process threading model, which can handle very large loads (compared to the days of CGI). Of these you have Java, Go, and C# which follow this approach.

This doesn't mean perl is out. There are application servers for Perl. One rarely hears of Catalyst compared to things such as Zope, NodeJS, or the plethora of Java App servers.

Part of this is timing. While the development of Java application servers was going on, Perl has been a bit bogged down with work on perl 6 (any day year now) and so the community as a whole let that development path slip by.

I personally discount the discipline of languages as a reason that perl has missed out pointing to javascript, php and ruby as three examples of similarly undisciplined languages that remain popular in the web area.

Languages such as Java and C# (and to an extent, python) with major company backing (Sun/Oracle, Microsoft, Google) and, yes, more discipline in the language are more appealing to enterprise development.

3

For the same reasons that everybody is writing everything in Java, Python, PHP, and C#... you use the right tool for the job at hand.

Perl really can do anything that you need it to. I mean, Movable Type and Markdown are both widely used pieces of software that are written in Perl, and they are completely different.

The reasons some people don't use Perl are mainly subjective (ugly code, difficult to learn, etc.) but you can say that about any language.

Dynamic
  • 5,746
  • 9
  • 45
  • 73
  • 1
    I can't confirm `ugly code, difficult to learn` at least for Cobol, C and the 370-, Z80- and CDC-Assembler language. – ott-- Aug 24 '13 at 18:53
  • @ott-- That was interesting, can you elaborate? My colleague next door was a 100 % Cobol programmer. I like C, Java is too large. – Niklas Rosencrantz Aug 25 '13 at 13:04