Nordic Perl Workshop 2006

Copyright © 2006 - Sébastien Aperghis-Tramoni

[+ del.icio.us] [+ Developers Zone] [+ Bookmarks.fr] [Digg this] [+ My Yahoo!]

Chapeau

Even though labelled a workshop, this conference is in fact very international by its organisation (alternatively done by the Norwegian, Swedish and Danish mongers) and by the speakers who have been invited, as Audrey Tang, Jesse Vincent and Michael Schwern (who therefore accepted to let WoW aside for a few hours ;-)).

Wednesday, 14th June - Early Birds Dinner

[NPW 2006 conference logo]

As it is often the case, a small dinner is organised the day before the conference to welcome some of the attendees who come from far away, and is at the same time a good mean for the organisers to cheer themselves up. Jos Boumans plays a live version of Where's Waldo by trying to find me in Oslo and guide me up to the dinner place. Here are the organisers, Salve Nilsen, Trond Michelsen and Dag Asheim, and also some of the speakers like Gisle Aas, Jos Boumans and Marcus Ramberg. Salve and Trond present a project they're working on: a detailed map of Oslo for Google Earth, linked to a web site for giving additional information, for example the bus, tramway and subway timetables.

We also talk politics and free software. Their growing adoption by European governments is a hope for a brighter future despite the endless and undercover lobbying by pro-patents software editors.

At the end of the dinner, the group splits in two: one half, headed by Jos, goes deeper in Oslo to find other places to drink, the other goes to add indications for getting to the venue.

Thursday, 15th June

Opening - Salve J. Nilsen

Salve has a few troubles to connect his PowerBook to the projector. Its screen appears, then nothing, a black screen, and finally a guru meditation. The Nordic Perl Workshop 2006 is officially open. Salve presents the topic of the conference, Managing complexity, then gives some practical information, like where to eat and drink. He also announces that there will be a barbecue at the chemistry building.

Benchmarking Perl - Gisle Aas

Gisle presents himself (as if we didn't know him): he worked for ActivePerl during several years on several projects like their PPM archive format. The subject of his talk is another project, Perl Bench, which he hacked around 1997-98. As the name implies, its aim is to compare the speed of different versions of Perl by running lots of microbenchmarks against each. He shows critics of Jarkko Hietaniemi and Nicholas Clark who both think Perl Bench numbers have little to no meaning. Gisle nonetheless continues to work on improving Perl Bench, and presents how he wants to use gettimeofday() and the functions clock_gettime() and clock_getres(), recently added to Time::HiRes, in order to get better time measurement.

Salve thanks Gisle and gives him a NPW 2006 mug, and will do the same for each speaker.

Jifty - Jesse Vincent

Jesse present Jifty, the "only web application framework that JFDI and comes with a pony." Everything works by using the jifty command, and Jesse shows the different steps for creating a small blog, including the way to censor it using Regexp::Common::profanity_us. The interface even works in Lynx! He then presents the inners of a Jifty application: Jifty::DBI, the ORM part that hides all the database management and even provides a tool for upgrading the database, Jifty::Dispatcher, the kernel written by Audrey Tang, Jifty::Continuations, which promises to ease the development of web apps. "The web is built on GOTO. I prefer GOSUB".

Jifty's views are currently built on Mason, but Jesse promises upcoming support for Template Toolkit. Jifty also provides a useful support for debugging everything including templates and SQL through halos. Yet it runs fast thanks to Apache, Memcached and modules like CSS::Squish and JavaScript::Squish. Jesse promises a wiki-style editor for the future.

Agile Development in Theory and Practice - Johannes Brodwall

Member of smidig.no and organiser of Oslo XP meeting, Johannes first explains Barry Boehms' theory on "Software economics" but doesn't seem convinced by its pertinence. He goes on with the basics of agile development: being agile is enabling a safe myopic vision, so projects should be spliced in smaller functional units, focused for short term delivery: design for the current feature, write a test, make it pass, deliver and adapt from the feedback. Delivering and deployment should also be as simple as possible so they can be frequent and thus avoid too big gaps between releases.

He emphasises the importance of an automated regression test suite and recalls that if unit tests are easier to write, acceptance tests are of greatest value. A good tests suite, especially when executed by a smoker, allows to write code using in a test-driven development fashion, as well as refactor existing code. He adds that using such methods allowed him and his team to rework more than 400 files and treat a 500 kloc application as one code base.

RT - Request Tracker - Jesse Vincent

Jesse presents his company Best Practical; they develop cool kids toys like RT and SVK. He then tells us the story of RT, exposing the main features of each major version, for example the big refactoring of RT 3.0 (what Jesse calls I22N, internal rationalisation) and its support for internationalisation, and especially Chinese, made by Audrey Tang. RT 3.6 also brings its share of new features: the UI has been entirely remade in CSS (Jesse shows RT with a Goth theme), reminders, customisable home page, custom fields with AJAX support, graph support, googlish search and more. Jesse explains that at last NPW, he had promised Jifty by Christmas. He released it on December 25. But where's RT 3.6? Jesse releases it now, just before the audience.

Perl, PDL and Air Pollution - Heiko Klein

Heiko first explains us the context, how air pollution causes damages to buildings, forests and human health. Most of it comes from big industries and the traffic, and may even come from other countries: that's the case for 95% of SOx present in Norway. Therefore decision makers want an assessment of the current situation to measure the impact of their potential decisions.

The Norway Meteorological Institute is using a Fortran 90-based software for swallowing 60 GB of meteorological data and lots of small files and outputting 50 GB of concentration data. A single run takes five hours on a 36 CPU box. They wanted to use Perl for their model verification, but if Fortran is good at number-crunching, it's bad at string-handling, while it's the reverse for Perl. Until PDL, which offers Fortran-like arrays in Perl with speed and memory consumption comparable to C and Fortran.

Each PDL is a strongly typed multidimensional rectangular array, but also behaves like a regular Perl object so you can have scalars, lists and hashes of PDL. Mathematical operations are overloaded and apply cell-wise.

Heiko shows the same example of a pair-wise max of two arrays in Perl, basic PDL and advanced PDL, and follows with a real world example. He finishes by presenting how he used PDL and other software for creating reports, mainly jFreeGraph (called via Inline::Java) for generating nice graphs and Spreadsheet::ParseExcel for reading XLS files. He explains how he patched this module for improving its speed.

During the questions, I ask him why he didn't send his patch to the author. He did, but the author never answered. I suggest him to take over the maintenance of this module and quickly tell him how to do so.

Deploying Perl 6 - Audrey Tang

For Audrey, Perl 6 is here today. Pugs and Parrot are already here for experimenting, but she promises Perl 6 for Christmas ;-)

Perl 5.9.3 has the feature pragma for using some of the Perl6-isms in Perl5, but as it's the development version, it's not ready yet for production. Same for Parrot, which still lacks a Perl5 front-end. Pugs uses the reverse approach by implementing back-ends: the code written in Perl6 is translated to Perl5. Audrey also presents Moose, a module that provides Perl6 objects in Perl5, then several Pugs modules, like Pugs::Compiler::Rules. She explains some of the Perl6 rules new features, like named captures, backtrack control and Perl code inside the regexp.

Audrey then proceeds to explain why "everybody hates Spiffy". She shows some code.. ETOOMUCHMAGIC! It's based on Filer::Simple, hence the hate because it has to process the source each time it's used. She explains the idea she had to correct this, using her Module::Compile. This module uses the little known fact that each use Foo first searches for a Foo.pmc before a Foo.pm. So the result of the source filtering can be saved in the .pmc, giving a faster startup time. And as it's sane Perl5, it's also debuggable. Audrey therefore wrote Filter::Simple::Compile which is a drop-in replacement for Filter::Simple. This technique can also be used for writing a better version of Filter::Macro, which replaces the code in the caller package with the expanded code, hence Inline::Module:

    use Inline::Module Filter::Simple => "slurp";

Coming back to Perl6 and Perl5, Audrey explains that use v6-pugs uses the syntax trick of the unary dash operator: -pugs is seen as an option of the v6 module>. Thanks to both tricks, one can now write Perl6, convert it and run it on standard Perl5!

Inside-Out Objects - Abigail

This is the same talk that Abigail did at the London Perl Workshop 2005[1], where he introduces the concept of inside-out objects where attributes are stored in lexical hashes in the definition class. The aim is both to allow derived classes to have different attributes with the same name and to generate an exception for incorrect attribute names.

Gisle Aas asks about the compatibility of inside-out objects with the debugger. Abigail says that he doesn't use the debugger, and therefore can't answer from first hand, but thinks it's probably not the case.

After the talk, Salve makes a few announces: a page has been put on the wiki so speakers can link the slides of their talk; there will be a key signing session tomorrow during the first coffee break; and he wants to take a picture with all the speakers.

Barbecue

The barbecue takes places in an atrium of the chemistry building, which gives an easy access to a large amount of dry ice. Jos Boumans asks Audrey Tang if she still has a house in Taiwan given that she seems to travel that much. Audrey reassures him and explains that she still has a house although it may change with the political situation of Taiwan. She also says that the next stop in her Erdös-like hack & talk tour will be in Seattle, at Microsoft Corporation[2]. Jos and Jesse Vincent make a laugh about the fact that, as there is no cabal, there won't be any meeting on certain dates in the next months.

On one side, some people are distributing Sun goodies: Java t-shirts, OpenSolaris DVDs and additional batteries for mobile devices. Jonas Nielsen asks me about Heiko Klein and Spreadsheet::ParseExcel, because he's using this module as well, and would like to see it maintained and improved.

Friday, 16th June

logicShop - Jonas B. Nielsen

Jonas quickly presents his company logicLab, one the sponsors of NPW, then goes on with their main product, logicShop, an e-commerce engine based on Class::DBI and PostgreSQL, showing the technical ins and outs. He plans a closer integration with Handel and hopes to accommodate other languages than Perl (Ruby, PHP).

» http://logiclab.dk/

Writing applications with Qpsmtpd - Fred Moyer

Qpsmtpd is a Perl SMTP daemon written by Ask Bjørn Hansen, and is like the mod_perl of SMTP, providing a plugin API that makes writing extensions quite fun. Fred explains the configuration format, then shows how to write a simple plugin to filter mail against the subject.

He then proceed to explaining the concept of SMTP applications, like SMTP to HTTP gateways, that can be used to automate tedious processes. A practical application, for example, is to take pictures with a mobile phone, send them by email to the mail server where the plugin can receive it and extract the photo and post it on a web site like Craig Lists or Flickr.

Some recommended API practices are to execute the application after all the other plugins, just before the queue; to send an email to the sender, as a kind of receipt; to give feedback to the user, telling him if the process succeeded or failed, and in this case why. For security reasons it may be useful to require the users to authenticate themselves via SMTP and to register the mail address and verify they're real persons.

» https://www.redhotpenguin.com/svn/talks/npw/qpsmtpd/

» http://smtpd.develooper.com/

Barely Legal XXX Perl - Jos Boumans

This talk Jos should have made during the London Perl Workshop 2005 is a kind of follow-up to the 20 things you may not know about Perl he did at YAPC::Europe 2003.

A problem with Perl is that parsing Perl code with Perl is Hard(tm), but it's now possible with Adam's Kennedy's PPI. Jos shows examples of code for which we wonder whether they die() or not, then presents Acme::BadExample, a module written by Adam with the property of being syntactically correct but impossible to run. Adam promised $100, or a vertical meter of beer for anyone who could make it run. And Jos happens to like beer...

Jos explains the source code of Acme::BadExample, then the tricks used in the code of Acme::Code::Police and Acme::Code::FreedomFighter. He then explores barely legal Perl syntax tricks, trying to find ways to execute Adam's code. For example, how to declare and call a function with only digits the name:

    *42 = sub {};       # create the sub
    *42{CODE}();        # call it
    main->can(42)->();  # another way to call it

By looking at the source of pp_ctl.c:pp_require(), Jos discovered that one can pass a coderef to require(), which it executed as a source filter. After experimenting a little he could then find the appropriate filter to make Acme::BadExample run :-)

Module::Release - brian d foy

brian's problem was that some of his modules did have problems, some of them were reported by CPAN Testers but not all, and not for all his modules. brian explains how, while releasing code on the CPAN is easy, releasing good code is hard. For a good release, an author like brian must test and disttest, check in the source, check the MANIFEST, update Changes and README, then upload the tar ball on PAUSE, then on SourceForge (with their overly complicated file release), tag the release in the SCM and finally announce the release. Then repeat this for 50 modules.

Mistakes typically occur because repetitive task are boring, and the developer must stay focused on bug squashing which is not fun either. This process can obviously been automated and executed by the computer. Hence Module::Release, a program that checks each point, dies if there's an error or goes on and publish the module if none. brian plans to extend it beyond Perl modules using plug-ins. He then demoes it with his module Data::Constraint. The Pod coverage test fails, so brian does an evil trick and replaces the actual test with pass(). He runs the release command again, but the CVS check gives some errors, so he adds the files to the CVS, commits, and runs release again, which this time is happy and asks for the changes. It create the tar ball, uploads it on PAUSE, then on SourceForge, and tag the release in the CVS.

Marcus Ramberg asks if Module::Release works with Module::Install. brian doesn't use it, but thinks this should work.

Seven Principles For Transforming Difficult Tasks Into Simple Ones - Michael Schwern

Michael exposes in his talk common sense principles for building systems (not just computer systems) in order to make tasks easier, and more generally to avoid pushing users to do stupid things. He pictures his sayings with both serious and funny examples: to configure the time zone, Unix tzconfig asks the geographical zone, which is an interpretation; on the contrary, the control panel under Mac OS X shows a nice map where the user can just click where she is. Someone asks if this is also valid in the USA where 70% of the population can't place their own country on a world map :-)

Feedback is an important point of complex systems: cp(1) doesn't provide any while scp(1) does; geeks were used to detecting hard disk problems by listening to its noise, but now they're silent; and if people shout in cell phones, it's because they don't give you the feedback of your own voice, while landlines do.

He recommends reading The Design of Everyday things, the book he used to prepare this talk.

CGI::Prototype - brian d foy

brian begins his presentation of CGI::Prototype by firs showing how many steps of a web application are all the same: after start up it must receive and validate the input, then process it and output a result. The current way to handle this and avoid the hassle is to use a MVC environment such as Catalyst, Maypole or CGI::Application. CGI::Prototype is another one to do this, just lighter. It's mostly based on Class::DBI and XML for the model part, and Template Toolkit or XSLT for the view part. Each state of the controller is a namespace of the web application, along with a corresponding template: actions translate to changing namespaces, and errors are handled by the Error namespace. A safe mode is available to avoid any 500 error. The template can be chosen as late as possible in order to adapt to the results. For example, a search with no results would show the search form again, while several results would be listed and only one would be showed.

» http://www.ourmedia.org/node/1644

Lightning talks

Marcus Ramberg

Gisle Aas - Binary distribution of Perl

Gisle explains how ActiveState has overcome a limitation of Perl, which is that it detects its environment at build time, but not at run time. They introduced the module ActivePerl::Config to override values in %Config in order to match the system where Perl currently runs. If an administrator doesn't like this, it can disable it by setting ACTIVEPERL_CONFIG_DISABLE=1 in the environment or by removing the corresponding package: ppm remove ActivePerl-Config

Kjetil Kjernsmo - The Semantic Web

Kjetil presents some of the notions behind the semantic web, then focuses more closely on the RDF data model, a graph model based on triples: subjects, predicates and objects. There are many RDF-related modules on the CPAN. Too many even. The next big thing should be RDF::Helper, the DBI of RDF. Kjetil then shows some code but, being too long, is interrupted by Marcus.

Kjetil Kjernsmo - Formatter

Formatter is base class for leveraging a generic API for formatting and conversion modules.

Dmitry Karasik - DBIx::Roles - wrapping DBI in nasty hacks

Dmitry explains that many modules encapsulates DBI and its connect() method in simpler API, but they are usually problematic when one wants to use more than one connection. Hence his module DBIx::Roles, which he presents as "one hack to rule them all".

Dmitry Karasik - Regexp::Log::DateRange

Dmitry presents an other of his modules, Regexp::Log::DateRange, which he wrote because he wanted to read and SMTP log file, sort it by date and find lines within a selected range.

Abigail - %s (...) interpreted as function

This is the same lightning talk that Abigail did at YAPC::Europe 2005, where he explains how Perl is totally inconsistent with regards to this warning. His experiments show that it appears only with the print(), printf() and sort() functions, when there is exactly one space (not a tab) between the function name and the opening parenthese. It may even depend on the content of the string!

Anton Berezin - Acme::Depoop

Anton Berezin first explains the concept of POOP, Pointless Object Oriented Programming, then presents his hypothetical module Acme::Depoop whose aim would be to convert modules with (what he judges) a POOP API to a procedure API.

Audrey Tang - ppencode

Audrey presents a talk that was made at YAPC::Asia 2006 in Tokyo by Yoshinori Takesako. It begins with a very fast and very satirical (and very funny) presentation of the future hype technology: the Unfactoring, based on a high-skilled technique, copy-paste-paste-paste-paste. Then it goes on and explains how to force Perl programmers to use Ruby: just take out the $ and ; keys from the keyboard. Except it's in fact possible to make Perl programs with only keywords and whitespaces. And here comes ppencode, a JavaScript program that generate such Perl programs!

Closing - Salve J. Nielsen

Salve promises videos of the talks, as well as the slides of the talks. He then gives some prizes, but lacks the gifts, so runs out of the room, while Trond arrives by the other entrance :-)

The organisers all come on stage for a final photo, and invite local people to join the Oslo.pm group. They announce that the next Nordic Perl Workshop will be in Copenhagen and officially close NPW 2006.

Conclusion

I wish to personally thank Salve Nielsen and Trond Michelsen for helping me to find an hotel, and even transporting me a few times. Combined with the sheer weather (Oslo was as warm as Antibes) and the very good means of transportation of the city, this carefully planned conference was a complete success.

Notes

  1. cf. London Perl Workshop 2005, GNU/Linux Magazine France #79, http://articles.mongueurs.net/comptes-rendus/lpw-2005.html#h1.3

  2. Remember that Simon Peyton Jones, author of the Glasgow Haskell Compiler that Audrey Tang uses for Pugs, works at Microsoft R&D.

Links

Auteur

Sébastien Aperghis-Tramoni, {Marseille,Sophia}.pm, <sebastien@aperghis.net>

[IE7, par Dean Edwards] [Validation du HTML] [Validation du CSS]