Monday 16 July 2007

A Penny Saved is a ...

Well, if you're one of the economists David Cameron is listening to, it's not "a penny earned" but "a loss to the economy"!

One of Cameron's  sillier policies is to extend copyright from 50 years to 70 years.  He claims that this would "add £3.3 billion to the economy".  Unfortunately, this is one of those nasty things: a penalty dressed up as a benefit.  Why?  Because actually the size of the economy is a measure of penalty to people, not benefit to people

In simple terms, it's obvious: the size of the economy is the sum total of cash leaving people's wallets!  If I keep an extra £1 in my wallet, the economy is £1 smaller.  Strangely, though, I feel £1 better off, not worse off because the economy is that little bit smaller...

So why is "growing the economy" normally seen as a good thing.  Well, usually it is an indirect measure of benefit:

Economists can't actually measure the benefit someone gets from something -- eg, a cup of tea -- directly.   (Nobody has yet invented the "aaah"-ometer.)  So instead economists have to assume the price you were willing to pay for that cup of tea is a measure of its value to you.  If you were willing to pay 20p, then you've presumably received at least twenty pence worth of benefit from it.  Market forces also help to make sure things balance up nicely.  And so the amount of money being spent in the economy is an approximate measure of the benefit people are receiving from the economy.  Usually.

But say the government issues a licence to Oxygen, Inc that allows them to charge £1 per person per day for the air we breathe.  Instantly the economy has jumped by £1 × 365 × 60 million = £21.9bn. But has anyone achieved any actual benefit? Well, no, the air is still exactly the same, it's just the public now has £21.9bn less to spend on other things.

So this is the problem: the economists assume "cost = benefit" and measured the economy accordingly.  But they can't measure the benefit of things you get for free.  So if the government makes something that would be free (eg: air, or 51 year old music) suddenly have a cost, it looks like the economy has grown (hurrah!) but all that has really happened is people are more out of pocket for no extra benefit (boo!).

Irritatingly, Mr Cameron seems to be going for the "look it'll grow the economy" boondoggle, hoping nobody will notice extending copyright is just taking extra cash from our pockets for no extra benefit.

Thursday 12 July 2007

Conditional approval...

Today I received the official letter from BoGS (that fabulous acronym that stands for Board of Graduate Studies) saying I've been conditionally approved to be awarded the PhD. "Conditional" is subject to giving them a hardbound copy of my thesis for the library, so it's not a very onerous condition...

Friday 6 July 2007

Google Web Toolkit (GWT)'s cunning plan?

Languages like Java and Python compile it to an intermediate semi-digested form called "p-code" or "bytecode". Google Web Toolkit (GWT) takes Java source and compiles it into cross-browser JavaScript. Effectively, GWT uses JavaScript as its p-code.

But how good is JavaScript at being a p-code? Probably not great, because it wasn't designed as one -- it was designed as a general purpose programming language. Programming languages are designed to cater for the fact that programs are written by people. So, they have lots of syntactic sugar and usability features. P-code, meanwhile, is never written by hand and so needs no usability features. P-code is something designed to be quick and easy for a virtual machine to interpret and optimise. (See any course on compilers for the sorts of changes compilers make when converting source code to an intermediate representation.)

If JavaScript was an efficient p-code language, and if the "virtual machines" for it (the browsers) were efficient, then GWT applications would perform as well as Java or .NET applications. And yet, GWT actually feels a little sluggish.

So how could Google get around this issue? Well, it's in a uniquely good position to introduce a new p-code into browsers: a proper intermediate representation of JavaScript. The new p-code would be put into Firefox first presumably. GWT would then include some code in the sites it generates to see if the browser supports this new p-code. If it does, it would ask the server for blazing fast new p-code; if it doesn't, it would ask for sluggish old JavaScript. And if GWT sites (like most of Google) were blazing fast on Firefox and sluggish on IE or Safari, it wouldn't take the other browser manufacturers long to say "we'd like some of this new p-code goodness too please".

And then Google would have moved some way towards their goal of the Web being their "universal application platform", rather than the slightly hacky, messy, not quite fit-for-purpose application platform that browsers have always been so far.

Of course all this is purely speculation...

Wednesday 4 July 2007

21 July

So I'm arranging to graduate (subject of course to the official result of my viva), and it turns out the next university Congregation is on 21st July, the day the final Harry Potter book comes out. Which just makes it slightly odd reading lines on the graduation forms about gowns and hoods and how academical dress can be hired from any robemaker in Cambridge...