<?xml version="1.0" encoding="windows-1252"?>
<node id="519032" title="A Vision for Easy Web Application Deployment for Perl" created="2005-12-25 17:46:47" updated="2005-12-25 12:46:47">
<type id="120">
perlmeditation</type>
<author id="20513">
markjugg</author>
<data>
<field name="doctext">
&lt;h3&gt;The problem&lt;/h3&gt;

&lt;p&gt;Installing a Perl web application should be as easy as "1. Unpack 2. Upload 3.
Visit URL for configuration". Typically it isn't this easy, especially when the
application follows the best practice of re-using CPAN modules. &lt;/p&gt;

&lt;p&gt;By contrast, my average experience installing a PHP web application has been
impressively easy, approximating the three step process I outlined above. &lt;/p&gt;

&lt;p&gt;There's certainly nothing about the language itself that restricts this ease
use. DadaMail has basically &lt;a href="http://mojo.skazat.com/installation/"&gt;got it&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The DadaMail difference is that bucks the norms of CPAN culture. It doesn't
exist on CPAN, and it bundles the modules it depends on from CPAN rather than
requiring the users to fetch them themselves. &lt;/p&gt;

&lt;readmore&gt;

&lt;h3&gt;CPAN was designed with geeks in mind, not end users.&lt;/h3&gt;

&lt;p&gt;Having end users get modules themselves from would a better experience if it
were designed for them. As an installation &lt;code&gt;cpan&lt;/code&gt; appears to primary
desired for users who run as root and have a shell and and compiler handy.
Sure, there are documented ways to install modules as a non-root user, but
it Shouldn't Be That Hard.&lt;/p&gt;

&lt;p&gt;As a result, Perl apps aren't seeing the user base that they could. For
example, &lt;a href="http://search.cpan.org/perldoc?WWW::Selenium::Utils"&gt;selenium-regen&lt;/a&gt; 
is a nice helper script for use with &lt;a href="http://www.openqa.org/selenium"&gt;
Selenium&lt;/a&gt;. It comes bundled in the WWW-Selenium-Utils distribution. It would
    be useful to a lot of people outside of the Perl community, but fussing
with installing related CPAN modules is required to use it. 
&lt;/p&gt;

&lt;h3&gt;The merits of bundling prequisites&lt;/h3&gt;

&lt;p&gt;Some people react negatively to the idea of bundling prerequisites, as DadaMail
has done. When you do this, the argument goes, it will be difficult to deploy
upgrades of the bundled modules because you now have several copies in use with
one copy in each bundle.&lt;/p&gt;

&lt;p&gt;Doing sysadin for a website development and hosting company, I've had the
chance to experience the recommended "everyone uses one copy" philosophy. I'll
be clear this has significant drawbacks as well. This design assumes that
upgrades tend to make things better and that backwards compatibility is
maintained. In practice, the only thing for certain about an upgrade is that
Something Changed. The more projects that depend on that module, the greater
chance there is that one them depended on the behavior before the change
happened.&lt;/p&gt;

&lt;p&gt;So while this approach may save module installation time, it potentially
destabilizes the overall system, and requires quality assurance testing of all
the projects that use the required module. Attention may still be needed to be
given to many projects hosted on the server.&lt;/p&gt;

&lt;h3&gt;A little infrastructure may go a long way.&lt;/h3&gt;

&lt;p&gt;I have a vision for an alternate way to access CPAN that addresses these
concerns. &lt;/p&gt;

&lt;p&gt;This site would be designed for end-users and end user applications, not
necessarily programmers and modules. However, unlike all the "script archives"
out there, this system would be designed for projects built primary with 
CPAN modules. &lt;/p&gt;

&lt;p&gt;When a user clicks a download link here, they would receive a tar ball which
bundles all the distributions the project depends on. The distribution authors would only
need to generate hints about these in a normal CPAN upload. The infrastracture
would take care of generating the tar balls. &lt;/p&gt;

&lt;p&gt;The result would be something that could be unpacked and uploaded, without
additional installations or command line fussing. &lt;/p&gt;

&lt;h3&gt;Handling Perl XS&lt;/h3&gt;

&lt;p&gt;Handling Perl XS code would be the trickiest part of this system. "XS" code is C
code compiled for a particular architecture. &lt;/p&gt;

&lt;p&gt;Here we can follow in the footsteps of how Linux distributions already handle
this for Perl XS code: by making binary packages for each target architecture. &lt;/p&gt;

&lt;p&gt;From my initial poking around, it seems we have the key tools to address this
systemically, by automatically (or easily) generating and uploading platform-specific
binaries for each distribution which directly uses XS. &lt;/p&gt;

&lt;a href="http://par.perl.org"&gt;PAR&lt;/a&gt; generates platform-specific binaries for
Perl distributions. Adding PAR integration to a typical Perl distribution is so
easy that it could be automated in many cases. For a typical Makefile.PL, you
can simply &lt;code&gt;use inc::Module::Install;&lt;/code&gt; instead of
&lt;code&gt;ExtUtils::MakeMaker&lt;/code&gt;, and then add a line at the bottom like:
&lt;code&gt;  par_base('MARKSTOS'); &lt;/code&gt;.  Now &lt;code&gt;make par&lt;/code&gt; is available
to generate a PAR file made just for your platform.

&lt;h3&gt;In Conclusion&lt;/h3&gt;

&lt;p&gt;Making Perl applications easier to deploy helps us all. Our work becomes more
accessible to others, lowering the bar for gaining new users and contributors.&lt;/p&gt;

&lt;p&gt;Historically, The infrastructure of CPAN has been a tremendous assest our
community.  Let's take the lesson of the value of good infrastructure and use
it to expand the reach of Perl. &lt;/p&gt;




&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-20513"&gt;
&lt;P&gt;
[markjugg|Mark Stosberg]
&lt;/div&gt;&lt;/div&gt;
</field>
</data>
</node>
