I've just published the first full version of my review of CPAN modules for converting markdown to HTML. There's still work in progress, particularly comparing the output generated by the different modules, but it's fairly complete now.
One question I often hear is “Why should I chose Mojolicious versus one of the other major Perl web frameworks?”
While I have many answers to that question, I personally believe the most important difference is that Mojolicious is designed to be non-blocking.
Many of you will have heard of Node.js.
The reason that Node is popular is that it is designed to be non-blocking.
By writing your webapp in a non-blocking style using a non-blocking framework, you can often build a faster and smarter application, requiring fewer servers to handle the same amount of traffic.
Although Perl has several web frameworks, only one was written with non-blocking design in mind: Mojolicious.
To demonstrate a non-blocking application, I am going to write a simple pastebin using Mojolcious and Mango, a non-blocking MongoDB library (from the same developers as Mojo).
A while back I forked Term::ReadLine::Perl making Term::ReadLine::Perl5 because of the former maintainer's lack of responsiveness regrading my patch to add GNU Readline history and general lack of responsiveness overall.
Term::ReadLine::Perl purports to be a "pure Perl" version of GNU ReadLine. It can use, but does not require, Term::ReadKey. With this issue it seems that more hacking is needed when Term::ReadKey is not available.
Right now Term::ReadKey is recommended. But putting a dependency on Term::ReadKey would simplify the code, and that is much needed. That makes this less code less "pure" Perl.
Looking at the CPAN Testers reports, seems to be pretty much available on different OS's and is somewhat actively maintained.
Any thoughts on turning a "recommends" into a "requires" for Term::ReadLine::Perl5?
This post describes my current practice. Input/suggestions are most welcome to improve the process.
I am presently maintaining about 300 Perl distributions, 90% of which are CPAN distributions. As mentioned on a previous blog post, I am now developing some non-CPAN Perl software projects à la CPAN, by grouping software components as Perl distribution and releasing them like CPAN distributions, although not necessarily to CPAN. That number is expected to shoot up to at least 350-400 in 6-12 months, as more code is converted into Perl distributions. So without some helper scripts and automation, one can quickly go insane.
Etherpad is a really great collaborative editor. Written in Javascript for NodeJS, it offers a HTTP API which allows to do a lot of things.
Despite a lot of other languages API libraries, Perl had no API module for a long time.
This is not an issue anymore since I wrote the Etherpad::API. Now we can use the etherpad API for our greater pleasure.
An use of this module is Etherpad::Admin, a Mojolicious-based web site which displays informations about pads and permits basic operations on them.
For the console lovers (myself included), padconsole is what you need to manage multiple etherpad instances from your terminal ! It's on its early stage, so all functions from the API are not usable right now, but as they say: "Release early, release often".
How does it translate into Marpa grammar ? The first question always have to be: am I talking about a terminal or a non-terminal ? Here obviously the answer is: a terminal. So for Marpa this will be a lexeme. With Marpa a lexeme is the "bridge" between high-level rules (the usual "grammar") and low-level rules (how are defined the terminals).
Over the past couple of years, my practice of developing and releasing software as Perl/CPAN distributions has spread to my other non-CPAN projects. Software are now being composed as collections of Perl distributions, although they are not released to CPAN (but some components are). I am embracing this practice because:
1) It encourages modularity, a desired property in software. Perl modules are logical groupings of code, and Perl distributions are units of deployment/release.
Some days ago I discovered that my CPAN distributions count had already gone
above 100, only that my MetaCPAN
page has misled me due to
a bug (
which I reported since). I now have 103 distributions on CPAN and you can
find a list
of them on the Israeli Perl Mongers site, with whatever is missing from
the MetaCPAN page.
So now I'm in the CPAN 100 club, and now will also better focus on improving
the quality of my existing distributions. According to GumbyPAN, the
top ten authors are
SHARYANTO [265] RJBS [258] TOBYINK [239] ADAMK [236] ZOFFIX [222]
MIYAGAWA [216] BINGOS [197] INGY [177] TOKUHIROM [170] SMUELLER [156],
so no one has gone up to 300 distributions yet (also see
the
top 20 current in the leadercpan page.).
While I know I'm in the minority, I use the Perl debugger quite a bit. In fact, I've hacked on perl5db.pl more than I can to admit and it's a mess. However, on a day-to-day basis, I use it constantly and have it bound to ,d in my vim setup. Unfortunately, I also write a lot of Moose code and that's when I invariably hit things like this:
About this posting series: things that should perhaps personal notes, but shamelessly posted. Things that should've been tweets, but are not because they are a tad longer. Things that are useless most of the time.
* Saw a post about mod_mruby for Nginx. Apparently there is also a module to embed Lua, and another one for Perl. After we painfully learned to decouple web application server from webserver (using WSGI, Rack, PSGI), now it's mod_perl time all over again?
* We use code generation a lot these days in Perl. Dist::Zilla and Pod::Weaver (and their alternatives). Mo[ou]* modules. Type::Tiny, and my data validation framework Data::Sah, which is also code-generation-based. DBIx::Class::Schema::Loader. I'm even thinking of generating command-line scripts on the fly since mostofmyscripts nowadays are just interface to function in a module. And I look forward to the days when we generate the generators. Certainly an improvement over the boilerplate-generation days (think Module::Starter and Rails/Catalyst).
* I notice that my command-line scripts are getting longerandlonger names (compared to afewyearsago), is this a sign of old age? Or simply because I have more scripts/projects nowadays? I can manage a few or a dozen rainbarf's, but a couple of hundred?
I currently write a commercial app and found out that Wx::RadioButtons work differently under MacOS. These simply ignore the constant &Wx::wxRB_GROUP and slap together all the groups of a dialog. By toying around I found a way how to get several radio buttons (these labeled, round things from only one can be selected) in one dialog (following some style guidelines I guess), just put them on separate Wx::Panel. Than I remembered that Wx::Perl::RadioGroup does this anyway, and using them you also don't have to know about &Wx::wxRB_GROUP. It just works like the mackenzies claim. It will see the light of CPAN as soon I learn to handle dzil.
Videos in any language can be now posted and they will be listed separately in every listing: For example Sawyer X has an English and a Hebrew version of the Asynchronous programming FTW! posted.
There was some improvement in the layout as well. The default Dancer2 template and CSS is slowly replaced by a more responsive web design. (Try resizing the browser.)
Acme-oop-ism is about writing code that works in Moose, Mouse and Moo.
Type::Tiny was born of frustration with how MooX::Types::MooseLike handles "inflation". Inflation is how Moo handles interacting with Moose. I'm simplifying here, but when Moo detects that Moose is being used, it builds a Moose::Meta::Class for each Moo class you've defined, and a Moose::Meta::Role for each role.
1. App::FTPThis since, well, there is App::HTTPThis. Or perhaps App::DropBoxThis, for the modern-cloud-oriented people.
2. App::popstatus, App::imapstatus. Inspired by TOKUHIROM's App::httpstatus, I wrote App::smtpstatus a few months ago. Useful sometimes when debugging SMTP problems or hacking on my SMTPD software. An equivalent for IMAP and POP could be nifty sometimes. Some IMAP daemons have their specific codes/messages and it would be nice to incorporate them (and do the same for my App::smtpstatus as well). On a rather unrelated note, I released App::osnames some time ago too.
3. A module that can list ATM locations for some Indonesian banks. Some banks like BCA offer their database of ATM locations on their website. I don't know where or when this would be useful though. Are there any banks outside of Indonesia which offer this data?
When developing a Perl module, I often want to get a quick preview of the documentation that I'm writing, just to see if everything is in order and how it turns out. I used to do this the old fashioned way, by generating an HTML file with pod2html or pod2cpanhtml and opening it in a browser, but I was hoping in this day and age there is an easier and better solution, preferably a web application.
Looking around, however, the only thing I could find was the pod2html page at the CPAN Search site, which allows you to upload a POD file, have it processed by pod2html, and displayed with CPAN style. I thought it might be a good idea to try building something more user-friendly, with features like editing POD in the browser, drag and drop file uploads, etc.
And what better time for a little project like this than a weekend when you're ill and not supposed to leave your apartment? Well, that's what my last weekend was like -- two days of coughing and coding, and here's the result: POD Web View.
Marpa is a great, really great, piece of software that deserve to be used by everybody wanting to do serious (let's say frankly: professional) and innovative parsing. I feel that Perl language is very lucky to to have been choosen by its author, Jeffrey Kegler, as the main frontend. But seriously, this is the only module that is a true BNF parser. All others modules on CPAN that contain the BNF keyword are not. Marpa brings innovative and on-the-edge ways of thinking, writen by a person clearly brilliant in both progamming and language theory, and very responsive on the marpa-parser google group.
My first module using Marpa was MarpaX::Languages::C::AST, and I should have blogued about it at that time. Instead Jeffrey did it, time for me to start blogging too on Marpa!
Perhaps some of you might find it of use: I just wrote (and am running) a script to download-all-blogs.perl.org-posts-of-a-user. It's not as fast as I would like it to be because apparently wget does not accept mixing -k with -nc.
I also noticed that github does not syntax-highlight the script as Perl code. Probably because I use "#!/usr/bin/env perl" instead of "#!/usr/bin/perl".