Recent discussions on this site and at OSCON concern the apparent waning of mod_perl popularity. Some may lay the blame the for mod_perl's wilting at the door of the crappy tech market that has dominate these past four years. Others may cite the confusion caused by Apache's painful and prolonged switch from the 1.3 code base to the 2.x one. Inevitably someone will throw philosophic tomatoes at languages like java or python for stealing Perl mindshare. To this witch's brew of finger pointing, I'd like to add this observation:
mod_perl is dying because it solves the wrong problem.
If my Perl compadres aren't sent into paroxyms of rage, consider this line of reasoning. Perl became popular in the nineties as a tool to build web applications via the CGI. mod_perl and fastcgi appeared to turn down the suck knob on the poor performance of those early CGI apps (jeez, they were running on PIII machines; what sort of performance did we expected?) Whereas the fastcgi apache module was meant to make perl CGI "run faster", mod_perl embedded the perl interpreter into apache and created the Perl API to the request cycle of the web server that we all know and love. And as sort of an afterthought, mod_perl also provided a mostly CGI compatible module called Apache::Registry for those that wanted to port existing CGI stuff. But the expectation from the mod_perl camp was that everyone would get into writing apache modules using mod_perl.
This just ain't so.
Now, it's not that mod_perl suck (it doesn't) or that it's not useful in some situations (it is), is just that MOST PEOPLE ARE SIMPLY DOING CGI CRAP. That's right, stupid CGI + HTML is a kind of universal Microsoft Fundation Class that works for programmers of all lanuages. After all, most of us are hired to build a system to solve a business problem. And since writing software for a specific client platform is teh suck, HTTP/CGI is a better platform to program to. A quick look at freshmeat's projects by language reveals this:
Since freshmeat doesn't discriminate between web apps and non web apps, a little fudging is needed to get at my point. While many of the Perl, Python and Java apps listed freshmeat are web apps, almost all the PHP projects are web apps (there are some weirdos out there using CLI PHP). People like using PHP for web stuff and now I know why.
PHP is a terrible language. Perl has long suffered with the albatross of its highly syncretic origin and it's "organic design". However, PHP is a lot worse. It's a kitchen-sink language where crazy things like mysql routines and GD libraries are part of the core language. While objects were around in PHP 4, few PHP systems use OO style. To put a fine point on it, most of the PHP apps I've looked at are poorly written and a bear to debug.
And yet, PHP is frequently a better choice than Perl for web apps. Moreover, users are more likely to try out those PHP apps with their sexy screenshots than go through the hassle of installing a mod_perl app.
PHP, until recently, had no illusions about what sort of programs its users intented to write. It's syntax, "library management" and poor namespace control are all a product of it's problem domain. PHP are easy to write and painless to dispose of. PHP, along with thrice-damned VBScript/ASP, are as the best tools I've seen for rapid web prototyping.
mod_perl doesn't nothing directly to aid web app development. PHP, with its shotgun spray of built-in libraries to do everything from PDF generation to cybercash functions, 0wnz mod_perl.
If you've never installed a PHP app, do. It usually involves downloading an archive, unpacking it in a PHP-aware document root and pointing your browser to the appropriate URL. A web page will walk you through the rest of the setup. This procedure appears to be the rule, not the exception. In the past year, I've installed the following PHP apps: phpBBS, sugarCRM, Jinzora (mp3 streamer), Agatha ([poorly written] mp3 streamer) and SITR knowledge base.
Have you installed any mod_perl apps lately? RT (requires Mason, DBI)? Slash (requires Template Toolkit, DBI)? Wiki and Movable Type are two perl apps I can name that are most PHP-like in their installation. I'm not denigrating Perl, mod_perl or the Perl apps I've named. I'm pointing out that the installation of these apps is a barrier to entry for many people. Perl may be share some blame in this too. Perl's core set of bundled (or "built-in") modules is small compared to PHP, so apps that actually do something besides parsing log files require a trip to CPAN. Oh, you'll probably need to configure apache for mod_perl. And a Directory section for your mod_perl app. So, you'll need to restart apache.
ugh.
mod_perl isn't getting web developers because it isn't a web application framework. PHP is.
A postscript
In a vain attempt to forestall the stupid comments, here's a list of things I'm not saying:
What I am saying is use the right tool for the job. For web apps, PHP is frequently the better tool. mod_perl isn't tool, but a platform.
Now count to 10 and write the smart comments below.
mod_perl app installation (Score:2)
-sam
Agree to a certain extent... (Score:2)
I've got to agree with you, at least in terms of people using mod_perl for super-CGI rather than using mod_perl's strengths.
At Red Hat, we did a little of both. CGI-type scripts for short-term or one-off projects, and sometimes for prototypes. But most of redhat.com was running under Apache::ASP (that might have changed by now, though). The guys who cooked up the rhn.redhat.com site used their own ASP-like system, but it too was done as a location-handler, not a souped-up CGI library.
Unfortunately (and I
--rjray
Re:Agree to a certain extent... (Score:1)
If you must use Apache::Registry, use something like CGI::Application so that you can avoid all of the subroutine traps that Registry causes.
Re:Agree to a certain extent... (Score:2)
You are familiar with the phrase, "preaching to the choir", right?
--rjray
Re:Agree to a certain extent... (Score:1)
Different worlds (Score:2)
Basically, Joel says that there are five major types of software, and each of them have different requirements and are for different audiences. Read the essay to see what that means.
I think PHP and mod_perl live in different worlds, and so do the developers who use either one. And, because of that, I think that trying to make either one take over both worlds is futile.
Here's the two worlds I see: people who don't control their server (
Different levels ? (Score:2)
I think it is not the right thing to compare PHP with mod_perl.
At least from the point of view of the web application developer PHP can be compared to
just to name a few. But even that is not totally correct as PHP provides database access, capability to send e-mail and whatnot while the above frameworks "only" provide the web front end part.
This is a nice list
Re:Different levels ? (Score:1)
installing slash is like having (Score:2)
all the joy of installing ImageMagick on Irix while getting a root canal without anesthetic.
Few people either care about or are skilled enough for fine web performance tuning. Who gives a fuck if PHP is slow and ugly, the apps are there, easy to install and most importantly, they work. Well, most of the time.
For years Perl people laughed when I thought that geriatric software for grandparents was an untapped market for perl since, if gran can install it, anyone can. Sadly, it was declared unmanly to ha
Re:installing slash is like having (Score:1)
Depending on the truth of this (may just be your particular experience here, and not everyones .. anecdotal evidence...), this itself may be the single largest reason for the lack of adoption. If getting both functioning on the same server is rather a bear to accomplish, which one do you think they are more likely to use?
Also there is a major amount of perception that mo
Re:installing slash is like having (Score:2)
I wasn't the first to experience this even though Solaris isn't linux, but Jarkko has said the same thing so I feel reasonably certain that it's either an obvious triviality that we all missed or it really is a major PITA/impossibility. I spent 4 days with a square peg, a round hole and a hammer and all I got was a crashy crashy pile of shite that liked neither perl nor php. Installing mod_php by itself took 15 minutes and I had an app running a few minutes later without having to download half of CPAN. I
Re:installing slash is like having (Score:1)
Re:installing slash is like having (Score:1)
Re:installing slash is like having (Score:2)
I don't think you understood what I was saying. I said 'esoteric' bug which means something very unusual which can be very difficult and very frustrating to locate and solve. It's not for the average user.
My CPAN complaints come from my own as well as plenty of other people who share the pain of CPAN dependency chains. It was a big topic as last years CPAN meeting as it's a problem. Clearly, you don't understand what I'm talking about as it's not about bundling dependencies. When one module hoovers in 1
Re:installing slash is like having (Score:1)
My interpretation of your dependency issues is that you're saying some modules use lots of other modules for small things, and maybe they don't need to. However, if you bundle all of the needed modules for your app with the app itself, there is no need to go to CPAN at all when installing it, so it's a moot point. See the Krang distributions [sf.net] for example. All needed modules are included.
Re:installing slash is like having (Score:2)
I figure when Doug McEchern had no idea how to fix a particular problem I found a while back, I thick it goes beyond tricky.
They aren't /MY/ dependency issues, it's something I hear a lot of people bitch about and I'm not terribly fond of a module, literally, hoovering in 115 modules from CPAN, bundled or not. Especially when module versions and perl versions are moving targets wrt to those. Again, I don't think you fully understand the problem.
Pain? (Score:1)
Linux overtakes Mac OS X on the desktop [computerworld.com].
Re:Pain? (Score:2)
Re:installing slash is like having (Score:2)
In fact, we're able to use Apache notes to pass information between Perl and PHP processes with no problems at all.
For anyone else who cares, the process is roughly:
$ config Apache $ config, build and install mod_perl $ config, build and install mod_php $ config Apache (yes, a--
xoa
Packaging Systems (Score:1)
I can easily install RT, Maypole, Bricolage, Mason, TT, etc.
Sure, not everyone understands the value of a good packaging system, or uses an OS that doesn't offer one, but they deserve recognition for helping solve the installation at least for popular mod_perl applications.
Very good... (Score:1)
Yep (Score:2)
mod_perl isn't getting web developers because it isn't a web application framework. PHP is.
Perl is like Lisp. We have the base language, on which we write the language in which we will write our program. I'm sure people who truly grok Lisp and all of Paul Graham's stuff will say Perl doesn't completely fulfill this, but I think it does partially. We create, at least, a hybrid language that consists of Perl + whatever modules we deem necessary.
Look at the way everyone writes their own templating sys
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Re:Yep (Score:1)
But to me it makes no difference if Perl captures the PHP market or not. (I suspect it's no big deal to you, either.)
You're right. I don't care all that much about Perl in the web space specifically, but I'd like to see Perl capture the general application development market. Perl replacing VB (via .NET) is a beautiful dream.
I doubt it will happen though. Still, Perl has been a huge influence on so many of the modern languages. It's humbling.
Re:Yep (Score:2)
Yep. And that's why it's totally irrelevant Perl will or will not see widespread use for general application development. You can focus on the near horizon -- getting Perl used in the mainstream -- or you can focus on the far horizon -- getting the features and principles behind Perl adopted by the mainstream.
Ask yourself if the programs you write today are better than the programs you wrote five or ten years ag
Re:Yep (Score:2)
But for those of us who use Perl for completely non-web related things, we could care less if Perl beats out other languages in the webapp space. The right tool should be used for the job. If PHP does the job better, great!
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers