We (me and my wife, both programmers) got back from the Europython 2010 conference a couple of days ago and I decided to write a bit about the stuff that we saw there.
This year the conference took place in Birmingham, UK which is the UK’s second largest city. We were there for only the main part of the conference (19-22 July) but there were a couple of days of tutorials before that and a couple of days of sprints (hack-togethers) afterwards. There were almost 400 delegates this year which is a bit down from the previous year. Each day started with a keynote from someone well known in the community.
The first keynote was given by Dr. Russel Weinder who talked about the future of processors and the need for better concurrent programming tools than using threads, mutexes and shared memory which he considers too low level. He also said that cache coherency algorithms will not scale much further. For 256+ core machines that are not too far in the future we certainly can’t get fast shared memory because assuring cache coherency would be impossible. In short some kind of architecture with message passing between cores/core clusters with separate memory is inevitable. Russel was pushing CSP (Communicating Sequential Processes) as an answer to that problem and there were 2 other talks about it (one by him and one by Sarah Mount). Basically it seems to be a message passing model where functions run as separate processes that communicate with each other over synchronous channels. The examples given used embarrassingly parallel problems and for me it was kind of hard to imagine that approach in large systems. I think the main “problem” hindering the adoption of this (and similar models) so far is that everyone has grown so accustomed to OOP by now. You can’t really use objects in the CSP model since they tend to have a lot of internal state. So it’s rather hard to throw away all the years of OOP thinking and replace it with something else – mostly because of the inertia and the fact that people really, really hate change.
Still, some kind of message passing abstraction seems to be unavoidable in the future.
The second keynote was given by Bruce Lawson from Opera and his main point was that people should use W3C standardized stuff instead of proprietary things like Flash and Silverlight. His argument was that standardized technologies make your site more easily maintainable and accessible, for regular people with different devices, for screen readers for the blind as well as for search engines. He had a demo about using theΒ CSS media queries standard to write web applications that ran on very different mobile devices. The general idea is to limit the scope of CSS rules based on the capabilities of the presenting device directly from the CSS instead of the current widespread approach of detecting the actual device or just writing your stuff for one single device only.
Used in conjunction with W3C widgets (and possibly device APIs) it would allow you to write cross platform applications that can be installed on users’ devices and used as a normal app that just happens to run inside a browser. This seems to be a far more sane way of writing mobile apps than the current approach that requires a different language & SDK for each major device family. I remember I read an interview with someone from Nokia a while back where he echoed the same sentiment that this is the future for most types of applications. Now if only we could write web apps in some saner language than JS π
Bruce also had couple of nice demos of the canvas and video tags.
The third keynote was given by Richard Jones and it was an overview of the history and the current state of Python (both CPython and the alternative implementations).
The last keynote was delivered by BDFL Guido Van Rossum and it was basically a QA session with questions posted by participants to the special app beforehand. The questions could also be voted for. I had never seen Guido IRL before so it was nice to see that the guy is really rational and down to earth. There were questions about what language features he hates and which ones he would like to take over from other languages. He really couldn’t come up with anything that he strongly dislikes and said that it’s really important to keep the language clean and simple so the newcomers to both programming in general and Python in particular would find it easy to use.
There were questions about the viability of alternative Python implementations and Guido said he really has no emotional attachment to CPython and he thinks alternative implementations are a great plan B for various cases, but it will certainly take a lot more time and effort for an alternative implementation to the reach level of quality where it can be used widely as a drop-in replacement for CPython. Mainly because there are just too many nuances that are really only “documented” by the actual behaviour of CPython.
He was happy that people finally think about alternatives for parallelism other than just getting rid of the Global Interpreter Lock.
Raymond Hettinger gave 2 talks on “Idiomatic Python” which where some of the best talks that I attended. Raymond talked about many things like:
– exceptions in Python are cheap so the meme that they should be avoided because of performance reasons that rose from C++ where exceptions are really slow, doesn’t hold in Python
– bound methods are a perfectly legal construct and shouldn’t be considered a hack
– how to optimize Python code (after you have made it stable of course). One of the main techniques was bringing often used functions from the global/builtin scopes to the local scope to avoid constant lookups through several namespaces.
– __missing__() special method that can be defined in your class that subclasses the dict class and is called when dict is accessed with array access syntax (a[foo]) and the key is not found. Whatever the __missing__() function returns is returned in this case.
– several interesting objects from the Collections module, for example named tuples and ordered dictionaries.
– there’s a math.fsum() function that should be used to add together floats, which doesn’t lead to huge cumulative rounding error like the sum() would.
There’s actually a page by David Goodger that bears the same name “Idiomatic Python” that is probably not connected to Raimond’s talks in any way but contains a lot of similar very good advice that I would have liked to get back when I started programming Python :-).
I also attended Raymond’s talk on Selenium testing which I was a bit disappointed at because it felt a bit like a commercial for his company’s Selenium-in-the-cloud testing product. Which admittedly looked good but I would have wanted to see something more technical.
There were several talks about alternative Python implementations like PyPy and HotPy. PyPy seems to be usable for some real world stuff now and has got a C module interface latelly. HotPy is fast but is purely a research project which means writing the boring but necessary stuff that is required for actually running most real world applications on it is not in the plans yet. Several comparisons also mentioned Google’s Unladen Swallow which can’t use all the optimizations that PyPy and HotPy use since they want to be strictly CPython compatible, but should work as a good drop-in replacement because of that and still promises up to 5* speedup compared to CPython on some use-cases.
One of the nice talks that I attended was given by Mark Dickinson about Python’s new float representation in Python 3.1. It produces more intuitive and repeatable results across platforms than the previous implementation. For example repr(1.1) will now return 1.1 instead of 1.1000000000000001 that was returned previously. Both are within the tolerated error range, but 1.1 is certainly more intuitive result.
This seemingly small change actually required adding more than 4000 lines of code.
The author was a bit worried that they actually made the float behavior too intuitive now so people new to it don’t understand right away that float is inherently unsafe for things that require great precision like financial calculations (you should use decimal in these cases).
The Talk about Shogun machine learning toolbox contained several interesting classifier demos and seemed easy enough so I will certainly try it out.
There was another talk by Tony Ibbs about kbus which is a communication system for Linux that provides a reliable and simple to use communication mechanism between processes on the same or even separate systems. Communication is handled by the kernel module and the bus is primarily intended for use in embedded systems (he works for an STB company). It can do both unicast and multicast messaging and messages have IDs so you can respond to a specific message and simply block until you get a reply or see that there can’t be a reply –Β because the conversation partner has died or lost its state because of a restart. The format of Tony’s talk was really nice too, basically all of his slides were small code snippets showing how to use the system.
On the 3rd conference day we had dinner which happened to be held at the same hotel that we were staying at so it was really convenient for us. We met some interesting people there but unluckily there was just too much noise in the dining room so it was hard to hear anyone else besides the person next to you. They were also gathering money for the PSF there and in exchange you could get shoulder massage if you wanted.
General notes
– In general the conference was well organized and the talks didn’t go overtime. Wi-Fi was awful for the first couple of days, but stabilized after it was split into 2 different SSIDs.
– Sometimes the abstracts weren’t enough of a guide to make a good decision about what to listen to since some speakers talked about completely different things. For example one talk should have been about the nuances and differences in various database libraries, but most of the time was spent on introductory stuff like why should you use a database in your application. One guy didn’t even have a talk and said he wanted to do a QA session instead. Someone proposed on the list that holding a short fast-forward session at the beginning of each day where each speaker gets 30 seconds to advertise their talk would help and it really sounds like a reasonable idea.
– Birmingham doesn’t seem to like tourists – we couldn’t find a map of the city anywhere in the airport or the train station. We actually asked from several bookstores in the airport and in the city and not only didn’t they have it – they were actually surprised of the question as if we were the first persons ever to ask for such a thing π
– There are many sharp contrasts in the Birmingham city architecture – examples of modern architecture are right next to houses that are probably more than a century old and have plywood over the windows. There are lots of old abandoned factories with trees and all other kinds of stuff growing out of the walls, roofs and smoke pipes. It’s kind of nice to see that nature always wins at the end π