BBC Backstage Xmas Bash

After the LPW, I followed a few other Perl mongers along to the BBC Backstage Xmas Bash. It looked completely empty when we got there, which was slightly disconcerting, but it just meant that the iceberg was 90% hidden, with all the action being downstairs.

Immediately on my arrival, I spotted Ribot and Devi from Future Platforms—always glad to see a friendly face. But they weren’t the only part of the strong Brighton contingent. I also bumped into Andy Budd and Aral Balkan, as well as James McCarthy. And I’m sure I missed a couple of people as well. It’s really good to let everyone know how much good talent is down in Brighton.

What was really nice about the party as a whole was the grand mixing of different peoples. The Perl people met the Ruby people who met the BBC people, etc. It felt like a huge great, noisy (very noisy) melting pot. Top marks to Aunty for putting it on!


London Perl Workshop 2006

Yesterday was the London Perl Workshop, a one-day, two-track conference put together by the London Perl Mongers (in particular, muttley and Greg). I arrived early (mostly due to my lack of faith in train times), so got to put up posters first.

First talk of the day was Jesse Vincent on Jifty, the web application framework originating from within Best Practical. It was a basic introduction—making blog software, of course. Jesse took us through the details quite quickly, but it was immediately clear that very little work needs to be done for a basic CRUD app. It appears to use Mason by default, which I consider a plus point. Overall it felt very railsish, particularly the fact that it has migrations. I love migrations.

After the basic intro, he went over a few advanced features like the continuations support (of which more later) and the developer support. There’s a bunch of stuff in there that I really need to look at nicking for work, like the builtin Mason profiler support and the inline fragment editing, not to mentioned CSS::Squish and JS::Squish.

On the whole, I’m not sure about Jifty. It looks lovely, and quick to develop in. But that amount of concentrated magic scares me. I need to try out a couple of small applications to get a better feel for it.

I stayed on for the next talk, Mike Astle on wigwam (a deployment tool). I’m interested in doing deployment better, but ultimately, wigwam didn’t seem to offer that much more than what I have at the moment: a way of building packages into a compartmentalised space that can be distributed around different servers. Looking around the audience in the question time, I think I wasn’t alone.

Afterwards, I popped down to see Tom Hukins talk on “Just in time testing”. Sadly, Tom was ill. However, abigail stepped up and offered to talk about instead, highlighting the many ways in which it can be abused. He had culled a number of uses of Benchmark from perlmonks, and demonstrated various flaws. Such as not benchmarking the same thing, or trying to benchmark volatile data. The best was when he demonstrated how the compiler had completely optimised away one of the branches. Naturally executing a statement which has been optimised away is very quick.

My main beef with all of this was simply that the things being benchmarked were phenomenally simple. Really, if you care about map vs grep performance, go write it in C. Otherwise, profile your app long before you start to think about these things. demerphq pointed out that you can end up dieing the death of a thousand cuts if you don’t care about some of these little things, however.

Funnily enough, demerphq was speaking next on the changes to the regex engine coming up in Perl 5.10. This was a really deep, informative talk, and I’ll admit to glossing over some parts of it, but there were two things that really stuck out for me:

  • Recursive patterns. This makes it really easy to call back into the regex you’re matching. This is very handy for doing things like matching balanced tags correctly.
  • Named parameter groups. Nicked from .Net and Python. This should make large regexes much simpler.

Apart from that, there’s been a whole lot of work to optimize the regex engine, as well as making it properly pluggable. This now leads to the situation of making PCRE truly Perl compatible by embedding it…

After lunch, I listened to Jesse Vincent again, on “Advanced Jifty”. This was basically peeking inside some of the deep magic that’s going on in there. First, Jesse gave an overview of the message bus inside Jifty. The heart of it is IPC::PubSub. Moving on, he peeked inside Template::Declare. This is a bit like markaby. Jesse pointed out a couple of “unusual” implementation details such as local *__ANON__ = $tag; which is an undocumented way of naming auto-generated subroutines so that stack traces make sense. He also presented a quote from Audrey: “we read every bit of perlsub.pod and abused it all”.

Lastly he covered the i18n pragma, which is just filled with scary magic to make ~~'hello world' look up hello world in a message catalog and return a translated version. There’s a great deal of use of overload and overload::constant.

A this point, Jesse started to run out of time, so he rushed through a few other interesting uses of Perl:

  • Using a function called _, which is globally available in all packages.
  • Blessing into a class called 0 in order to return false from ref.
  • Creating an MD5 sum of the call stack. I’m guessing that’s how they implement continuations support.

From one mind boggling talk to another: Abigail was on next, with “Sudoku by regex”. I won’t begin to pretend to understand what it was all about, except to note that a standard 9×9 Sudoku grid took 1.5 hours to solve in a single regex. Apparently, he’s also been trying out other games in a similar fashion, except that one of them he let run for 2 weeks before pressing ^C

Alistair McGlinchy talked about “How to make a grumpy network capacity planner happy”. This was a really nice little piece on what his work as a network admin involves, and why developers chew up lots of bandwith without thinking. He gave a really good overview of HTTP caching / compression, which needs to be more widely known.

Ash Berlin spoke on Angerwhale, which is a blog that doesn’t use a database, but does use Catalyst. Consensus from my bit of the audience: why aren’t you using bloxsom? It’s smaller, simpler and works just as well.

Finally, Jos Boumans gave his superb talk on barely legal XXX Perl. It’s a detailed blow by blow account of making Acme::BadExample run, despite all the deviousness contained therein. As with Jesse’s talk, this is scary stuff, but gives a real insight into how to mold Perl to your will.

All in all, a superb day. Interesting people, interesting talks. It was well organised. I’m extremely grateful that it was put on, particularly for free thanks to the sponsors…

Anyway, after the conference, the only natural thing to do was retreat to another pub. I only spent a short while there before departing for the BBC Backstage Xmas bash


RailsConf Day 2

Urgh, I’ve spent most of the weekend recovering from a cold and lack of sleep, so I’m finally at a point where I can write up the final day of the conference. In the meantime, I noticed that DHH has a great railsconf writeup, which covers many of the things I saw.

In the morning, Jim Weirich kicked off with a talk about how to write good libraries in Ruby. He pointed out that there a lot of really bad libraries out there that do hideous things and have weird side effects. Monkey-patching is OK, in an application, but in a library, you really have to keep control of yourself (“sufficiently encapsulated magic” as I once heard schwern call it). He presented some good advice, but most of it was really kind of obvious if you’ve worked in any dynamic languages before. I did get the impression that there were a lot of Java converts in the audience, for whom this might not have been so obvious.

As a side note, Tom showed me how to use Quartz Composer in the end of that talk. That’s a heck of a cool toy. I must play more.

Next up was why the lucky stiff. It was nearly James Duncan Davidson, as _why was a little conspicuous by his absence. But he showed up on time, and went on to talk about a number of things. Watching a talk by by _why is more like being at the theatre than a lecture. It’s hugely entertaining. If I said that he talked about how to use the * operator (splat), and his lovely sandbox library, it might sound dry. This would be to ignore the contributions of the Dragons, Foxes, Owls and huge cast of characters that assisted him on his journey.

After this, the main talks started. I went to see Rany Keddo talk about “How I turned my Bank job into a rails playground”. His answer: lie, steal, cheat. It seemed to have worked well for him though. The best bit had to be his picture of Gollum labelled as “DBA”. 🙂

After lunch, I went into Sean O’Halpin’s talk, “RoR against the Machine”. But I’ll admit that I wasn’t paying much attention; I was too busy working on my own talk. Which is a shame, as it sounded really interesting. The notion of having Virtual Machines as “MS Office Servers” sounded like a really cool hack.

I did manage to catch the very end of Hampton Catlin on “HAML: Naughty Boys Need Structure”. HAML is an alternative approach to writing pages which aims to sit between the extremes of XML::Builder, which is just code and erb which is interpolated markup. I’m not sure I agree with it, but it’s an interesting experiment.

After my talk, we all filtered into the main hall to hear James Duncan Davidson. His talk was entitled “The Web is a Pipe”. He was talking about how using HTTP as a substrate for integrating web applications is the way to go. Having used FastCGI, I really, really agree with him. Doubtless there are some times when you’ll hit performance issues, but it’s certainly a very sensible default.

The final talk was given by Dave Thomas. This was the most unexpected talk of the conference, and it completely blew me away. He started out talking about terrorism, apropos of the 5 year anniversary of 9/11. This seemed to shock most of the audience (although he didn’t say anything revolutionary—much of it was very reminiscent of Bruce Schneier). But he veered around to talking about risk. And from there to talking about Rails and FUD. And how to deal with it. He dissected several of the common tactics that are used to diss Rails. But, he emphasised, he’s not saying Rails mustn’t be criticised. Just that he wants valid criticism, not straw men. This was one of the best talks of the conference for me.

After the conference, we gradually filtered out towards a rather lovely curry in Soho…


RailsConf Day 1

What I done saw…

Unsurprisngly, after a brief introduction by David Black, DHH kicked off the conference with a keynote speech. Except that having no copy of Keynote on his laptop, he used TextMate instead. Hardcore! He went on to show off the RESTful ideas in Rails 1.2 (due out Real Soon Now™). I’ve done quite a bit of REST stuff at work, and the rails stuff completely kicks the butt of everything I’ve done. It has simple written all over it. But it’s not just the server! They’ve implemented ActiveResource, which is an ORM for REST based web services. So you get client and server! He also discussed the next project, SimplyHelpful which is aiming to clean up the views a bit. Looks really neat, but not scheduled until Rails 2.0. But it’s a plugin if you want it. Lovely.

P.S. deprecation warnings will appear in 1.2 as well. Pay attention; those things are gone in 2.0.

Afterwards, Kathy Sierra talked about passionate users. I have to admit to finding this one a little bit hard to follow. That’s because I do so little design I guess…

I wanted to see Dann Webb talk about the Unobtrusive JavaScript Plugin. Unfortunately, it “sold out” and I couldn’t get in. Instead, I elected to see Dave Goodlad talking about Rails speaks C. This was actually a really nice talk. A single topic well covered. He talked about how to write C extensions in Ruby, and then covered the use of BackgrounDRb for long running processes. Really useful.

Lunch was served in the conference venue itself, which I found a little odd. On the other hand, it was a great way to mingle with all the other delegates. But you inevitably get drawn to people you know… I quickly found Tom and Simon. Given that between us we are PHP, Python, Perl and JavaScript coders more than Ruby, it gave an interesting slant on the talks!

Post lunch, I listened to Jamis Buck talk about all the shiny new toys in Capistrano 1.2 (the shell is the big one, but parallel execution looks real handy too). He finished his talk early and then asked the question “Who doesn’t know what capistrano is?” I ducked out at that point to go and buy a copy of Building Scalable Web Sites from Josette on the O’Reilly stand. Simon mentioned it had a great chapter on Unicode, so I cribbed a few bits I’d missed for my talk. 🙂

For the next slot, I watched Alex Payne talking about “Securing Rails—a whole stack approach”. He covered a huge amount of ground in a fairly short time. From the obvious things like SQL Injection, XSS, CSRF all the way down to databases and firewalls. He gave out loads of tips, which I still need to sit down and digest. #1: Use h() everywhere!

I was really curious to see Simon talking about Django and what Rails can learn from it. I have to say, Django looks hugely impressive. It’s clear that they’ve taken a very different approach to Rails in many ways yet still come out with something similar. Personally, I loved the way in which Django uses very richly specified domain models in the Python classes in order to build up an “instant” admin interface. Really cute stuff.

I’d talked to Till Vollmer beforehand about his talk on Localization. It turned out we had quite a few slides in common. However, the rest of slides gave a good overview of the seemingly myriad array of plugins available for i18n and L10n for Rails.

After the sessions, there were “Drinks and Canapés” served. The drinks were good, the canapés slightly miserly, so I headed off to a noodle bar with a few guys before the evening session. I’m not sure how great the idea of the evening session is. I was alright because of the food, but some people must have been getting really hungry. 🙂

Anyway, with 6 members of the Rails core team assembled, David Black fired off questions submitted by the audience. There were quite a few insightful ones in there, but I liked:

Q: When should you not use Rails?

DHH: Lots of projects come with an “Enterprise” label and are doomed to fail, regardless of technology. Please don’t let Rails be associated with them. 🙂

Post-Q&A, DHH got to give the last part of his talk from the morning, which he hadn’t given because of time constraints. This was basically an extended rant about Vendoritis. He used the recent security incident as an X-ray to analyze the rails community and found it suffering from Vendoritis (entitlement & indignation). He concluded that we have to help make the community a better place in order to try and solve things. Get involved. Make it personal. It’s everybody’s job to keep the rails community healthy.

However, the funniest bit was his translation of the MIT license: “I don’t owe you shit”. (in response to some of the whingers)

Thanks to my ineptitude at advance planning, I had no hotel room, so I had to head back to the train pretty sharpish after that…


Unicode for Rails

I finally gave my talk this afternoon. I rushed through things in 40 minutes; I was planning on 45, but I started a little late due to microphone difficulties.

The talk seemed to go down well; a few people came up to ask questions afterwards. My official hecklers, Tom and Paul were noticeably silent. They didn’t try to pedant-me-to-death afterwards, which is good. Although it probably means I had too much detail in there for mere mortals!

I’d also like to give a huge bouqet of thanks to the hyper-lovely _why for his fabulously encouraging words along the way.

Anyway, please take a look at the slides for Unicode for Rails if you fancy. One thing I added at the last minute and didn’t get a chance to show on screen was the links slide. In particular, I recommend checking out Julik’s Unicode Slides.

I practised by giving the talk to a collection of fluffy toys that we have around the house. We now have the most well-unicode-educated giraffes in existence, I suspect. 🙂

On a slightly less fun note, I’ve just read Tony Finch’s summary of UTF-8 in email, which is far, far hairier than in HTTP (which has most of the complications built in at least). Worth checking out if you do much email.


RailsConf Europe is Over

I’ve gotten back from RailsConf. I actually got back a few hours ago, but went to bed and couldn’t sleep (idea! ping! awake!). So, I thought I’d start writing up stuff whilst I thought of it…

The conference itself was pretty well organised by SkillsMatter and RubyCentral. There were a couple of minor hiccups which caused confusion—the main one being the rescheduling as some talks got a much stronger interest than expected, meaning that they had to be moved to larger rooms. Thankfully, there were helpful little orange elves to answer questions all over the place, so it wasn’t a big problem.

One slightly unfortunate behaviour was the shape of the venue: three tracks were on the lower ground floor; one was on the 2nd floor. So there was a lot of healthy exercise to get the Rails geeks going up and down stairs (the lift was too slow!) But the venue as a whole was very good. Extremely central —200 yards from Tottenham Court Road tube station.

The wireless was terrible. That seems to be standard for conferences unfortunately. It seemed that the DHCP server was handing out 24 hour leases, and then only 100 of them in the main hall, which was a real pain. At least it meant I concentrated on taking notes!

All the talks were recorded and should be up soon, hopefully! I really want to catch some of the ones that I missed. The best thing I can say about this conference is that I was incredibly torn between the choice tracks. They had a fantastic array of people and ideas.


Pizza On Rails

I’ve just gotten back from the Pizza on Rails pre-conference event. I was a bit nervous, because by all accounts I knew nobody who was going. Thankfully I bumped into Paul Hammond within 5 minutes of arriving. He introduced me to Rob who deals with That sounds like fascinating stuff—over 12Tb of data, including all past legislation and amendments. Lots of SGML though, poor man.

In turn, Rob introduced me to Paul Battley who will be heckling my Unicode talk. I’d better tread carefully. 🙂

Eventually, we wandered over to another pub, which was slightly less noisy. The thunder storm going on around us was fabulously entertaining.

At the pub, I found Dan Webb who graciously explained the innermost secrets of the UJS plugin, which brings unobtrusive JavaScript to rails in a rather lovely way. I’ll definitely have to look closer at how that works. I owe Dan a drink or two for the time he spent talking slowly to me about various bits of JavaScript. It’s really great that somebody is willing to take Rails’ JavaScript usage forwards like this.

Anyway, now I’m at the office surveying the remnants of the same storm that I have to cycle home in. Bleargh.


London JavaScript Night

I’ve just gotten back from LJS. It was an excellent evening of talks (bar mine, I feel). The two talks I really wanted to see (“JavaScript Idioms” by Paul Hammond and “JavaScript Taste Testing” by Simon Willison) were superb.

Paul Hammond gave a very good overview of why things often look a bit funny in JavaScript, but are actually sensibly thought out. His idioms in other languages managed to draw puzzled looks and laughs in almost equal amount.

Simon did a whirlwind tour of Dojo, Prototype, the Yahoo UI Library and MochiKit. It was a pretty well thought out and explained piece of work. He did a good job of showing where the tradeoffs lie in each case. It’s also made me realise how much I need to try the alternate toolkits to get a feel for them… (NB: Apparently YUI makes a best effort at accessibility for its widgets, which sounds like a Good Thing™).

Of the remaining talks, I really enjoyed Dan Webb’s DOMBuilder, which strikes me a an extremely elegant solution to the verbosity of the DOM.

Tom Insam’s enthusiasm for E4X was extremely entertaining, despite the ending (“It’s hardly worth bothering”).

It was a difficult act to follow, and to be honest, I completely tanked. I had expected about 30 people, and there were around 200. Plus my topic was relatively obscure to most people. Ah well. Next time I’ll find a better subject (and practise more beforehand). Oh, and get a proper PDF presentation instead of S5. That would have been much easier to handle. BTW, the slides are up.

Hopefully the slides for the remaining talks will be up in the next day or two.

A big thanks to Greg McCarroll for organising it all in the first place. Good job, Greg.


London JavaScript Night

The wonderful Greg McCarroll of is organising London JavaScript Night. If this is anything like the Perl tech meets, I expect it to be well run. I’m already looking forwards to both the full-length talks on that page, and I can’t wait to find out what the lightning talks have in store.

Uncategorized tech meet

I went to the tech meet last night. There was an excellent selection of talks, but the one that really caught my eye was Tom Hukins talk on Now, I’ve looked at AOP before, mostly in the context of Java and AspectJ.

But every time I read about AOP, I came away with my head spinning. The idea should be simple: provide a way to interleave your own code into other methods that you don’t necessarily control. But the frameworks in existence just don’t seem to be that simple.

So, Tom’s talk, Tracing code with was really useful. It clearly and simply ushowed how to use to intercept function calls in a nice, practical manner. You can use it to insert tracing into code that you might not control. What’s very nice is that you can also modify parameters on the way in and out. Tom demonstrated how to redirect all HTTP calls to localhost for testing.

Funnily enough, I first came across this behaviour some years ago inside Emacs: Advising Emacs Lisp Functions. It’s quite simple to use…