views:

233

answers:

4

Recently, I've chatted with a fellow Perl Monger about my and his job. He has a lot of Perl background, but works in a team that creates and maintains many low-scale projects for the customers, mostly based on .NET and Java. His opinion is currently that Perl has mostly lost the web game, since it's still lacking widget toolkits, which are readily available in Java (e.g. JSF) and .NET (ASP.NET).

My first thought was that his point was mostly valid, since I generally like the idea of a client-side widget with encapsulated AJAX interface and properly integrated server counterpart (even though I can think of several disadvantages of this approach, like having to live with API endpoints provided by widget).

I've looked around and found few solutions that seem similar to JSF and ASP.NET:

Another alternative could be a RESTful server with a proper client implemented in Javascript (IIRC, Google Reader was implemented this way). Since Perl is probably a more powerful language than both Java and C#, maybe widget frameworks are not really necessary and we should concentrate on jQuery UI, Dojo, Closure and several dozens of other Javascript-only UI frameworks and maybe spend some time thinking about some common server-side API for them.

But anyway: I don't feel confident talking web widgets, but I think this question will come up pretty frequently talking with "enterprise" people. So how do I advocate for Perl properly when asked about web widgets?

+6  A: 

With the possible exception of Google's GWT for Java, opaque server-side frameworks that spits out pre-wrapped html + javascript is not really that popular. This is a side-effect of the change in perception of the web development community towards javascript. As more people become comfortable with javascript and see it as a proper language rather than a toy, and as javascript UI libraries get more mature, the less people feel they need to be protected from all-that-ugly-HTML-and-javascript.

These days very few web developers consider HTML ugly thanks to CSS allowing structure to be separated from presentation. And javascript is finally getting appreciated by the developer community at large. Nowdays people even talk about using it as a desktop or server-side development language. People actually WANT and PREFER to use javascript.

slebetman
A: 

Interesting, I would have expected there to be plenty but as you say it seems to be very quiet on that front. The Catalyst/Reaction combination looks most useful and best supported, but I would want to experiment with it in depth before making any promises based on that.

Perl has certainly rested on it's laurels and I'm not surprised that Ruby and Python based frameworks have eaten up much of it's mindshare, but it is flexible enough to be ideal for this type of job. It might end up being a case of working with what is available and contributing a bit more to the projects you're working with so that they are reliable and practically useful...

glenatron
The newest catalyst book has a whole chapter devoted to reaction.
J.J.
@glenatron: What widget frameworks are available for Ruby or Python? I only know of Pyjamas (http://pyjs.org/) which looks an excellent GWT "clone".
draegtun
For Ruby you can just use Rails - which offers a lot mroe than ASP.Net does right off the bat - and there's a plug-in for pretty much every scenario. I'm not so familliar with python, but there are some powerful open-source CMS that could quite be just picked up and customised to most uses and given the popularity of the language you would probably be able to find many good ones by asking any Pythonista.
glenatron
draegtun
Well, the OP talks a lot about Asp.Net as a widget toolkit, which is something I've used a lot down the years and Rails does offer pretty much offer the same functionality wrapped slightly differently. Maybe I've got too good at abstracting away what is in front of me though- perhaps this is more a question about something that can easily be edited with a drag and drop UI...
glenatron
A: 

I should note that there are many other web frameworks in Perl which I've blogged about on a blog post.. I'm not familiar with the the term "web widget frameworks" and I should note that there are higher-level frameworks above JSP.

Shlomi Fish
My interpretation of "web widget frameworks" is things like "a collapsible tree view" or "two boxes with a draggable divider separating them" that can be dropped into web pages. Basically the web equivalent of GUI widget toolkits. So a completely different kind of thing than Catalyst/CGI::App/etc.
Dave Sherohman
+5  A: 

The best thing to do for advocacy is to not make the situation seem like something that it isn't or push people to Perl merely because you like the language for everything else it can do.

Frameworks exist to give you a conceptual perspective on the design and implementation of your application. I divide the framework market into three major segments, and you have to figure out which segment you want to talk about:

  • Those who want as-close-to-turnkey web applications as they can get with as little work as possible.

  • Those who want lots of knobs and dials to customize just about anything they can imagine.

  • There's also a hybrid market segment in the middle where people want some flexibility, but not so much that they have to design too much on their own.

Perl does very well for the people who want to heavily customize everything. Something like CGI::Prototype is very nice for this because it doesn't care about how or what you do as long as you can figure out what you want to do next (e.g. stay on this page because there is an error, complete the purchase, return the search results, whatever). CGI::Prototype doesn't even care if you are using HTTP or HTML. I know that Randal Schwartz easily adapted it as an XML server using XPath.

Catalyst is for the hybrid market. It makes most of the design decisions for you, but you can still plug in some major components and customize some of the stuff. Most people probably don't care about most knobs and dials, and most web applications out there are probably topologically similar and fit into a Catalyst mindset. Most of the people who think that they have odd requirements can probably use Catalyst.

That first market segment, the almost-turnkey one, is the one you're thinking about. They want pre-defined widgets for calendars, geo-controls, syndicators, and so on. For those people, life is tough in almost every language because they have to completely accept all the decisions that someone else made without even knowing their problem. The Perl community certainly sucks at making decisions for you, but that's also one of the reasons Perl is successful. I like pre-defined widgets, but I've never really liked the sets of pre-defined widgets. I like this calendar control in this set, but this map control from this other set. Usually, the people in this segment quickly find out they want to be in the middle segment.

Although I'm mostly in the Perl world, if I had to get back into large-scale web applications, I'd use Seaside, a Smalltalk framework. I remember one night in Florida Randal and I were sitting at a bar and he was telling me about Seaside and I was throwing every objection I could think of at him, and he easily answered every one one of them. All of his answers led back to the initial design of Seaside, too, so they weren't hacks or add-ons or could-bes. I describe Seaside as the web framework we'd get if Dr. Who went back to 1994 and fixed every stupid thing we ever thought about web applications and gave us a completely different yet smart evolutionary path. There's too many advantages to list here, and Randal is more than willing to talk your ear off about anything Smalltalk. For an example of what you can do, check out DabbleDB.

brian d foy