Sebastian Riedel - The Mojo Documentation Project

Title: The Mojo Documentation Project

Name: Sebastian Riedel

Grant Manager: Adrian Howard

Duration: 3 months

Started: December, 2008

Amount Requested: $3000

During the last few months i've done some self funded work on a next generation web framework named Mojo. It is now quite close to a public release and needs documentation.

Benefits to the Perl Community
Mojo is not just another web framework, it is more of a framework for framework developers.

When you take a look around you will notice a trend towards very specialized web frameworks, more and more of those are released every day. (Not just in the Perl Universe) Many are extracted from web applications and optimized for a given task like writing blog engines.

These frameworks might look very different on the surface, but they all share the same foundations and unneccessarily reinvent a lot of wheels.

What Mojo offers is a very convenient runtime environment for web frameworks providing reusable wheels like CGI/FastCGI bindings, test server, test framework, code generator framework and much more.

The Mojo framework is not a monolithic brick like Catalyst, instead it has multiple layers that could be used independently if desired.

  • Curse: The pure-Perl HTTP 1.1 client/server implementation that powers Mojo, with CGI/FastCGI support, async io based client designed specifically for stress testing web applications and a solid test server. Curse could be considered the LWP for the server side.
  • Mojo: A generic mainloop for web frameworks with request/response abstraction, code generators and test helpers. Also contains generic dispatchers and views that can be used for simple web applications. While everything was designed with MVC in mind other architectures are possible too.
  • Nevermore: Simple OO-Perl helpers designed for portability, not using any magic that could make it harder for new Perl users to understand whats going on.
  • Voodoo: A minimalistic and very Perl-ish template engine designed to be mainly used in code generators. Quite similar to Ruby's erb.
  • "Unnamed": A cache and session framework is currently in the works, but might not be ready for the first release.

Another killer-feature of Mojo is that it has no prereqs except for Perl 5.8, which should boost it usability wise into the same league as PHP.

Mojo was also designed with a Perl6 port in mind from the start, this and having no prereqs, should make sure that Mojo will be one of the first feature complete ported Perl6 modules available, imagine that! :)


1. A substantial manual for the Mojo web framework containing at least the following chapters.

  • GettingStarted
  • CurseGuide
  • FrameworkBuilding
  • Cookbook
  • CodingGuidelines

2. Some people learn better by reading code, so we will also need 3 example applications demonstrating all important aspects of Mojo.

  • MojoApplication
  • MojoFramework
  • RebrandedMojoFramework

3. To make the whole project more accessible to the community, i will also be blogging for the whole duration of this grant. Blog entries will contain short introductions to Mojo and mostly recipes from the cookbook. Reader feedback will be used in the writing process to increase the quality of the manual.

Project Details
The manual will propably take most of the time.

  • GettingStarted: A tutorial written for people who might have never used Perl before. Back in the days i learned Perl by writing scripts with, which was a hell of a lot of fun. Times have changed, is dead, but Mojo can provide the same great experience.
  • CurseGuide: A complete reference guide to the HTTP 1.1 client/server implementation that powers Mojo. From simple GET oneliners to complicated edge cases like 100 Continue or chunked encoding.
  • FrameworkBuilding: A framework builders guide containing everything from writing your first dispatcher to rebranding the whole framework for CPAN distibution.
  • Cookbook: Many many recipes like "How to stress test your application without using fork() or threads in a simple unit test" or "How to implement your very own micro-PHP".
  • CodingGuidelines: A small collection of coding guidelines for contributers and the mission statement of the project. To make sure the original vision never gets lost like it happened to Catalyst.

Not less important but a bit easier are the examples.

  • MojoApplication: A simple application utilizing everything Mojo has to offer to application developers, like serving static/dynamic files with built in dispatchers, voodoo templates, unit tests and much more.
  • MojoFramework: A simple example web framework, demonstrating how to use Mojo as a runtime environment, including a custom dispatcher and template engine.
  • RebrandedMojoFramework: A more advanced example web framework, completely rebranded and ready for CPAN distribution, with everything from custom code generators to a custom test framework.

Project Schedule
This project should take me 2 to 3 months.

Sebastian Riedel is a freelance Perl programmer living in northern Germany and the founder of the Catalyst project. (