I actually don't believe there isn't something like this in CPAN yet. Well, actually there is PHP::Var, but it has bugs, doesn't handle scalars, and doesn't do recursive structure. But then I am equally surprised to be able to hack Data::Dump::PHP in just a couple of hours, by blatantly copying from Gisle Aas' Data::Dump and just modifying only what's necessary.
And another note, PHP's var_export() currently can't dump recursive structures, which Data::Dump::PHP can.
I had been looking around for the ancient Perl sources to add to my collection, but Schwern told me that they are already in the Perl git repository. I just have to checkout the correct tag:
Last day of the hackathon and things are going well. We're doing enough yak-shaving that I think it should be called a Yakathon, but that's a separate issue.
Module versions can be found using several ways. I know two.
You can use the module in a one liner and print the module's $VERSION variable:
perl -MSVG -le'print $SVG::VERSION'
This gets annoying when the module name gets long:
perl -MWWW::Mechanize -le'print $WWW::Mechanize::VERSION'
Or the insane:
perl -MPOE::Component::WWW::Pastebin::Bot::Pastebot::Create -le'print $POE::Component::WWW::Pastebin::Bot::Pastebot::Create::VERSION'
Another method I've seen people use is to actually cause an error. Try to load the module in a high version that doesn't exist. The error will show what version it is:
perl -MWWW::Mechanize\ 9999
perl -MPOE::Component::WWW::PasteBin::Bot::Pastebot::Create\ 9999
This is pretty good, since it's short to write and most likely you won't find many versions above 9999 (except perhaps, File::Slurp - last version 9999.13). However, this is a bit confusing to newbies, trying to cause an error on purpose to simply find the version.
Moreover, since it causes a compilation error, you can't easily check multiple versions.
For various reasons I was only able to attend a few hours in the moring, and all of that time was spent organising stuff (even though most of the organising is done by daxim and pst). At least I took some photos:
In the evening I joined the rest of the attendees again at Der Wiener Deewan for delicious pakistani food, sponsored by 123people.
The '-t' option says "track the remote branch from my branch". The '-b' option says to actually create the branch with the given name (name will be derived from $remote_branch_name if omitted).
It's so simple that I don't know why I forget this, but I do. Now that I've posted this, I probably won't forget it again :)
For the syntax and semantics of Prolog, Parrotlog is based on a draft of the ISO/IEC Prolog standard (seeing how the actual standard costs muchos dineros).
Now, the good news are that the Prolog spec is actually an operator precedence grammar, which happens to be how NQP does its expression parsing as well. The bad news are that the spec uses term for everything, while NQP makes a distinction between terms (atomic expressions) and expressions (expressions, with or without operators). This means that I have to figure out if I should use term or EXPR whenever the spec says term. Let's see how deep the rabbit hole is.
As you might expect it's crafted using the finest ingredients of Modern Perl: Catalyst, DBIx::Class, Moose, HTML::FormHandler, KinoSearch. Relaunching the site was a nice project, even though there were some setbacks:
I was forced to switch from Postgres to MySQL (using - the horrors - MyISAM), so I couldn't use any real database features like transactions and referential integrity; the launch date was postponed a few times, so I couldn't help organising the QA Hackathon as much as I wanted (in fact I can also not attend all days, because I want to spend some time with my family before leaving for Berlin / Icleand).
Anyway, after fixing some last post-deployment glitches everything seems to work now. Yay!
March has been a very busy time. Although we weren't able to meet the 1st March deadline, the switch to the HTTP submission process has started. Currently it's still considered Beta, but initial problems appear to have been worked out, and the Metabase is receiving reports thick and fast. So much so that some testers started to ramp up their smoker bots again, forgetting that some were still submitting SMTP reports. You can read David Golden's report of his beta test update.
I'm about to leave for Vienna for the 2010 Perl QA Workshop, so now it's time to start thinking about my secret project. I've saved it especially for something to do on the plane.
A couple months ago, David Golden and I got together to talk about what a new CPAN.pm client would look like. Now, remember that both of us have our noses deep in the CPAN.pm source, and both of us have thought, on several occasions, that we should refactor CPAN.pm. Gabor, who is also going to be in Vienna, even went so far as to separate each package into its own file back in October 2008.
A few folks have talked about adding tags to Test::Class. This would allow us to do things like load 'customer' fixtures if something is tagged 'customer', or only run tests tagged 'model'.
The following is a brief summary of my Perl introduction/promotion
talk at BarCamp Kerala 8, held in March
28th, 2010 at Tiruvalla, Kerala, India.
It was my first BarCamp, and the first other conference/camp that I
ever attended apart from last year's YAPC::EU::2009 (which was a great
experience, by the way!). I was very interested in having Perl
promoted among a community that uses/promotes other programming
languages. So, I thought of giving a talk and selected the title 'Y
Perl?'. The talk concentrated on why Perl should be considered when
there are myriad programming languages. Highlights were on the latest
buzzwords in Perl, namely Catalyst, Moose and Padre, the community
efforts such as Send-a-Newbie, Perl Monks and Perl Mongers.
Blog posts, pictures and tweets have been made on the session. You can
find some at: http://bit.ly/brt0KV.
And, most of all, some people met me, expressing their interest in
learning the Perl language. I am glad that I was able to encourage
them to start taking up Perl. :-)
I am also intending to attend other camps/conferences (near and far),
with the same motto of introducing/promoting Perl.
Most aspects of the first round between Dancer and Mojo are covered in Alexis' post - a recommended read. However - with your approval, or not - I'd like to add another side of it, our overall developer understanding of the contest.
While it seems fun to "win" something, what we the developers (and I'm assuming it's pretty much the same for the Mojo people) liked most about the competition was that we'd get a complete understanding of the end-user learning experience.
Here are a few things we understood (and most corrected by now):
This is actually, in my opinion, an interesting phenomenon in languages: you risk hitting some kind of local maximum when your language is popular enough to have a lot of users who will be angry if things are changed or accidentally broken in the course of big upheavals. So you have to slow down, go carefully, and not rock the boat too much. On the other hand, there is an opportunity cost in that newer languages with less to lose can race ahead of you, adding all kinds of cool and handy new things, or simply fix and remove “broken” features.
Oh brother.
And this bit as well:
The syntax, for your average programmer who doesn’t want to go too far out of their comfort zone, is perhaps a little bit further afield from the C family of languages than they would prefer. Still though, a “human” problem, rather than a technical one. Perhaps, sadly, the message is that you’d better not “scare” people when introducing a new language, by showing people something that [looks] at least a little bit familiar.
Backtracking is probably the defining feature of Prolog. Abstractly, the execution of a Prolog program can be seen as traversing a tree, looking for a path that fits certain criteria. Each node represents a choice between several options, and are usually referred to as choice points (for reasons that should be obvious). If at any time the path taken is found to be inconsistent with the constraints, execution goes back to the previous choice point and tries the next option. The search is depth-first, left-to-right.
Now, as I've mentioned before, in Parrotlog this is implemented using continuations, based on example code from Graham's On Lisp book (chapter 22). Simply put, continuations allow you to restore the execution of your program to a previous state. For the C programmers, this is simillar to setjmp(3) and longjmp(3), but returning from the originating function doesn't invalidate the saved state. On Lisp chapter 20 has more about continuations, and so do the Parrot docs.