Skip to content

Unladen Swallow, a Hummer Hybrid?

One of the projects that I keep an eye on is LLVM. In a nutshell it is apple’s compiler strategy but is also “an aggressive
optimizing compiler system that can be used to build traditional static compilers, link-time optimizers, run-time optimizers and JIT systems”.
The guys behind it eventually want to replace gcc, and fwiw I think that they eventually will.
It seems that every language on the planet currently has someone experimenting with porting the language to llvm. This includes java and .net, ruby, python, and a very interesting use of LLVM to AOT compile flash so it can run on the iPhone.
The LLVM folks recently had their 2009 conference and I just got through watching the presentation on Unladen Swallow. Unladen Swallow is an attempt to get python to go five times faster by porting it to LLVM.  They also hope to be able to make it the default python compiler / JIT. They have made pretty good improvements so far, however they are running into all the problems inherent in making any dynamic language go faster, namely type inference. I’ve blogged about this before for Java and the unladen swallow presentation does a good job of explaining all the pitfalls around making a dynamic language go fast (hint, try and avoid all the indirections). So far Unladen Swallow seems to be trying to work out how to safely infer types for a host of things and it will be interesting to see how far they can get with this.
The sad state of affairs however is that none of the popular dynamic scripting languages really go very fast, they all consume a lot of CPU. I can’t help thinking that we are all effectively driving around in Hummers by using these languages. What Unladen Swallow seems to be trying to do is make a Hummer Hybrid, sure it consumes a little bit less gas than a regular Hummer but its still a Hummer and is fundamentally not designed to ‘sip’ gas. We need the programming language equivalent of the Prius or a Jetta TDI i.e. something that a lot of us would be willing to develop web apps in (i.e. not C++) as well as something that is CPU friendly.
The real question then, is whether there is a language or a set of languages that can ‘sip’ CPU while still feeling dynamic and programmer friendly. The closest I have found so far is boo. It’s a python inspired .net language that can run on mono. As the manifesto states the language has been explicitly defined for type inference throughout (as long as you don’t use duck typing). This should mean that most of the time it flies. At the moment this performance difference may not be that much of a big deal, but as we move more and more services to the cloud and as we consolidate to a few super cloud hosting organizations it is going to be a significant advantage to be able to operate a cloud with 10 or maybe a 100 times fewer servers than your competitors who are all hosting ‘Hummer’ like languages. Given the financial pressures and incentives it seems inevitable that we will all eventually be ditching our Hummers and discovering languages that are designed to ‘sip’ cpu. These ‘hybrid’ languages will probably honor the dynamic driving preferences that most web programmers have gotten used to over the last few years while making heavy use of type inference to provide static language like efficiency. Anyone want to port django to boo? :)

{ 6 } Comments

  1. Joel | November 10, 2009 at 11:10 pm | Permalink

    As a side not to the “boo” project IronPython is a much better project with a lot more name recognition than boo:

    http://www.codeplex.com/wikipage?ProjectName=IronPython

  2. Rob Yates | November 11, 2009 at 8:31 pm | Permalink

    @Joel, IronPython is still a hummer as it’s still python. Jim Hugunin has stated http://blip.tv/file/1947387 (in the Q&A at the end) that he doesn’t think you can do type inference with Python so it is stuck with a bunch of indirection.

  3. greatergreens.info | December 6, 2013 at 9:30 pm | Permalink

    I could assume that I would have ten web pages of 2MB each.
    They’ve specifically created various types of hosting plans
    dependent on their individual customers’ tailor-made desires and needs.
    The over two million domains hosted by Host – Gator make up approximately 1%
    of the world.

  4. vidéo fougueuse de | May 17, 2014 at 9:27 am | Permalink

    Quel hasard je comptais rédiger un petit article pareil à celui-ci

  5. cravenfireworks59. | June 24, 2014 at 3:54 pm | Permalink

    Je prends la peine de poster un commentaire dans le but de remercier l’administrateur

  6. cocotte fripouille | July 11, 2014 at 8:10 pm | Permalink

    C’est un vrai plaisir de lire votre poste

{ 1 } Trackback

  1. robubu : Google Go | November 12, 2009 at 1:12 pm | Permalink

    [...] Ask and you shall receive :) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *