Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Mojolicious Web Framework in Perl (mojolicious.org)
40 points by fogus on Sept 20, 2010 | hide | past | favorite | 23 comments


I was going to start learning and using Catalyst soon. Why should I learn Mojolicious instead? Why shouldn't I?


Catalyst == larger community + more documentation + lots of useful modules out there. The downside is that it takes a heck of a lot of effort to get up to speed and I personally find that it can get in the way a little for smaller projects.

Frameworks like Mojolicious, Jifty (http://jifty.org/) and Dancer (http://perldancer.org) are much quicker to get up to speed on, but suffer slightly from having a smaller community of users and developers.

I've been playing with non-Catalyst frameworks a bit recently as I've been pondering a little bit of product development on an in-house project.

Of the non-Catalyst Perl web frameworks Dancer is my favourite http://perldancer.org/. For my money it's a neater package than Mojolicious, which takes the no-dependency thing a little bit too far for me. Dancer's non-OO DSL declarative style seems to work quite well (it's very heavily inspired by Ruby's Sinatra).

I'm going to give Dancer / Plack a whirl as the basis for a non-trivial app soon. I think it'll work quite well from my experiences so far.

(BTW - if you've not started playing with Plack in Perl - do so. Veeeeery nice.)

As to what you should learn - who knows :-) If it were me I'd spend at least a few hours playing with Dancer/Mojolicious/Jifty first - since any of them will have you up and running with a demo in a few minutes. Catalyst will take more work.


Another vote for Dancer from me. You can start with a tiny one-file script and then slowly use sessions, templates, Plack middleware etc. as you need it. It's very elegant.


There is nothing Dancer does that Mojolicious can't do better, and then some.


What about documentation? A few months ago, I was interested in Mojolicious, but it seemed to me, that the docs were hidden and incomplete, I completely lost my interest for that reason alone.


They have improved significantly and are still improving, just take a look at the included Mojolicious::Lite tutorial and the Mojolicious::Guides.


TIMTOWTDI (for the non perl guys, there is more than one way to do it - the motto of Perl)

Mojolicious is very cool, has strong leadership, direction, and is very opinionated.

I prefer Dancer, and believe it fills a slightly different niche - but the competition between both can only be a good thing.


I didn't mean to attack Mojolicious at all. I've never played with it, but it seems very cool. I have used Dancer, and liked it very much, that's all I wanted to say.

It's great that you promote your framework, but it doesn't mean that similar frameworks can't be good.


They are not even playing in the same league.


You keep hinting at Dancer's inferiority without giving any examples.

When I said Dancer is "similar" I was only thinking of Mojolicious::Lite. Feature-wise Dancer and Mojolicious are obviously not in the same league, and are not meant to be. People who just needed a small and easy solution were happy enough with Dancer.

Maybe nowadays Mojolicious::Lite should be their go-to solution - but you're not gonna convince anyone that way.

Also, completely replacing your comment without indicating it with an [edit] or similar isn't very nice.

I admire your work in the Perl web space, and have been following it via Planet Perl. There's no need to defend it with snarky one-liners.


I've given very specific examples before, the result was a flame war, i have no interest in that.

Now i would rather stay on topic and talk about more exciting things like Mojolicious.


May I underline that the flamewar you're referring to was totally intended by yourself? Your (public) IRC logs prove it by themselves (you even called that a "marketing" campaign). So it's a bit funny when you say afterwards "i have no interest in that".

For the "design issues" in Dancer, you may not know, but the code base has hugely been rewritten since your last epic marketing actions. So what you're saying here might be very well obsolete, just for the record.

Oh and one last word, as I said before, I don't understand why you put so much hate and energy when Dancer is mentioned. What's the problem? Do you want to rule the world or what?

If Mojolicious is so good, why do you need to make so much noise?


And yet, the second i state that i have no interest in a flame war you suddenly pop up to start one, bravo.

P.S.: Every single design issue i pointed out is still present.


you're funny :) really.


I don't have extensive experience with either (just some toys and experiments really) but Mojo just feels so much cleaner. If you read the front page it talks about how it's 'fresh code' by people with experience working on Catalyst itself -- IMO it really comes across: no cruft, lean-clear docs (granted a bit sparse last time I looked), a whole bunch of 'out of the box' niceties that are all over the 'blogosphere' these days (JSON, REST, async IO, etc). I'd definitely recommending just giving them both a spin for a toy project and see how they sit with you.


On the other hand, Catalyst has a huge active community (277 people on the IRC channel right now), a ton of code for you to look at (1723 results for extensions on search.cpan, and many full apps), it uses Moose for its objects (giving you access to 100+ extensions that can cleanly fine-tune how your objects work, and a similarly huge community for support), and it integrates with pretty much any Perl web interface (FCGI, Plack, etc.) perfectly. (There are even two full books about Catalyst. But don't read the first one, I hate the author...)

I have written everything from raw PSGI apps to rolling my own web framework to hacking on other peoples' web frameworks (most recently, Tatsumaki). But every time my toy app becomes something I actually want to use in the real world, I turn to Catalyst. The backcompat is "ugly", but it's easy to do everything you'll ever need to do, and the defaults are reasonable. You can write messy code, you can write super-clean code, and everything in the middle.

What won't happen is you getting stuck with some aspect of the framework. "It does that."

Small web frameworks are appealing because when you are reading someone's blog, you think, "yeah, that's about all I ever need to do". Unfortunately, it's the "about" that's going to kill your project.

Take some time to learn the whole system and it will reward you for years to come.


Mojolicious is not just another small web framework, to me (the original author of Catalyst) it is Catalyst2, simple as that.


No offense, but what's good about Catalyst is the community.


Thats also one of the best things about Mojolicious! :)


Perhaps the simplest explanation is this: Catalyst is suitable for big, complex things. Mojolicious is better for smaller things. Just as Rails is for big things, Sinatra for smaller things. Or Django is for big things, and web.py is for smaller things.

They are two different frameworks, to serve different requirements to some extent.


You can't really compare Catalyst with Rails and Django since it has always been model layer agnostic like Sinatra and web.py.


Spend a week on Mojolicious. Poke around. Ask some questions in the IRC channel.

Then do the same with Catalyst.

The experience you have will make up your mind for you - I'd be surprised if you're not sold on Mojolicious after only a day or two.


Mojolicious is on the edge of technology with async behavior and WebSockets.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: