Monthly Archive for September, 2008

The First Annual JVM Language Summit

You know that a conference is good when you go home with a list of stuff that you never heard of but now need to go follow up on. The JVM Language Summit was exceptional in this regard. Sun provided a location and a few of the speakers, but most of the speakers at the Summit were not Sun employees, although there were a few Sun alumni amongst the speaker ranks. The topics that were discusssed went all the way from type theory (including the usual greekified type proofs), typical language design stuff, VM design, all the way down to discussions of how high allocation rates can cause hot data to get flushed out of caches on the bare metal. Slides for all the talks are available on the wiki for the conference, and some of the talks will have video at either InfoQ or YouTube. Here are some of my favorites from the three days.

Clojure

I’d been aware of Clojure prior to the summit and had looked at the page on Clojure’s use of persistent data structures, so I thought that I had some idea of what was interesting about Clojure. I was wrong. Rich Hickey’s 30 minute presentation on Clojure had a really large amount of information per unit time. By the end of the time I was really interested in Clojure, and I was able to find out a bit more about it by going to an open space session and by being at the same table as Rich during dinner one night. As and old Lisp guy, my usual reaction to Lisps on the JVM or CLR is why? They don’t typically fit in that well with the host VM, and there are great implementations of Common Lisp that can compile to very efficient machine code. I was looking forward to Arc, but that has turned out to be very disappointing. Clojure has taken a very practical approach to the Lisp parts of the language. It fits in very nicely with the JVM, is able to call Java code easily and has the potential to achieve very good performance on the JVM. Also, Rich has made a number of design decisions which improve the syntax (he showed a short program in both Python and Clojure, and they occupy the same amount of vertical space and have roughly the same visual density) of Clojure. He’s also generalized many operations that would have worked on lists to work on sequences, which really means any Java sequence type. Like many Lisps, you can supply data type hints, and the compiler will use those to make the program more efficient. There is a nice library of collection operations, which look very comparable (or better) than Python or Ruby’s facilities for collection types. There are some other really interesting data structures in the libraries, like bit partitioned hash tries and zippers.

Beyond the Lispish stuff in Clojure, there are a several interesting features in Clojure related to the problem of concurrency. In Clojure things are immutable by default, which is a huge benefit – a benefit shared by functional languages, and quasi functional languages like Erlang. Beyond that, Clojure supports persistent data structures as a way of managing state in a concurrency friendly manner. The idea is that “updating” a persistent data structure yields both the version before and after the update. This means that updates don’t impede readers of the old version, and are not blocked by readers of the old version.

Lastly, Clojure provides an interesting mechanism for utilizing Software Transactional Memory. Normally STM systems make all accesses to memory transactional. This makes the STM a bottleneck, and makes it much more likely that the performance of the STM system will be the limiting factor in a concurrent system. Clojure requires you to make uses of the STM explicit via its Ref structure. This yields a potentially much more controlled usage of the STM, which could help preventing the STM from being a bottleneck.

My original impression of Clojure was that it was still in the very early stages, but it seems to be bit further along that that. I was surprised by the size of the community, and by other parts of the ecosystem, like the tool support. There are several Emacs modes, integration with SLIME, and even a Netbeans plugin for Clojure.

I will definitely be giving Clojure a closer look, and I am not alone. There was a lot of energy in the room during and after Rich’s talk, and there was a burst of Twitter traffic during the talk. It’s pretty interesting to see the number of language geeks on Twitter.

Davinci Machine

If you’ve been following John Rose’s blog and Charlie Nutter’s recent writings on invokedynamic, you wouldn’t be very surprised by the content of John’s presentation on the DaVinci Machine Project. This is a highly important piece of work for non-Java languages on the JVM, so it was good to hear John tell a more complete version of what he’s been up to. It was also my chance to meet John in person. We somehow missed each other at JavaOne, so it was good to put a face to the name, and have some in person contact. John and Brian Goetz did a great job of organizing the summit, and John was always trying to find out what kind of features would be useful to JVM implementors. JSR-292 can’t happen soon enough.

Fortress

David Chase talked about the work that folks at Sun labs have been doing on Fortress. I never really paid much attention to Fortress, since they are really aiming at the scientific, high performance computing space, and that’s kind of outside of my interests. The Fortress guys are doing some interesting explorations as far as concurrency is concerned. In fact, David referred to Fortress as “infested with parallelism”. My todo item from the Fortress talk has to do with the work-stealing model that they have for concurrency. Apparentl this work is based on a data structure known as an ABP queue, so I’ll be tracking down the paper on that one.

JRuby

I’ve heard Charlie Nutter talk about JRuby several times, and have talked with him a little about JRuby. Even so, his talk on JRuby was really interesting, because he was able to go full out for an hour to a very sophisticated audience. I know from talking to some of the Jython guys, that there were a few aha moments for them, even though they’ve been to the same talks that I’ve been to.

Dynalang MOP

Attila Szegedi described his proposal for a MOP for dynamic languages. Once you start hosting a bunch of languages on the JVM (or any VM), then people start to ask if they can call code written in language A (say Clojure) from language B (say Python). The tough part is that the code in language A may have compiled to Java bytecodes in a way that doesn’t really resemble Java code, and you can end up in a situation where B can call A but does it by grabbing things which are really artifacts of A’s implementation. Of course, A’s implementors will continue to improve A, and in the process of doing so, might change the details. You can see what the problem is going to be. Attilla’s MOP would go a long way towards helping here. I hope that people will give it a serious look.

Gradual Typing

Jython committer Jim Baker has been after me about the work that Jeremy Siek (UC Boulder) has been doing on adding types to Python. His system is called gradual typing and allows a programmer to selectively add type annotations to a program. It’s a cool idea in principle, and I hope that it will end up being cool when it finally gets implemented all the way. I have to admit that the first time that I saw an annotated program, I had a violent reaction. There were a ton of angle brackets due to the type annotations. Jeremy and his students are working on ways the reduced the amount of notation that is needed. I hope that they’ll be successful — in Python at least, it’s going to be key to whether people will adopt it or not.

Fundamentalist FP

I’ve been an admirer of Erik Meijer‘s work for some time, so I was glad to be able to hear him speak in person. There was another talk on LINQ, so Erik didn’t talk about that. Instead he talked about what he called “Fundamentalist Functional Programming”, which is really just the functional programming that the old school functional programming people have always talked about. I think that Erik is concerned about the amount of lifting of functional programming ideas and idioms, without a full understanding of the essence of functional programming. His presentation style is very entertaining. The major thrust of his argument was that for the past 50 years of computing, we have been abstracting, but abstracting over the wrong things. He asserted that the thing that we really need to do is to abstract over evaluation order. Given the coming many/multicore world, this is understandable, but don’t think that I agree that all the other lessons that we’ve learned about abstraction are invalid. He provided the simplest explanation of monads that I have ever heard or read, as well as showing how to handle things like object creation and process creation monadically. In the end, though, his talk reduced to the essentials of lazy pure functional programming.

Bytecodes for fast JVM’s

Cliff Click asked that JVM language implementors send him an implementation of a particular program written in their language. Cliff then ran those programs (in their respective languages) on Hotspot and on the Azul JVM. His talk was a report of his findings as to what was keeping various languages from getting the best results on the JVM. He said that he wasn’t trying to compare the merits of one language versus another, but more to give the implementors insight into what was up with their code. I found this talk to be tremendously interesting because Cliff really knows the guts of HotSpot and because he was able to be very specific about what was causing problems for the various languages.

Parrot

I’ve known Allison Randal for several years now, mostly via her organizing of the FLOSSFoundations meetings that happen every year at OSCON. In all that time, we’ve never really sat down and talked about her work on Parrot, and it’s been several years since I heard a talk on Parrot. I give John and Brian a lot of credit for inviting Allison to come and talk about Parrot. The architecture of Parrot is very unlike either the JVM or the CLR. They started with very different assumptions and goals, which unsurprisingly lead to a different design. As far as I can tell, Parrot is looking reasonable on the performance front, will be able to use the C libraries of Python, Ruby, PHP, etc, without much hassle, and will have a good story for interoperability between hosted languages. Control flow is modeled using continuations which means that continuations are really cheap to create. Allison also talked about what a different method of doing call site caching – Parrot does the caching in the Parrot class object, not in little caches strewn all over the call sites. This makes it easy to invalidations the cache when the class hierarchy changes, for example. I’m still trying to digest all of what I heard, as well as the conversation that several of us had with Allison after her talk.

The Parrot team has been lying low and working away on Parrot, and they are definitely making progress. Allison showed some very preliminary benchmarks of the incomplete Python, Ruby, and PHP implementations on top of Parrot versus the C based versions. She told me afterwards that the project has reached the point where they are working to time based milestones, and that they are hoping to do a 1.0 release early in 2009. Chalk up another to-do.

Random Thoughts

There aren’t any pictures to go with this report because I was not motivated to take any. There were several people snapping away quite frequently during the conference, and I didn’t want to add the slaps from the D3 to the cacophany and the flash light show.

It seems clear to me that many folks share some of the same problems, and I hope that on result of the summit will be that people will start to work together when it makes sense. I know that the Jython and JRuby folks are working in that direction, and it seems likely to me that there will be some collaboration around the dynalang MOP as well. There was a lot of good energy in the room: people were very respectful and curious about other people’s work.

I think that the only regret that I had was that this was the first annual JVM Language Summit. Imagine where we’d be if this had been the fifth…

Update: finished the sentences about persistent data structures in Clojure

Book Review: Learning Website Development with Django

The folks at Packt Publishing sent me a copy of Learning Website Development with Django by Ayman Hourieh. It’s a fairly thin book, weighing in at just 243 pages, but it it is a very good introduction to Django. Knowledge of Python is assumed, so if you need that information, you’ll need another book. Hourieh uses a running example, a social bookmarking application, throughout the book. This means that he is adding features to the application in each chapter, which is a style that I like because it shows how to use Django to build up a decently featured application piece by piece. There is lots of code, which I found easy to read, except for some places where the bold facing of new code was somehow omitted.

The only problem with the book was that it was finished before Django went 1.0, so there are undoubtedly some places where things are not quite in sync with Django 1.0. Hourieh did make an effort to deal with some of the largest 1.0 changes, like newforms, but omitted other like Unicode support. This is inevitable when the book and software are not in sync, but since Django only went 1.0 a few weeks ago, the only documentation that is completely up to date is the official Django documentation itself.

If you know Python and for some reason have been holding off on learning Django, this is a good book to help you get started. There is also an e-book version available via Packt’s website.

PyConUK 2008

I am slowly recovering from the transatlantic flights for PyCon UK, so I think that I’m ready to give a report.

The conference

PyCon UK 2008

In Europe, at least, the Python community seems to be sprouting more regional conferences as opposed to having the single EuroPython conference. This probably makes it easier for people to get to a conference, but it also means that people like me have to travel more in order to attend all these meetings. PyCon UK, also takes place over a weekend, again to facilitate people being able to attend without the hassle of getting time off from work and so forth. The conference was roughly the size of EuroPython, with attendance in the 230-250 range.

As usual, I did some of the regular program and some hallway track. The top three talks that I went to were Jacob Kaplan-Moss‘s update on the new stuff in Django 1.0 (that’s Jacob in the picture above). Chris Withers did a good talk on the problems with Python package management. The basic answer there is that a lot of stuff layered on top of a shaky foundation, in this case, distutils. Chris discussed some (partial, in my opinion) solutions to the problems, the virtualenv and buildout packages. Perhaps one day there will be a really good solution. Micheal Sparks from BBC research described the Kamaelia project, which includes a Software Transactional Memory (STM) module. I am neutral on the benefits of transactional memory, so I am glad to see that someone in the Python community is exploring how STM might fit with Python. Slides for some of the talks are being posted on the conference wiki. In the hallway track, I attended a BOF for Python Bloggers, and a PGP keysigning. I also had some excellent extended conversations with Holger Krekel and Maciej Fijalkowski of PyPy, Adewale Oshineye from Google, and Michael Foord from Resolver Systems.

I was invited to give one of the two keynotes for the conference, and my topic was “Challenges for Dynamic Languages”. I tried to step back from the specifics of Python and look at some of the challenges that face all of the dynamic language communities if we want to gain broader adoption of dynamic languages. I was somewhat concerned when Mark Shuttleworth covered some of the same topics during his keynote the day before, but maybe it’s a good sign when people from two different organizations and backgrounds can come to similar conclusions about the future of Python and related languages. My presentation is very picture oriented, without a lot of text or bullet points, so I am not sure whether posting the slides will actually help anyone or not. This was my first time giving a keynote, and it seems like it was well received, despite some laptop/projector interaction problems. Thanks to Jacob Kaplan-Moss for saving the day by lending me his MacBook Pro, remote, and memory stick.

Travel

PyCon UK 2008

This was my second transatlantic flight since June, and it seems that I really can’t sleep on long airplane flights. This turns the 10 hour flight from Seattle to most Star Alliance hubs into a pretty long ordeal. I did manage to finish a book and read a few papers, but I spent way too much time using the in flight entertainment system (I prefer Lufthansa’s to SAS’s). I also experienced my longest wait (1 hour) in passport control in the Birmingham airport. During that wait, I listened to the two American women right in front of me discovering that each of them was moving to the UK to marry an Englishman. Ten people or so before I reached the inspectors, a passenger collapsed in an epileptic fit (no previous history apparently), just to make sure things were memorable.

I was only in Birmingham for two and a half days, and spent almost two days inside of airplanes. Several people commented on the jet lag, which didn’t seem that bad until it caught up with me when I finally arrived home.

Photography

Photographically, perhaps the bigger story is the pictures that I didn’t get. The D3 does not fit in my camera/computer bag with a lens mounted on it, which means that it is hard to get shots where you just need to pull the camera out, point and shoot. I had a flight leg from Seattle to Frankfurt, and on the Frankfurt end we took busses from the airplane to the terminal. While we were waiting for all the passengers to board the bus, I realized that I was staring at a great view of the rear left quarter of an Airbus A330-300. Perfect for a wide angle shot, but there wasn’t enough time to get the shot.

When I arrived on Thursday, I went over to the Pycon UK social, had some dinner and hung out. I left a little early when the noise level got to be more than I could handle. As I was walking back to the hotel, I saw some beautiful artwork that was being projected on the side of a building in Paradise Circle as part of Birmingham’s Light Night and Artsfest. I had left the camera at the hotel because I didn’t want to have to haul it around, but I was so taken with the display that I went and picked it up. Here’s some of what I saw:

PyCon UK 2008

PyCon UK 2008

PyCon UK 2008

This is a shot as I walked back to my hotel via one of Birmingham’s canals.

PyCon UK 2008

Here‘s the rest of the set. There are not many pictures of the conference proper — I go to a lot of conferences now, and I’ve shot enough pictures of people sitting in rows or giving a talk. There’s an entire group on Flickr for PyCon UK if you want better coverage of the conference.

Get Windmill

If you are working on web/AJAX based user interfaces, you owe it to yourself to go and check out the Windmill web testing framework/tool. Windmill was originally developed at OSAF for testing the very AJAXy web front end of Chandler Server. Adam Christian and Mikeal Rogers, the core developers of Windmill, have gone on to other efforts, but Windmill lives on. In fact, this summer, Adam was fortunate enough to land a job where he is able to spend significant amounts of time working on Windmill. That effort has paid off with the latest version of Windmill, which should be ready for serious use. It’s got a bunch of cool features, including nice integration with Firebug Lite.

News sweep

I’ve managed to go the entire month of August without a post, due to a combination of travel, family activities, and vacations. So here’s a sweep of some of the things that I would have covered during that time.

1.0′s

The Chandler Project – Chandler has gone 1.0, so if you were put off by the version number, you can take it out for a spin. There are some good posts on the Chandler blog that describe how people are using it.

Django – Just today, the Django project had its 1.0 release. This is pretty important because there were a lot of changes in the subversion trunk that weren’t in the packaged builds. That’s all be done away with now. I expect that this will lead to even more Python webapps.

Tools

DTrace – DTrace is 5 years old today, and Bryan Cantrill has a good war story from that time. It’s amazing to me that something as good as DTrace can be around for 5 years, and still be relatively unknown. If you are on Solaris, OpenSolaris, or Mac OS X, go check it out.

Ubiquity – Ubiquity is like Quicksilver integrated into Firefox. It’s emphasizing the natural language aspects of that kind of interface. There’s also pretty good documentation on how to build additional commands, which is really important. There are extensions for Quicksilver, but there aren’t a lot of them. There are already a lot of third party Ubiquity commands. I really wish that Ubiquity could talk to other applications besides Firefox, but there are pretty nasty security problems down that path. Some of the commands are very Google oriented, like the mail and calendar, which makes it less useful for people like me who are still using desktop applications. In an event, I think that this is worth watching carefully. One unintended side effect might be additional pressure for page/application authors to embed machine-readable content (yes, that you, microformats, at least in part) into more pages. We’ll see.

Chrome – There’s a lot of buzz about Google’s Chrome browser. Since it doesn’t run on the Mac, I don’t have much to say. I’m not about to install Windows or fire up VMWare just to run a browser. One day the Mac port will be done, and then I’ll have a look. I am encouraged that the development team is doing a real Mac native experience.

Dynamic Language Runtimes

It’s been exciting to watch the progress in JavaScript runtime engines over the last few weeks. First there was Mozilla’s TraceMonkey, which is a tracing based JIT, which delivered some very impressive speedups, despite the fact that it still has cannot deal with recursion. As part of Google Chrome, a team lead by StrongTalk/HotSpot lead Lars Bak has done a JavaScript JIT called V8, which is also turning out some very impressive numbers. And of course, the SquirrelFish engine for WebKit was turning in pretty good numbers a few months back. This is great progress for JavaScript — it’s less so for the web because of the variety of deployed browsers. It’s exciting to watch the various JavaScript runtimes leapfrogging each other. It gives me the sense that JavaScript is really making some serious moves on the performance front. Of course, none of these folks are comparing their execution times to C or C++. I’d like to see those comparisons as well. It’s also great that all three of these engines are open-source, so that implementors of other languages can evaluate the internals of these VM’s. I’d love to see this kind of leapfrogging in the Python and Ruby communities.

Cameras

I’m not as interested in the camera body arms race as I once was. The Canon 50D is an upgrade of the 40D, but I’m not really sure that more pixels is better. The telltale feature on the camera is the autofocus system, which hasn’t been given much of an upgrade. That signals to me that the 5DMkII will not be the all out upgrade that many are hoping for, but what do I know? The Nikon D90 sounds cool if you want to shoot video. I have enough problems with still pictures.

I am interested in the Nikon P6000, point and shoot, but I am seriously annoyed by the NRW proprietary RAW file format for the camera. Everything about the camera seems awesome, especially the ability to do off camera flash, both iTTL and manual. The RAW thing is going to be the determiner for me. I won’t buy one unless there is Lightrooom/Adobe Camera Raw support for the camera. OS X native support wouldn’t be bad either. As a new Nikon owner, I am unimpressed by the NRW decision.

Travel

September is a heavy travel month for me. I will be in Birmingham, UK for PyCon UK, from Sept 12-14, and I’ll be at the JVM Language Summit from Sept 24-26. As always, stop by and say hello if you will be at one of these events.