in reply to Perl in the Enterprise

I eschew the use of the 'E' word, due to the repeated and blatant abuse of the term as marketing hype from empty suits, I'll assume the original author intended the term to be interpretted as "mission critical, scalable, networked, secure, fault-tolerant (or at least fault recoverable), possibly web-based, possibly transactional". Think "J2EE/WebSphere/WebLogic/et al".

I recently implemented/delivered a pure-Perl application (framework, actually) that meets many of those requirements. While it took some convincing, after I delivered the first working prototype in a few days, the debate quieted some. Then a few days later I delivered the updated prototype with some add'l features the customer tacked on, and they consented to let me proceed with Perl (they had a pretty serious jones for C++, but were smart enough to understand that the complexity and platform migration requirements would probably doom such an effort).

So here's my experience:

  1. I don't use IDEs, but the customer wanted one, so I pointed them at the usual suspects (EPIC, Komodo, OptiPerl). They've been pretty happy with Komodo. I, however, am still searching for a solution that provides a usable debugger for multithreaded (even multiprocess) apps. (Maybe someday I'll have time to pursue it w/ Devel::STrace)

  2. I decided to use a threads based solution (primarily since it had to run on Win32, where it would be threaded whether I forked or not, and I'd be running on SMP h/w). Unfortunately, as many of us know, Perl threads are a double-edged sword, and continue to be fraught with issues (jdhedden's recent excellent efforts notwithstanding). Hence, I had to build a lot of infrastructure to provide a reasonable solution to OO + threaded Perl.

  3. Staff resources were at a premium: it was basically me and half time of one of their staff. As a result, things got hectic toward the end, and testing suffered. However, the framework met most requirements. Eventually, problems surfaced during deployment (as usual), but most problems were identified/fixed within 24 hours, and the patching process using Perl couldn't have been simpler. ("Here's a new module, just run the usual make/make install."). Additionally, the app had originally been targeted for Win2K3, so thats where most testing occured. During deployment, the customer decided to switch to Linux. While there were a few hiccups, the migration was nearly painless (I think that effort may have fully convinced the customer). Finally, the biggest doubt in the customer's mind - performance - was allayed when a large number of users were able to use the framework without any noticeable processing delays. (tho I certainly still have some concerns, esp. with threads::shared, and with the large footprint resulting when 20-40 threads are in use).

  4. The biggest issue thus far has been fault tolerance/recovery (which should be a clue that this is definitely an 'E' word app). E.g., see Perl coredump analysis tool ? and Devel::STrace: strace for Perl scripts (with some seedlings) for details and the eventual solution; I'll definitely be researching more module reload and thread management capabilities in the next release cycle.

So I'm convinced that Perl is capable of meeting the 'E' class requirements I outlined above. But I do have some reservations - and a few frustrations.

To summarize:

As to the authors contentions of Perl's shortcomings:

One non-obvious issue may be the lack of a single "bible" of writing 'E' class Perl. Many Perl tomes exist, but they all tend to focus on a specific application set or API, or on the language itself. I'm unaware of any book or website that has attempted a complete and lucid discussion of building 'E' class apps using Perl, ala the shelfloads of J2EE books. (IMHO, P5EE doesn't count, its not much more than a laundry list).

Replies are listed 'Best First'.
Re^2: Perl in the Enterprise
by apotheon (Deacon) on May 20, 2006 at 07:55 UTC

    I basically agree with everything you've said (at least, everything with which I've enough familiarity to be able to come to a reasonable conclusion), with one exception: I'm convinced of another benefit to "native compilation" (meaning persistent binary executable compilation, of course).

    This is really a social benefit, rather than a technical benefit, though it is a technical side-effect that creates this benefit. In particular, I refer to portability. I don't mean portability across platforms, but across implementations of a single platform, via end-users. End-users like having an "installer" that creates an executable program without attendant dependencies. That's often largely irrelevant for Perl on Linux, but highly relevant on Windows systems, where Perl parsers are a rare beast indeed (amongst poplations of people who aren't Perl programmers, at any rate). The ability to simply and easily produce a persistent binary executable that requires no installed parser (or modules/libraries specific to it, for that matter) has I think been a significant advantage for the universalization of C/C++, and the marketing drive to get JVMs of various descriptions installed on every workstation, server, laptop, toaster, and dead badger on the planet by Sun has mitigated this social shortfall for Java enough to overcome that barrier to widespread use of applications developed in that language. Until something written in Perl can be downloaded, one-click "installed", and run on an otherwise "bare bones" MS Windows install (or until MS Windows isn't the default end user OS), we aren't going to see Perl enjoying the same popularity as certain other languages.

    The easiest way to achieve that, I think, is to suddenly sprout a compiler of persistent binary executables for Perl.

    print substr("Just another Perl hacker", 0, -2);
    - apotheon
    CopyWrite Chad Perrin

      While Perl doesn't offer compilation to bytecode (before execution), it is possible to create stand-alone applications by packing all resources in a self-contained, executable archive.
      Of course, I am talking about the PAR module here (Homepage, CPAN).

      Now, it is a little rough around the edges here and there, but it's actively maintained and I have personally used it with large applications in enterprise environments.

        That doesn't cut it. I'm aware of the executable archive bundles that are possible -- but something that creates such redundancy by bunding another Perl compiler with every single executable just doesn't really cut it, particularly since it really cuts against the grain for developers who spend so much time trying to eliminate redundant code. Whereas the ease of distribution of an independent executable application serves the social need of end users, the lack of a need to distribute a parser with every single installation of a given application serves the social need of the developers -- and lacking that, developers tend to focus on users who already have the parser, or use a different language.

        Sure, it can be handy to be able to create these executable archives sometimes, but use of that capability tends to be the exception rather than the rule.

        Also . . . I'm not talking about bytecode (which needs a VM to run), but a stand-alone persistent binary compiled executable file.

        print substr("Just another Perl hacker", 0, -2);
        - apotheon
        CopyWrite Chad Perrin