Perl 6, Surely but Slowly

Last month I wrote a post about Rakudo being ready for release. I ported a substantial framework from Perl 5 to Perl 6, and it just works. Surely, but sloooooowly!

I'd like to make the case that Rakudo is now ready for something else... A serious performance boost!

Last night I timed the basically equivalent TestML test suites in Perl 5 and Perl 6 (Rakudo). Here's the results: http://gist.github.com/525796.

Perl 5 took just over a second. Rakudo snuck in just under 2...

Minutes!

Let's add Git userdiff defaults for Perl and Perl 6

Git allows you to define a custom hunk-header which'll be used by git diff as the context line in diff hunks. Git includes presets for several languages but no presets for Perl and Perl 6. I'd like to change that.

If you have no idea what these are, consider a file that contains this code:

Begin at the BEGIN and go on till you come to the END: then stop.

In Perl we can run user defined code blocks at different stages when running a program.

  1. BEGIN blocks are run as soon as Perl finds them. If there is more than one block they get executed in the order they are found.
  2. CHECK blocks are run as soon as Perl finishes compiling. If there is more than one CHECK block they get executed in the reverse order they are found.
  3. INIT blocks are executed after CHECK blocks, and if more than one exists they get executed in the order they appear.
  4. END blocks get executed before the program finishs running, and no errors where found. If more than one END block is found they are executed in the reverse order they appear.

Temp Directory "Bug"

So I wanted to install Dist::Zilla and give it try so I fired up the cpan client. A few of the tests failed in a dependency, Config::INI: http://www.nntp.perl.org/group/perl.cpan.testers/2010/08/msg7663252.html.

When I saw the failure, I traced it back to File::Temp::tempfile. I filled a bug report (https://rt.cpan.org/Ticket/Display.html?id=60340). Tim Jenness was quick to follow up on the bug and suggest that I try testing File::Spec::Win32 to see what it said with -T. (You'll see the results in the bug report previously mentioned.)

File::Spec::Win32 tries to use some weird paths that typically don't exist on Windows systems. Yes, C:\TEMP may or may not depending on number of variables such as version of Windows, what other software has been installed, etc.

Which XML module should I use?, on O'Reilly Answers

O'Reilly Answers has an interesting, new poll feature. I've asked Which Perl XML module should I use?.

The Perl activity on O'Reilly Answers has been a bit low, but with a little work, we can get it back up there along with the other topics on the front page.

And, unlike other sites, you can actually redeem the points you earn on O'Reilly Answers for valuable things like books and conference passes. Perl monger group leaders, speakers at O'Reilly events, and people in the book review blog program get starter points just for signing up.

What I would change about POE::Test::Helpers

Since plunging into the event-based programming world POE offers, I've been infatuated with combining the tests I've learned to write (Perl Testing Handbook FTW!), which proved to be a pesky task.

Writing tests was fun, writing POE was a bit difficult for me at first and combining them seemed close to impossible.

I started off by using MooseX::POE by (++Chris Prather) and it helped me instantaneously understand and write event-based code. However, with time I learned to separate Moose and POE (while still working with both at the same time) and have more control over the matter. Still, testing my event-based code looked like a far goal. It bugged me.

I set out to write a testing framework for this which dngor named POE::Test::Helpers. It used the power of Moose to provide your MooseX::POE-based event code with the ability to write rather complex tests in an almost-declarative manner.

Running Parley with fastcgi

Today I hope to show you how to run Parley under fastcgi.

If all goes well I’ll have a publically visible message board by the end of the post.

I’m assuming you’ve already installed Parley.

For this entry you’ll need to have acess to a user with sudo superpowers.

Create a new site

First we’ll add a new site to the apache configuration:

sudo vim /etc/apache2/sites-available/parley.named_vhost

and add the following:

Adventures with Dist::Zilla - 1

I don't have the huge range of CPAN modules that some people are herding, so it may be thought that I don't need the substantial set of automation that others require to keep their interactions with PAUSE/CPAN under control.

However since I have to interact with PAUSE fairly rarely, as well as do the "pull everything together into a coherence CPAN release" dance infrequently, automating the whole process so I have fewer changes to get it wrong seems appealing.

I initially looked at Dist::Zilla a while back, but was having trouble getting my head round it properly. Although splitting the whole thing down into small plugins is great as a way of handling features, it can create problems when wanting to find out how to do things, or even finding out best practices, just because you have to locate the right plugin or plugin bundle from the huge selection. This isn't helped by the documentation - which appears to require some knowledge which I appear to be missing.

"Pretty" SQL output on test failure

Quite often when running tests, you do something like this:

use Test::Most;

# do stuff

eq_or_diff $have, $want, '... and we gots whats we needs'
    or show $sql, $arguments;

Except that this likely will give you something like this:

# $sql = 'SELECT `format`.`id`, `format`.`title`, `format`.`title_cy`, `format`.`title_gd` FROM `format_container` `me` LEFT OUTER JOIN `format` `format` ON ( `format`.`id` = `me`.`format_id` ) WHERE ( `me`.`container_id` = ? )';
# $arguments = '\'c_series\'';

... and that's a simple one. I didn't like that, so I fixed it.

ActiveState updates Perl Dev Kit

Perl 5.12 is alive and well. While Perl 6 is still on the horizon, ActiveState is using the in-between time to update its Perl Dev Kit (PDK) to version 9. Released on July 14, this new edition adds support for Perl 5.12, the most recent update to the language.

PDK 9 also supports HP-UX and 64-bit PerlNET (ActiveState's Perl component builder for the .NET Framework) for the first time.

Jeff Hobbs, director of engineering at ActiveState, said these new additions to PDK spread the appeal of Perl across all platforms. "In the latest PDK, we have updated the tools for full support of the new Perl 5.12 release," he said.

YAPC::Europe 2010 - Thoughts Pt 1/3 - Young Blood & The Old Guard

Last week I was in Pisa for YAPC::Europe 2010. Although I was doing a talk about CPAN Testers, my intention was to keep a low profile and observe more. Having run the conference surveys for the past few years, it has been noticeable that the attendance has been changing. While there are new people coming along to YAPCs, the general average age is getting older. Marketing Perl to companies to encourage its use is one thing, but attracting people in general to the language is also important. The fact that for a notable number of attendees this is their first YAPC, probably means we are getting something right.

Erlangen.pm at YAPC::EU 2010 in Pisa

This year six of our fellow mongers managed to attend to the YAPC::EU in Pisa, constituting the 6th-largest perl mongers delegation at the conference. Every one of us also managed to get a room in the conference hotel, so it was a very comfortable event for us all.

While the authors can't speak for all Erlangen.pm members, it seemed to be a very good conference, with lots of interesting talks, nice social events and a good many meetings in real life.

Some of the talks that kept in mind were the one by Tim Bounce about his Devel::NYTProf and the one about CPANTesters by Barbie. The latter one showes the importance of Kwalitii to the Perl community and an ambisious project to enable quality assurance in CPAN, which is said to have lots of crap in it. Jonathan Worthington impressed with a talk about Perl 6 signatures, which others praised too.

Slides from YAPC::EU 2010 - When Perl Met Android

At YAPC::EU 2010, amongst all the talks I've attended and people I've met, I also gave a talk myself.

The talk was titled "When Perl Met Android" and discussed the Android operating system for mobile devices and the SL4A project and how to use it to run Perl on your phone.

You can find the slides right here. Hopefully I'll be able to cut the screencast to parts and upload to youtube or presentingperl.org - or both. Once that happens, I'll post links here as well.

The ideas to give the talk at YAPC::EU 2010 (which was also my first YAPC ever) and to participate in the SL4A project itself - promoting Perl - were both conceived by Gabor Szabo, to whom I owe quite a lot.

This is a good chance to say "thank you". Gabor has supported me with talks in multiple PM groups. He was the one who got me interested in SL4A (when it was originally called ASE) and pushed me to go to YAPC::EU and even give a talk there. He also supported me throughout YAPC::EU, which was quite intimidating for me at first.

My hat's off to him.

Thank you.

The 2010 White Camel Awards

This year, on behalf of Perl mongers and O'Reilly Media, I present the White Camel Awards at YAPC::EU in Pisa.

The White Camel Awards recognize significant, but non-technical, achievement in the Perl community, traditionally in three areas: Perl advocacy, Perl user groups, and Perl community. Non-technical work tends not only to be thankless jobs which nobody praises in public. However, these people keep doing the work despite the possibility or reward or recognition. Curiously, the awards tend to go to people who don't think that they deserve them. Sometimes we have to force the award on people, which makes them the ideal candidates for them.

But that's okay, because we're not completely here to reward the person. Giving the White Camel Award gives us a chance to show the world that there are things that we value in the Perl community. This year's recipients, as well as their projects, have been deserving of this sort of recognition for a long time.

Perl User Groups: José Castro (cog)

4 days at Eth0 Summer 2010

Currently I'm located at the Dutch Eth0 Summer 2010 event, which is a camp-with-tents-and-attend-talks-and-workshops event. My younger brother who studies IT went with a bunch of classmates, and I decided to tag along.

So far it has been fun - I've done some Perl evangelising and handed out Round Tuits to random people (thanks for those Tuits, Wendy).

The overall view of Perl is the same ol' "Perl is line noise and the language hasn't seen changes in 10 years lol". While a rebuttal is easy, it's somewhat disheartening but not unexpected.

Other than that, not a bad tech festival.

YAPC::EU::2010

I'm back from YAPC::EU::2010 in Pisa, Italy.

My 13th YAPC.

And it's still awesome.

I mostly enjoyed the lightning talks, as usual. They're funny and they're usually the bit of the conference during which I'm not busy writing slides.

Can't wait for the next one, in Riga, Lithu^WLatvia.

In the meantime, I decided to write on blogs.perl.org for a bit.

First post...!

I was never much of a prolific blogger - and since I was out of action nearly a year back for an extended period, I have not managed to resume at all...

So I'm aiming to do a little perl blogging here, as opposed to on my other (mostly abandoned) blog. Hopefully this should manage to keep going for a while.

Can't choose CPAN namespace

So... I've got this set of modules I've been going to opensource for more than a year now. Strangely, main obstacle is a choice of namespace.

Internally, they are called Stream::*. It is multi-layered set of classes with common interfaces, from low-level Stream::File / Stream::Log / Stream::MemoryStorage, to more complex Stream::Queue (local file-based queue supporting multiple parallel clients). Also, there are functional-style filters, catalog which can construct stream objects by their name, pumpers connecting input and output streams, multiplexing, and a lot of abstractions, base classes and roles...
Together, they assist in implementing complex asyncrohous, realtime and possibly distributed data processing.
By now, i think the paradigm I'm trying to implement is called a Flow-based programming, but until recently, I've mostly been thinking in terms of this image:
flow.png
Anyway. I'll have a chance to talk about it later when this code will become public.

Any hints about namespace?
I don't like Stream::* that much, and there is a Stream-Reader in that namespace already.

Syntax highlighting comment keywords in TextMate (TODO, FIXME, etc)

mst's State of the Velociraptor talk at YAPC::EU inspired me to start a blog here, although this first post has nothing to do with Perl...

After reading Chisel's post on highlighting useful words like TODO in Vim, I decided to see if TextMate could do the same. After a bit of trial-and-error and a brief glance at the documentation, the following worked for me:

HTTP::BrowserDetect for all of your UserAgent parsing needs

This module dates back to 1999, but as of late 2009 it had only been patched twice over a 5 year period. The RT queue was full of very good (but unapplied) patches. The world of browsers had also changed considerably over this 10 year period, making the module helpful but missing a lot of coverage. Since I didn't feel like rewriting this module,I took the time to contact the author about seeing if he'd allow me to apply the patches. I'm happy to say that he was very responsive. He added me as a co-maintainer immediately and I set about working through the queue.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.