The evolution of Perl frameworks

| 7 Comments

by Mark Stosberg

In 2006, the arena of Perl web frameworks pitted the heavyweight Catalyst against the lightweight CGI::Application. Since then Perl’s framework options have continued to evolve. While both CGI::Application and Catalyst remain popular, several new options have appeared lately. Here’s a quick rundown.

Titanium provides CGI::Application and a bundle of recommended plugins with unified documentation and easier installation. Because the underlying components are the same solid ones that have already been in use, it’s safe and stable to use, despite the new name. Future plans include providing a download package which bundles the dependency chain, for even easier installation.

HTTP::Engine is Moose-based evolution of the HTTP request object we saw in Catalyst, along with the abstractions to run web apps on various server backends. In short, it focuses on the HTTP parts of the web framework stack. On top of that you can build a complete framework in whatever style you want.

Mojo and Mojolicious represent a project lead by Sebastian Riedel, one of the original Catalyst contributors. Mojo is distictive for having no dependencies beyond core Perl. Mojo provides the same kind of low-level HTTP components as HTTP::Engine, while Mojolicious represents one possible complete framework built on top of it. Mojolicious’ distictive feature is a new dispatching design in the spirit of Ruby-on-Rails “Routes”. I have more in-depth review of Mojo.

Some trends I see:

  • Shared infrastructure — While Perl frameworks continue to compete at a high level, we continue to collaborate on shared utility modules. Projects like HTTP::FillInForm and Data::FormValidator get used by several frameworks, not re-invented.
  • CGI.pm must die — While we share some things, HTTP::Engine, Catalyst and Mojo have all invented their own HTTP request object, replacing the function of CGI.pm. Clearly there is an interest is moving beyond this old standby, which crams 172 subroutines into the CGI name space. (CGI::Application remains neutral on this point, outsourcing the query object)
  • Potential for convergence — A number of CGI::Application and Catalyst plugins are rather similar, but not interchangable. Because they are open source, they are usually easy to port from one framework to the other, but this is not ideal. HTTP::Engine and Mojo are both a kind of “framework for frameworks”. I see potential for projects to agree on which backend they use, while providing distinctive experiences for programmers who may want to choose a lightweight framework or a featureful one. The result could be web framework plugins which more widely useful to the Perl community.

Mark Stosberg has been using programming Perl for the web for over a decade. He is the Principal Developer at Summersault and maintains several CPAN modules including Titanium and Data::FormValidator.

7 Comments

As a disclaimer: This post doesn't try to highlight every new Perl web framework, it focuses on a few that caught my interest. Feel free to add comments or create new blog posts about others not listed here.

I've long wondered why other languages haven't adopted Python's WSGI. It seems to work well for their web libraries.

Hi!

Nice article, but I feel it could be better if it were more comprehensive.

I added a link to it to this page on the CMS Wikia, because it's relevant to the Wikia's mission.

HTTP::Engine self-describes itself as being inspired by WSGI. Presumably that also means it tries to have as little policy as possible, and would form a basis for library sharing... though WSGI (and I think Ruby's Rack) try to actually eschew libraries entirely as an abstraction and instead use a specification of a basic data structure. It's unclear to me how close HTTP::Engine is to this -- if it's just a series of adapters and wrappers around its own ad hoc internal data structure, then it might be close if that ad hoc structure can be better formalized.

Also Wikipedia has a list of Perl web frameworks...

http://en.wikipedia.org/wiki/List_of_web_application_frameworks#Perl

However it does need updating a bit (anyone want to help?).

/I3az/

Good evalution history, thanks! do you have any other links to the perl framework docs, i want learn about it something.

Leave a comment

Job hunting for programmers


Land the Tech Job You Love, Andy Lester's guide to job hunting for programmers and other technical professionals, is available in PDF, ePub and .mobi formats, all DRM-free, as well as good old-fashioned paper.