Tuesday, January 17, 2006

Latest developments

Being featured in Google Earth gave me the energy to code some long overdue changes to Panoramio.

First, I put a common header in the user and photo pages, so that users can jump directly to their pictures, to the home page, and sign out / sign in easily. I remember Johan said sharing the header will improve the feeling of "being part of Panoramio" (the words are mine). I still have to find someway to integrate this header in the home page... I hope you like it, because I tried several ideas and I passed several hours in The Gimp to do it.

Now you also have RSS feeds in the user's page, so you can follow the photos of your favourite users from bloglines or your favourite aggregator. And speaking about favourite users, you can now add users to your favourites clicking on their star or add them using the input box in the right column if you are logged (Actually, I put the RSS feeds and favourite's users a while ago, but I have not blogged about it).

I also improved a bit the algorithm to choose the photos to display in Google Earth, and raised the number of photos downloaded when you stop over an area.

And something Eduardo was begging for a while, a way for people to spread the word about Panoramio. Now (only when logged) you will have in your right column a "show these photos to a friend" link. That will let you spa^H^H^H tell your friends how great is Panoramio.

On the bad news, you can see that when you use sign in / sign out / stars it works reloading the page, so the results are not as smooth as they can be. At first I had a full javascript solution working, but there were too many bugs. There are just too many things to coordinate to keep these 3 things fully in javascript, so by now I will let the server-side fallback do its job. Later I will javascriptize the stars (I don't think sign in / out are really worth the effort).

Well, I hope you like these things, because they sucked away my week-end and latest evenings (again!)

This evening I decided to code a bit on the javascript engine. I have fully finished variable instantiation now. It was not yet done, that why I was using that weird "var a = function fact(x) { ... }" instead of just "function fact(x) { ... }".

Now the TODO is starting to look reasonable...

  • Unicode support

  • Track correctly line numbers for errors

  • Human readable error messages

  • Fix string to number conversions

  • Handle efficiently big sparse arrays (firefox also has this bug)

  • toLocaleString is not just toString...

  • Build a pretty-printer and use it instead of the compressor for js_function_to_string

  • Fix arithmetic that uses uint32

  • Implement real objects for standard Errors (right now I'm throwing string objects)

  • Joined objects

  • Implement Array.prototype.concat and Array.prototype.reverse

  • Implement all the native objects, right now I only have Object, Function and Array (and their prototypes, constructors, instances, etc.). This TODO item is big.

  • Label sets support

  • New expressions (this is the last expression not yet implemented, probably just a few minutes to make it work)

  • Run the SpiderMonkey regression tests, cry and fix bugs

Well... it looked reasonable in my head.

New expressions are now fully implemented:

function test_constructor(a) { this.hello = a; }

var o = new test_constructor("world");

var st = "";

for (var i in o)

    st += i + " " + o[i];



"hello world"

Btw, do you know of any plugin to colorize javascript code in WordPress?