2010 WebGUI Contributor of the Year Award

… JT Smith opened the conference with his annual State of WebGUI speech, in which he highlighted many upcoming features in WebGUI 8. In addition, the Contributor of the Year and Colin Kuskie Award for community contributions were announced. This year’s Colin Kuskie award went out to Patrick Donelan. Patrick was recognized for his contributions to WebGUI 8, in particular for single-handedly increasing the performance of WebGUI by over 300%. This year’s Contributor of the Year award recognizes an outstanding business contribution. United Knowledge won the Contributor of the Year award for their dedication to the Template Working Group, which is working towards standardizing all WebGUI asset templates…

via plainblack.com

Thanks guys!

WUC 2010 Post-Conference Wrap

I was in Madison last week for my third consecutive WebGUI User Conference, affectionately known as “the WUC” (rhymes with “chook”… that’s Australian for chicken).

I spent the pre-conference hackathon working on getting WebGUI 8 to run under Mongrel 2, thanks to lestrrat‘s experimental Plack::Handler::Mongrel2. Since WebGUI 8 is a Perl Plack app, it wasn’t an overly complicated task – I spent most of my time getting up to speed on Mongrel2 itself and learning why a language-agnostic web server rocks (ZeroMQ++). Along the way I found a bizarre bug where Image::Magick was causing the server to hang – but apart from that it was smooth sailing.

The pay-off was being able to show off a live demo of Mongrel2 running WebGUI alongside a Python / JSSocket chat app and a streaming MP3 server all on the same domain as part of my “Plack and the Post-Apache Future of WebGUI” talk the next day (the streaming MP3 server meant that I was able to include a You Am I song in my talk which probably no-one at all in the audience recognised..). I also did a live demo of gugod, clkao and c9s’ very cool XDFighter WebSocket demo (again mounted in the same domain as a WebGUI site), with help from Andy who controlled one of the stick figure fighters from the audience via his iPhone.

None of which was very WebGUI-centric, but that was kinda the point: every cool thing that happens in the Perl PSGI/Plack world is now a WebGUI feature by default :)

The rest of the conference was spent enjoying Wisconsin’s unfair abundance of fantastic locally brewed beer (and fried cheese curd!) and hanging out with all the awesome American and Dutch members of the WebGUI family – many who have attended more WUCs than they can count on one hand (a good reflection of how much fun the WebGUI conferences are).

I’ve submitted a modified version of my talk for the Pittsburgh Perl Workshop (PPW) in October titled s/modperl/plack/, with the intention of ripping out the Plack introduction (people can get a much better version of that at PPW from the horse’s mouth) and replace it with more specifics on how we decoupled WebGUI from modperl (replacing it with Plack) as an example of how others might convert their own legacy modperl applications.

Many thanks to JT and everyone else at PlainBlack for organising yet another awesome Perl / WebGUI conference, you guys rock.

It’s official: WebGUI 8 will be Plack-powered

Back in December 2009 I wrote about PlebGUI, an experimental branch of WebGUI with mod_perl replaced with Plack/PSGI. As a result, I was able to demonstrate WebGUI running on shared hosting via Plack + FastCGI.

For the next few months I worked through the process of turning the proof of concept into something core-worthy. Primarily that meant removing PlebGUI’s faked Apache2::Request object, completely eliminating any mod_perl dependencies from the WebGUI core and instead baking in WebGUI::Request and WebGUI::Response which are thin layers over Plack::Request and Plack::Response.

By about April most of the basic pieces were in place, performance was looking good, and I’d started the fun task of refactoring WebGUI to take advantage of the value-add features that Plack brings such as Middleware and stealing liberally from other Plack projects such as Tatsumaki‘s streaming API. But there was still lots of work to be done getting the test suite passing again and smoothing off the rough edges. Progress was slow due to my work commitments and frequent travel.

Then three of the main WebGUI committers got involved, first haarg++, then perlDreamer++ and preaction++. The pace accelerated dramatically. This week we officially merged the PSGI branch into the main development branch, meaning that the next major release of WebGUI will officially be a PSGI app!

Huge credit and thanks to haarg, perlDreamer and preaction (and anyone else who contributed too) for getting us over the hump. These guys are also the main driving force behind the other awesome features that are being baked into WebGUI 8, so if you like anything you see in the next version, make sure you buy them a beer or two.

Here are some screenshots of WebGUI with the Plack::Middleware::Debug bar turned on.

Previously, in debug mode WebGUI would append all debug output to the bottom of the page. Now, thanks to haarg’s custom Plack::Middleware::Debug panels, debug messages are contained within the “Logger” panel. Notice also the “Asset Performance” panel, which displays WebGUI::Asset performance metrics. This is only the beginning.

It’s such a buzz to have the PSGI branch merged in; now the real fun starts! I’ll be speaking about the WebGUI PSGI branch at the WebGUI User Conference in Madison in September, and at the rate things are going, who knows how much fun stuff we’ll be able to show off..

I’m also really looking forward to attending YAPC::NA next week (my first YAPC on American soil) and meeting/hanging out with lots other people who have been doing awesome things in the Perl web app space (and beyond). Vive la renaissance Perl!

Plack Apps in Javascript

Love Plack web apps but feel like writing some Javascript today instead of Perl?

# app.psgi
use Plack::App::JSP;
Plack::App::JSP->new( js => q{
[ 200, [ 'Content-type', 'text/html' ], [ 'Hello, World!' ] ] 

# displays: Hello, World!

Given the similarities between Perl and JSON you can’t actually tell if I’m cheating or not from the above snippet.

Let’s try something more convincing:

Plack::App::JSP->new( js => q{
function respond(body) {
    return [ 200, [ 'Content-type', 'text/html' ], [ body ] ]

respond("Five factorial is " +
    (function(x) {
      if ( x<2 ) return 1;
      return x * arguments.callee(x - 1);

# displays: Five factorial is 120

I just pushed Plack::App::JSP to the CPAN.
Thanks to Salvador Ortiz and Miguel Ibarra whose recently released JSP module makes this possible.