Dancer2 prototype

I am very glad and proud to announce here that I’ve came up with a prototype of dancer2 that pleases me enough to be advertised.

The source code was hosted on a private Git repo (kudos to Sawyer) but I’ve now decided to push it on GitHub.

dancer2 is a complete rewrite of Dancer aiming at providing the same awesomeness with the following major changes:

  • no more globals in the core
  • 100% object-oriented backend (based on Moo)
  • better scoping for sub-applications
  • better design (no more encapsulation violations, Law of Demeter, …)

It’s not finished yet (dancer2 supports 80% of the Dancer’s DSL) but all the core is done. It’s well tested (around 80% of code coverage at this point) and I think the last 20% wont be hard to implement (session and serializer keywords mostly).

It’s able to run simple applications (it can run the PerlDancer.org
website for instance).

Of course, with your real-life applications, chances are that it will break in many places, this is where you can help. I’d like to have as many reports as possible regarding upgrades tests.

You can test very easily your app with dancer2:

  $ git clone http://github.com/PerlDancer/Dancer2.git
  $ cd YOUR_APP
  $ perl -I../dancer2/lib bin/app.pl

Also, important to know: most of the plugins may not be working well.

Here are the next steps:

  • Finish the DSL
  • Work on plugins backward compat
  • Write a “delta” POD (also list the deprecations)
  • Write a Dancer::BackwardCompat glue module for easier upgrades

CPAN-ratings, Fake Trolls and doing marketing politics right

If you follow either the Perl Dancer community or the Sinatra one, you may be aware of what happened yesterday: some unknown individual posed as different members of the Sinatra core team on CPAN ratings in order to trash Dancer. The comments posted were rude and clearly intented to harm the project or the people involved with it.

It’s not the first time Dancer is the target of an unknown individual (who always sends his attacks anonymously), we already experienced that whenever a news was posted to HackerNews about Dancer. But this time, the attack was more aggresive, 5 different accounts were created in a row on Bitcard to downgrade the CPAN ratings average of Dancer. Furthermore they used the names of known people in the Sinatra community, in order to make it look even more harmful.

But what was the result of that? Well, it turned out to be one of our most productive and positive marketing action since we launched our advent calendar. Yes. Because our first reaction when this came to our attention was to contact the Sinatra community, in order to check out with them if they were related to that or not.

Tunred out they had clearly nothing to do with this childish attacks, and were even as offended as we were that Sinatra could be associated to such low behaviour. In the end, the result of all this is an official statement from Sinatra saying that “Sinatra loves Dancer“. It has triggered a lot of very positive noise on Twitter for both Sinatra (who clearly appears to be a very classy community) and Dancer who benefits from the huge spotlight Sinatra gave. For this, I thank very gracefully the Sinatra community and more precisely Konstantin Haase.

Back from a CPAN author point of view, I wonder if we couldn’t make the CPAN-ratings system a bit more troll-safe. It is clearly very easy to create a bunch of accounts for poisoning on purpose a distribution. On the other hand, negative ratings should remain possible, otherwise the rating system would be useless (If as a CPAN author I delete all the negative reviews of my distributions, I alter the reality). I understand it’s a tricky design issue to solve, but I think we should spend energy on it.

In our case, we had the chance to be part of a very noisy event, and that helped us to have some of the fake ratings removed, but what would have happened if your distribution had less spotlights? If you don’t have an active community to defend it? If you don’t know who to contact to have some abusing ratings moderated? Then you’re vulnerable to trolls.

Maybe the following points could enhance the ratings system (feel free to comment on them):

  • add a “Report abuse” link on the rating items, in order to be able to ask easily for moderation
  • downgrade/hide/moderate any ratings that have a very high proportion of negative votes (like 1 of 20).
  • prevent multiple accounts creation in a row: if the same IP address creates more than X accounts in the same time window, something suspicious may be happening, maybe we could block that IP for a while, like a day, …
  • Another idea is to allow CPAN authors either not to appear on the CPAN-ratings page, or to reset their ratings (all of them)

I’m sure there are lots of other options. Feel free to comment on that. Maybe we could use also some sort of “reputation score” like StackOverflow does in order to enlight the ratings by revelance.

How to Identify a Good Perl Programmer, part 2

Chromatic has published a set of questions to identify good Perl programmers. I use it now for every job interview I handle (we want to hire experienced Perl programmers here at Weborama) and am very pleased with the results so far.

I don’t expect applicants to be able to answer every single question, but with this questionaire, I have a very solid base upon which I can build the interview. Moreover, it’s quite impossible for the applicant to bluff, she can try, but she will fail.

After doing this interview a couple of times, I’ve came up with a set of new questions I like to ask, here there are:

  • How do you detect the caller’s context in a subroutine?
  • What is the difference between die and croak?
  • How do you mesure the code coverage of a test suite?
  • What’s the difference between eval $foo and eval { $foo }, bonus point if you can show off that difference with a code snippet
  • Explain what happens when the line use SomeModule; is executed. Bonus point for telling when it is executed.
  • Same question for no SomeModule;
  • What’s the difference between (1, 2, 3, 4, 5) and [1, 2, 3, 4, 5]?
  • With the following: my $code = sub { 42 } , explain what we get in $code
  • Is the following valid Perl 5 code: [foo => 42, bar => 44]? Explain the resulting data structure. Bonus point for giving another syntax for the same structure.
  • Do you know a new built-in keyword of Perl 5 added in the 5.10 version?
  • How would you match an email in a given string?
  • Do you know a way to profile a perl program?
  • Do you know how to run a perl program with the debugger?
  • How would you transform a list of integers to a list of their power by two?
  • What do I have in @list with the following: @list = ('a' .. 'e')
  • Can you explain the difference between my $foo = shift; and my ($foo) = @_ ?

Perl Bulgaria 2011 Report

This weekend I was invited to Bulgaria Perl Workshop that takes place at Sofia for giving a talk about Dancer.
First of all I’d like to thank Marian Marinov and Peter Shangov for inviting me, and also the french perl mongers who helped for making the sponsoring of my trip possible.

Bulgarian Perl Workshop

It’s the first time I’m invited as a guest to a Perl event, it’s really exciting to see how Dancer drives me into new situations!
I already said that I enjoyed seeing Dancer taking its own life, but now, it starts to drive mine! Which is even better ;)

Friday

I’ve landed at the Sofia airport friday afternoon at 4PM. The flight went pretty well, and the landing was very smooth. Apprently “Bulgaria Air” is not famous for that, so I guess I got lucky!

My first impression when I got out of the plane was the freezing air. When I left Paris, it was around 5° (C) and Sofia was around -6° (C). It’s like going back in time, when we had snow in Paris’ streets in december! But it’s a very subjective point of view, because Alexey Kapranov, who came from Moscow told us it was -20° (C) over there!

Marian Marinov came gently to take me at the aiprort and drove me downtown to meet Alexey who had found a free city-tour driven by Vanya, a very enthusisast guide.
We went by walk to see most of the historical buildings of Sofia. Yes, you can actually do that by walk, because the center of the city is not very big and most of the historical places are grouped in the same district.

It’s interesting that this city has “mutable” buildings :) From time to time, churches turn into mosques, and to churches again. A lot of Sofia’s buildings change during time, depending on the political
position of the country. Sometimes it’s destroyed then rebuilt again and so on. It’s like a volatile city! Apparently this is going to change, because bulgarian people want to stop desroying their
buildings, even if there are strong feelings linked to them. “It’s part of our history” said Vanya, “wether it’s bad or good history, it’s still history, hence we should stop destroying buildings“.

Sofia

I’ve also been surprised to see that France had strong trading connections with Bulgaria in the past. We’ve seen some historical stones with scriptures written in french.
We had dinner in a sweet restaurant in Sofia, and we tried a couple of meals (Chopska Salata!), it was pretty good.

Saturday

The Perl Bulgraia Workshop takes place in the “French Center” of Sofia’s university, which is actually funded by the French embassy.
Actually we are in the french library of the university, it’s funny to be surrounded by french books when you’ve flew 2,500 kilometers to the east ;)

The conference started at 11 AM with Alexey’s talk about HTTP sessions handling. It was interesting because he went through all the details of the HTTP session protocol, explaining what stateless connections are and how cookies were used to provide that missing state in HTTP. Then we’ve seen the famous technique of embeding the whole session in an encrypted cookie; and what pros and cons you have then.

I did my talk about Dancer then, I’ve used the slides I had done for OSDCfr 2010 and refreshed them before. The talk went pretty well, I think. I tried to show off all the main key-features of Dancer and most importantly its spirit. I think I made my point. I was comfortable and felt like being more fluent than the talk I did at FOSDEM. Maybe the practice is helping ;) I should do more talks in english!

My slideshow lasted 30 minutes, so I had another 10 to do some live demos. I had prepared a set of very small working examples for showing off Dancer’s sessions, serializers and logger engines. It was a good way to end the presentation: after 30 minutes of talking, the audience is much more receptive if you break the way things are done.
Moreover, live demo are always more exciting than slides, because, you know, it’s live!

I also had with me two Dancer T-shirts to offer so I proposed to make a small lottery to find out who will win them. “What would be the best way to do that?” I wondered, “well, it has to be powered by Dancer!“.
So here I was writing a silly app during the last talk (I had 30 minutes to build the app, no more!). The app is basically the following:

my @people = (...);
get '/winner' => sub {
    shuffle @people and $people[0];
};
dance;

Of course I also wrapped all that with a nice HTML/CSS layout in order to display the winner’s name in huge characters, with a centered position.

Well that’s it, the beast was alive in time! Then I filled the list with the people registered on the BPW website and we were ready.

It was very funny to do, we may do that as well at the French Perl Workshop, it’s a very funny way to close the event and to show off Dancer’s ease of use. You have an idea, 30 minutes later it’s live.

I really enjoyed this trip to Sofia, and was very happy to be part of the Bulgarian workshop.

So long Sofia, and thanks for the fish!

FOSDEM 2011 report

So this year I was to FOSDEM, and this was my first time. Wow. F*cking Wow!

FOSDEM hacker tools

This event is awesome. There are so many hackers out there it’s just impressive, like 6000 or something… And it is Belgium, which means pretty awesome beers everywhere for a few euros. But well, I’m not here to speak about beers, am I?

From my perspective though, what was awesome was not FOSDEM itself, but the fact that it was the first time that four of Dancer’s core-team developers met together, in real life. This was huge.

I was with Franck, Sawyer and Dams, and we processed *a lot* of stuff during FOSDEM. Sawyer already wrote a complete report of what we did saturday, and I think he’s going to publish soon a report for today’s achievements.

What really makes me happy is that we have a pretty good energy in the core-team, everyone is motivated like hell and I can’t even realize all we did in 24 hours: all known bugs fixed, 7 pull request processed, every issues are classified and tagged (with a new policy) and we managed to release 1.3003 this afternoon with all the changes applied during our hack sessions. Productive isn’t it!

Sawyer did a talk about Dancer in the perl devroom, it was… well, I think it was one of the best talk I’ve seen so far, and I’m not saying that because it was about Dancer. He’s a really good speaker and had a very interesting slideshow. Dams told me during the talk: « You know what’s the best feature of Dancer? It’s Sawyer! ». Totally!

The room was crowded (there wasn’t enough seats for everyone), people laughed a lot, and Dancer sounded to be so exciting I felt like rediscovering my very own project.

The feeling of seing such a great talk performed about something you’ve created is really weird and fullfilling.

At the end of the day I did my talk about “The art of growing a Perl project”, it went fine (although I’d have liked to be more fluent) and someone came to me at the end and told me: « You know what, I have this project I wasn’t sure to release for a while, after your talk, I clearly want to! There’s no reason I should keep it for myself.». So I think what I wanted to say did make its way to someone ;)

After the talk someone from the Bulgarian Perl workshop asked me if I could come for giving a talk at their event at the end of the month. I’ll have to see if I can manage to do it, but that’s sounds difficult at first glance.

Anyways, such a great weekend we had. FOSDEM++ Belgium++

What about some news?

It’s been a long time since I’ve wrote something here, so here it is for a quick review of the news.

PerlDancer has a new website, apparently it really looks to please people, and I’m very glad of that! Huge kudos go to Oxide who did all the artwork. His design is so cool, we all love it!

I’m going to attend FOSDEM and am very happy to do so. Lots of Dancer developers will be there and we’ll have plenty of time for working on the project (well, if we don’t stay too long in the awesome pubs Brussels can provide!).

I’ll be in the Perl devroom on sunday, and will give a talk about project management within the Perl community; it’s entitled “Code, Release, Market”. How one can grow a project successfuly is the topic I’ll try to cover. Of course, I’ll use the experience I had so far with Dancer to build the talk.

Well, what esle? Ho yes, Dave Rolsky pointed out that our Changelog format is pretty bad, and well, he’s totally right! We’ll follow his advices and will now build our changelog in a better way.
That’s already the case in the development branch, as you can see on GitHub.

Well, that’s all for now, see you at FOSDEM!

Oh, and maybe, if the gods are with us, we’ll have T-shirts with us!

Perl Moderne, le guide de survie du programmeur Perl

Les éditions Pearson publient le 29 octobre prochain un nouveau venu dans la série “Guide de survie” : Perl Moderne.

Cet ouvrage, co-écrit par Sebastien Aperghis-Tramoni, Philippe Bruhat, Damien Krotkine et Jérome Quelin se veut être l’essentiel des pratiques actuelles en Perl. J’en ai reçu un exemplaire, et je vous propose de vous en faire profiter.

Un rapide coup d’œil à la table des matières donne la couleur: ce livre permettra de guider le développeur Perl, quel que soit son niveau. En effet la première partie est clairement une initiation au langage, tous les principes de base y sont expliqués.
Un débutant pourra donc se référer à la première partie du livre pour apprendre à programmer en Perl, mais un développeur expérimenté ira probablement directement consulter les parties suivantes.

Si cette première partie est clairement consacrée aux débutants, les suivantes interesseront certainement les développeurs Perl plus expérimentés, car elles traitent de tous les sujets importants qui peuvent se présenter dans le quotidien d’un programmeur: la méthodologie Objet (avec Moose), la gestion de données (DBI, DBIx::Class, Fichiers, Sérialisation), la gestion des dates, la programmation événementielle (POE), le parsing de document XML, HTML ou encore la manipulation de requête réseau (LWP).

Ce livre, de part son format et son contenu, me semble être le compagnon idéal du programmeur Perl. Un autre titre aurait probablement pu être “Le meilleur du CPAN, un guide thématique vers l’essentiel pour le programmeur”. Car c’est finalement de cela qu’il s’agit: une sélection éclairée et précise sur ce qui se fait de mieux dans le CPAN pour répondre à des problématiques courantes.

Perl Moderne est publié par Pearson, parution le 29 octobre. ISBN: 978-2-7440-2419-1 (22 €)

Posted in Main

Tags: , ,

Permalink 4 Comments

OSDCfr 2010 slides for Dancer

I finnaly took the time to publish the (Broadway) slides of my OSDCfr 2010 talk about Dancer.

Check them out, it’s Dancer powered!

OSDCfr 2010

OSDCfr 2010 logo

Wow. This year, OSDCfr was a pretty impressive event to stop by. There were many interesting people, such as Tom Preston-WernerGitHub‘s CTO – who did a talk about… well, git, surprinsigly.

From my perspective, the event was even more exciting than I could expect, because I discussed a lot about Dancer, with many people. So I won’t cover the whole event in this blog entry, but I’ll focus on what happened around Dancer.

  • Did my slideshow on saturday’s afternoon, it went pretty well. Everything was powered by Broadway, a small Dancer app I wrote two days before as a proof of concept and as a good excuse to do a live demo. My trick went well, I did not say to anyone I was doing a demo until the slideshow was finished: “Want a live demo? Well, you already had one.” – Good climax (and also, apparently a good way to counter Murphy’s law). In less than 50 lines of Dancer, I have a working slideshow engine with an ajax-based remote controller on my Android phone. Someone who saw it running even told me: “man, you almost have rewrote Apple’s Keynote software with Dancer!”. Cool time.
  • Spoke with Martin Berends who is working on Perl 6 and wants to port Dancer. Martin told me he now has a working PSGI-aware HTTP server for Perl 6 (this is awesome!) and he will now be able to start hacking on the very first step to have Dancer in Perl 6 : the ability to define a route over PSGI, with Dancer’s sugar. During lunchtime, we discussed a bit about how to track memory leaks in Perl (we did find one recently in Dancer and were looking for advices, see below).
  • Did a small hackaton with Franck after the lunch, we were focused on finding where the memory leak came from. We actually did! It’s an auto_reload bug (so it only appears when you start your Dancer app in the development environment with auto_reload set). I was already planning to drop the auto_reload feature, had pretty good reasons to do so, and now, I have just the proof maintaining it is just a pain in the ass. No need to wonder why the Sinatra team also decided to drop that kind of feature from their core. We’ll make a plugin for those who want to still use it, but definitely won’t maintain it in the core.
  • Seen Nicolas Rennert’s talk about Hash-tables alogrithms and thoughts about how to parse a tree, the fast way. This made me think we could refactor the way Dancer parses its route tree, and maybe implement that as a vritual class (the same way we do for template, session or logger engines) in order to be able to switch from one route resolver to another
  • Talked a bit with Philippe Bruhat about his project to write a tool to freeze a Dancer website. Basically, you have a local Dancer app, you run the magic script he has in mind and you get a static website you can just upload somewhere. His idea is interesting and I’m looking forward to see it. Apparently, this will be named WallFlower Pretty good name for a static dancer ;)
  • Did a lightning talk with Franck about Jitterbug, our small continuous-integration tool for Perl project hosted on GitHub. Went pretty fast (we spoke about perlbrew, cpanminus, GitHub web hooks and Dancer, in less than 5 minutes!) not sure if everyone understood what it was about ;)
  • At the end of the conference, did an interview about Dancer with Franck and Philippe Bruhat, for “Linux Magazine France”. More than 40 minutes of live discussion are recorded, Philippe should do a transcript soon. It was really interesting to do, it’s a great overview of the project, I’m sure the paper will be exciting to read.
  • Spoke with some guys of the French Perl Foundation, they offered to sponsor our merchandising needs (basically the T-shirts print costs could be covered by the foundation). They find that Dancer is a good project and deserve their support. That’s great news! I’m honoured :)

Talk Schedule

Random news

It’s been a while since I last blogged here. All is Twitter’s fault! It’s so dumb-easy to spread your news items with Twitter I’ve kinda lost the energy and the motivation to write longer and better-organized blog-entries.

But well, there are at least a couple of things I’d like to share, So here it is, in a random order:

  • I’ve been interviewed by the website “Al Newkirk & Associates” about Perl Dancer. It’s been an interesting experience to answer questions about the genesis of the project and to overview all what happened since the project started in summer 2009. Oh, and the credit for the photograph goes to Rached Ben Mustapha (check out his gorgeous Flickr account), I hope he doesn’t mind I chose this one, but it was the less bad-looking picture of myself I had in stock.
  • There is OSDC 2010 this weekend, the conference that will be held at “Carrefour Numérique, La Cité des Sciences et de l’Industrie”, in Paris will gather cross-language communities. Check out the schedule, it’s pretty rich and I’m sure this will be a very pleasant event to stop by. As you may guess, I’ll speak about Perl Dancer.
  • Dancer’s development continues to go on, we’re in the process of preparing the 1.2 release. It’s really exciting. Bug fixing, documentation updates and packaging issues can be fun! Expect the next CPAN releases to be tagged “DEVELOPER” for the next stable one will be 1.2000!
  • A couple of individuals and companies contacted me to know if it was possible to donate to the Dancer project. Looks like some people are interested in contributing in the project that way. We’re not against that by principle and could use that money in several useful ways for Dancer: merchandising stuff (yes, there will be T-shirts for the 1.2 release), travel costs for Perl conferences, VPS hosting, etc. We’ve opened a GitHub/Pledgie campaign, so if you want to support us, you know where to go ;)

PS: yes, it’s basically a digest of my last tweets, maybe I should write something to automate that ;)

Get Adobe Flash playerPlugin by wpburn.com wordpress themes