Domain: mojolicio.us
Stories and comments across the archive that link to mojolicio.us.
Comments · 6
-
Mojolicious: next generation framework for Perl
You might try Mojolicious. Powerful out of the box with RESTful routes, plugins, commands, Perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, first class Unicode support and much more for you to discover, amongst other things. It's very much Perl and modern.
-
Re:Yes, Perl is indeed dead and rotting
I don't, however, necessarily think it's the right choice for building a medium to large web-based application any more. Sure the performance is there, and there are some great frameworks like Catalyst and Dancer, but to me, they still feel a bit antiquated to some of the other technologies
Have you looked at Mojolicious?
From that page:
- An amazing real-time web framework, allowing you to easily grow single file Mojolicious::Lite prototypes into well structured web applications.
- Powerful out of the box with RESTful routes, plugins, commands, Perl-ish templates, content negotiation, session management, form validation, testing framework, static file server, first class Unicode support and much more for you to discover.
- Very clean, portable and Object Oriented pure-Perl API without any hidden magic and no requirements besides Perl 5.10.1 (although 5.18+ is recommended, and optional CPAN modules will be used to provide advanced functionality if they are installed).
- Full stack HTTP and WebSocket client/server implementation with IPv6, TLS, SNI, IDNA, Comet (long polling), keep-alive, connection pooling, timeout, cookie, multipart, proxy and gzip compression support.
- Built-in non-blocking I/O web server, supporting multiple event loops as well as optional preforking and hot deployment, perfect for embedding.
- Automatic CGI and PSGI detection.
- JSON and HTML/XML parser with CSS selector support.
- Fresh code based upon years of experience developing Catalyst.
-
Re:Catalyst?
Catalyst seems to be the framework everyone "ought to know" and recommends, but very few people actually seem to use it successfully for complex projects (as opposed to e.g. Mason). Its main drawback for me is that I hate reading through 1000s of lines of generated code. Frameworks should hide complexity, not autogenerate it and throw it into your face. If I were to choose something new (over plain mod_perl2), I'd look at Mojolicious::Lite or Mason 2 and I'd definetely use Plack/PSGI. The main lesson I learnt over the past 15 years (and several 100.000 loc) of web development in Perl is that while Perl gives you quick results with very little effort, some of the effort it spares you, you will miss soon after because it would have prevented ugly bugs. Also, its Unicode support is (still) terrible.
-
These days, It's Mojolicous all the way
All my web projects are now use mojolicous. It's a great platform to develop on and easy to get started. And make sure to try the websocket and events support. Very fun stuff.
-
Re:Useful for just certain applications
If I'm reading the docs correctly, the webserver part of Mojolicious is optional:
http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#DEPLOYMENT
It also supports a pretty substantial list of alternatives to its build in web server. Want to only run it as a CGI script? Then do that. Run your app as a PSGI script? Yeah, you can do that too. Started as a CGI script by now need a lot more HP? Not so hard to move what you started on something simple to something with a little more Umph.
So that's I guess, "neat"
-
Re:What about Perl 6?
"I was just going to say that back in about 2001 someone gave me advice not to learn Perl 5 because a Perl 6 release was imminent."
It's a shame that this 'Osborne effect' has hung over Perl for the last decade. I wonder how Perl 5 would now be perceived if Perl 6 had been given a different name and announced as a research project into language development, rather than the next version of Perl? With better PR, Perl 5.10 could easily have been 'Perl 6'.
All this tends to obscure the quet evolution of Perl 5 programming into what 'chromatic' and others are calling 'Modern Perl', using an idiomatic style that takes full advantage of recent language features (some borrowed from Perl 6) and CPAN to write efficient and maintainable code:
http://www.modernperlbooks.com/
http://onyxneon.com/books/modern_perl/As always, a lot of the most active development is happening outside the core language. Anyone interested in some of the directions Perl 5 is going in today ought to check out projects like these:
http://www.iinteractive.com/moose/
http://plackperl.org/
http://www.catalystframework.org/
http://mojolicio.us/