Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Perl mindshare in web development

by gunzip (Pilgrim)
on May 19, 2006 at 19:02 UTC ( [id://550563] : perlmeditation . print w/replies, xml ) Need Help??

I just read through this article on Slashdot and noticed hardly any references to Perl in the comments, despite Perl's numerous frameworks and templating systems. By contrast the numerous references to PHP led me to the conclusion that PHP is now dominating mindshare in the sphere of web development even amongst the more sophisticated developers.

One of the reasons for this, besides PHP being a niche language, may be that Perl books tend to be too generalised. There are only a couple of Perl web development books and often the TMTOWTDI principle can be overwhelming for newcomers.

Is it time for the Perl community to start focussing on a dominant framework/templating system if only to generate some good books and make it easier for ISPs to have a complete kit installed without too much fuss? A few fully-worked code samples for web applications might also be helpful.

Replies are listed 'Best First'.
Re: Perl mindshare in web development
by Fletch (Bishop) on May 19, 2006 at 19:21 UTC

    Perl is a general purpose programming language; PHP is a niche language. The later has been struggling to expand out of its niche, why would anyone want to paint Perl into one?

    Yes there's no dominant framework, but why does there have to be just one? The different frameworks have different strengths and weaknesses; TMTOWTDI is a feature. Even with the ascendance of Rails and its buzz in Ruby-land it's not the only game in town (c.f. Nitro and Og).

    Additionally: Do we really want to return to the days when people inevitably thought "CGI" and "Web" and "Perl" (or more often, "PERL") are all the same thing and are unable to distinguish which their problem really has to do with?

Re: Perl mindshare in web development
by chromatic (Archbishop) on May 19, 2006 at 19:19 UTC
    Is it time for the Perl community to start focussing on a dominant framework/templating system...

    Which one?

    (Be careful which one you pick. One candidate steadfastly refuses to pick a dominant templating system or database layer or....)

    ...and make it easier for ISPs to have a complete kit installed without too much fuss?

    There ought to be a mod_perl replacement then that does as little as mod_php. Then the only trick is getting it installed by default by thousands of really cheap hosting places and Linux distributions.

      Now that FastCGI is available on more ISPs (due to Rails), you can do Perl that way. It's roughly equivalent to what you can do with mod_php.
      There ought to be a mod_perl replacement then that does as little as mod_php

      Perhaps someone should resurrect mod_tt.

      --
      <http://dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

Re: Perl mindshare in web development
by samtregar (Abbot) on May 19, 2006 at 19:48 UTC
    Articles, talks and books welcome, dude. Of course, if you do your homework first you'll find that lots of articles, talks and books have already been done on this topic! Don't let that stop you though - if Rails has proven anything it's that basic MVC techniques are ripe for re-discovery.

    As for standardizing around one framework, even if it was desirable (which I don't think it is), it's hardly possible. Too many projects have too much invested in their framework to just walk away from it (ex: Krang and CGI::Application, Bricolage and HTML::Mason, etc.). Clearly there are many ways to build a web app and the Perl community is far too diverse to ever agree on just one!

    -sam

Re: Perl mindshare in web development
by TedPride (Priest) on May 19, 2006 at 21:53 UTC
    Why would I care what Slashdot says? I go here, not there. That having been said, PHP's ease of use means that most people are going to start with it rather than Perl, and even experienced Perl programmers may use it for small things, rather than going to the bother of messing with templates. The single best thing that could be done to popularize Perl to the masses would be to make Perl code embeddable in pages:
    My rocket ship goes:<br> <?perl print join ' ', reverse 'BLAST OFF!', 0..10; ?>
    This sort of format is really the only thing that makes PHP popular. If Perl could do that, I'd never touch PHP again. Also, someone needs to make an extended Perl install (and updater) that includes all the most popular modules not included in the standard install. Installing and updating modules can be a painful process, and programmers shouldn't have to worry about that side of things.
      Then have a look at the Template Toolkit, which allows you to do:
      My rocket ship goes:<br> [% PERL %] print join ' ', reverse 'BLAST OFF!', 0..10; [% END %]
      You don't even have to lear the Template Toolkit language as you can use just Perl if you like. I don't think you can get any closer to embedding Perl than this.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

      The single best thing that could be done to popularize Perl to the masses would be to make Perl code embeddable in pages...This sort of format is really the only thing that makes PHP popular. If Perl could do that, I'd never touch PHP
      I can't understand why embedding code in webpages is so widely considered a special ability of PHP which Perl lacks when that is such a basic built-in feature of mod_perl.

      Why hasn't anyone mentioned Perl Server-Side Includes which Apache 1.3 provides out of the box with mod_include?

      <!--#perl sub="print q~one line of perl code~" -->
      It's so easy, so powerful, so... obvious!
      <!--#perl sub="sub{ $_ = 'Multiple lines of Perl code.'; s/\.$/.../; print }"-->
      Apache 2.0 moves this capability to the Apache::IncludeHook module.
      If Perl could do that
      Famous last words. What made you think it could not?
        I can't understand why embedding code in webpages is so widely considered a special ability of PHP which Perl lacks when that is such a basic built-in feature of mod_perl.

        Because "mod_perl compiled with the SSI option" ne "perl".

        Because the "out the box" experience with PHP for the web for most people is a Apache already enabled with mod_php. For Perl it's the good old fashioned cgi-bin directory.

        Yes, Perl can do all that PHP can do. Yes, in many cases it can do it better from a certain technical perspective. But for most people getting up and running with PHP is way easier than getting up and running with mod_perl.

        A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl mindshare in web development
by phaylon (Curate) on May 22, 2006 at 10:42 UTC
    Is it time for the Perl community to start focussing on a dominant framework/templating system if only to generate some good books and make it easier for ISPs to have a complete kit installed without too much fuss?
    I'd have to say: No. If you ask me, it's time to stop being jealous of what Ruby and PHP have. That's popularity and a broad user base. My main issue with these is that with more people coming it seems that there comes a lower skill level.

    What I'd like Perl to focus on is deployment features.
    • Independence: See for example the Catalyst framwork that runs on mod_perl, FastCGI a built-in server and more, with enough abstraction to allow new engines to be added.
    • Packaging: of Modules as well as of applications, for ease of deployment. Personally, I miss something generic to attach a specific version of a module to an application, if the module is rather critical.
    I think Perl is pretty good as it istm, and the Community works because it's filled with passionated, experienced users. I'd personally rather not want a broader userbase to come and lower the average technological level. I like Perl's professional attitude much, much more.

    Another point would be: Who should focus? It's up to the users what they choose, and up to the writers what they publish books about. Sure, the writers could just pick a framework, but who says the userbase will follow that lead? It's not that Catalyst, Jifty, Mojo or Maypole are all doing the same thing just in different colors. There isn't *the* framework, but merely a framework for a specific time/person/problem.

    The community is vital and evolving on many edges. I like that.

    Ordinary morality is for ordinary people. -- Aleister Crowley
Re: Perl mindshare in web development
by TedPride (Priest) on May 20, 2006 at 18:02 UTC
    Ok, that looks a lot closer to the PHP syntax. I do wonder about the following, though:

    "Blocks of the form <% xxx %> are replaced with the result of evaluating xxx as a single Perl expression."

    Is the page file run like a regular Perl script, only with things outside the Perl tags returned as-is? Or is there an extra layer between the Perl interpreter and the page that does messy things like eval to convert the page to output? In other words, is Mason actually integrated into the basic Perl, or is it sitting on top? How does the efficiency compare to PHP?

      Mason is not more "integrated" into Perl than other modules are, but I don't think it's relevant. Mason turns your page into a Perl subroutine. It's all done internally, and you typically don't need to think about how it works. PHP has to do something similar, i.e. compile the page into code before running it. PHP is a little faster than Mason, but other Perl projects like Embperl and Apache::ASP are about the same speed. You can read about other in-line Perl templating tools in my essay.
Re: Perl mindshare in web development
by davorg (Chancellor) on May 22, 2006 at 09:31 UTC
    Is it time for the Perl community to start focussing on a dominant framework/templating system if only to generate some good books and make it easier for ISPs to have a complete kit installed without too much fuss?

    Personally, I think that's a good idea - for reasons that I discussed on my O'Reilly blog. I don't think for a second that it'll happen tho' :-/

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Perl mindshare in web development
by samizdat (Vicar) on May 22, 2006 at 18:40 UTC
    The points in your question that I'd agree with are that more books on specific topics are good and that Perl books are often very generalized. Yes, this can be a handicap for the rawest newbies, but anybody with any exposure to programming in the Cold Cruel WorldTM quickly wants to do more than say 'Hello, World' in FONT SIZE='7'. It is very true that PHP has benefitted from the fact that its TIOOWTDI constraints make books easy to write clearly. It has a very limited problem domain, and thus there aren't many options to write about.

    I don't think we need to focus on one templating system. I don't see books on TT being in conflict with books on Catalyst or Embperl. Better to have books on all three!

    A good example of why having multiple options is a positive virtue: OpenBSD has probably the smallest user community of all BSD and linux variants, but every single one of the others now includes OpenSSH, and the same thing is happening with the pf security construct. Cross-pollination between open source projects means that good features get propagated in many directions.

    Don Wilde
    "There's more than one level to any answer."
Re: Perl mindshare in web development
by spiritway (Vicar) on May 25, 2006 at 05:47 UTC

    I don't think that it would serve any good purpose to try to manipulate or guide "mindshare" or public opinion or whatever. Perl stands or falls on its own merits, regardless of what PHP is doing. And of course, PHP *is* a niche language, having little use outside of Web applications.

    Perl just won't fit into the PHP niche. Perl is a general-purpose language that can do so much, it defies a simple categorization. It's a Web-development language; but not *only* that. It's a glue language; but so much more than that. It does so much that it would be misleading to try to portray it as "just" anything (except maybe, "just about anything you can think of".

    I think your comment about newcomers being overwhelmed is a little bit overstated (though it has some truth to it). True - a newcomer can easily be overwhelmed by all of Perl's features, functions, modules, and uses. But a newcomer can start writing useful, working programs within a very short time, using only a small number of these features. The good news is that you don't *have* to know the whole language - or even a big part of it - to get something done. As you continue to learn, you become more adept at writing better, more powerful programs, but you can jump right in and start doing things right away.

    Slashdot discusses a wide variety of IT issues and languages, of which Perl is only one facet. Naturally it won't focus on Perl to the extent that we do here; and when it comes to Web development, it may not even give Perl the attention it deserves. Still, I'd rather have that, than people assuming Perl is nothing more than a _______ language, fill in the blank with just about anything. Already there is misleading information that Perl is "only" a scripting language or a glue language. Why cram it into a "Web-application" language, too?

Re: Perl mindshare in web development
by tphyahoo (Vicar) on May 27, 2006 at 12:53 UTC
    Based on my experience with the catalyst framework so far, I think maybe we need a different kind of web hosting for perl web: perl friendly user mode linux / or xen linux "rootboxes".

    Perl has a lot of cool stuff, but yes, it's a pain to install. It's especially a pain to install if you're not root. Has something to do with problems in Module::Build or something along those lines... I don't completely understand it, but I can fairly say that catalyst install as root is not too difficult. Not as root, painful.

    Traditionally to be root you needed your own web server, but with the rise of uml/xen/paravirtualization, you can now have many "root" systems on a single box.

    I think it would be cool to have, eg, perl catalyst hosting where everything is preconfigured and you can just start coding, similar to what you have now with php hosting for 5-10 dollars. Then perl could really compmete with php/ror.

    Catalyst a really powerful framework but it is unnecessarily hard to configure and get up and running, in my opinion.

    Just thinking out loud...

Re: Perl mindshare in web development
by TedPride (Priest) on May 20, 2006 at 06:32 UTC
    Which of the 450943239 Mason modules am I supposed to be looking at? I checked several, and Mason appears to be (a) something you have to install separately from the main Perl installation and (b) not even close to the format I just stated. I am not looking for a templating system - I already know of several, and for that matter could roll my own - but am rather looking for something that lets you embed Perl code inside HTML pages through simple "on Perl" / "off Perl" tags and a special page ending (settable through .htaccess, of course).
      Look at the distribution name, not the module name. It's a distribution you have to install in addition to the main Perl installation. I think it's pretty similar to the kind of syntax you're talking about, no?