Download it here. The bookmark sharing function uses del.icio.us as a web service ; I guess it's time to think about integrating Yoono in Flock, too, through the already existing web service interface.
BTW, I was asked to do a little bit of Firefox extension development for Yoono. Dude, this development environment is weird.
Javascript is kinda cool, not so different from Python in essence (but totally different in syntax, of course), but Python is way cleaner, especially its object/class/metaclass model which is totally integrated with the non-OOP parts. Anyway, I'm using more and more Javascript at the moment, and writing an HTTP server that runs in Firefox was fun.
The very weird thing in Firefox is the emphasis on RDF ; when you want to manipulate bookmarks, instead of a no-brainer bookmark API, you have to jump through a whole series of hoops with RDF, arcs and whatnot. Generally speaking, it looks like some parts of Firefox where over-designed, its developer wanting to use as much kool-words as possible (think XML, RDF, XBL, XUL, XPCOM GUIDs à la Microsoft, DTD). The net result is a mix of different languages, sometimes interwoven in the same document thanks to the usage of horrid-looking XML namespaces.
Of course, it's a nightmare to debug.
Digression : When I decided to stop following the xml-dev mailing list and worrying about XML, back in 2002, there was no way to properly define and validate a schema with built-in extensibility. For example, the buzz about XHTML is that you could make it extensible through the usage of foreign namespace, including MathML or SVG inside the XHTML document. Well, unless I've missed something, it's possible, but you won't find any validator that will validate both the XHTML part and the foreign embedded parts. That's why I stated, along with Eric van der Vlist, that XML doesn't deserve its "X" (good thing that I stopped xml-dev, years after I still get all angry and sweaty :). I even gave a speech a the Technoforum XML conference to debunk that idea, much to the deception of the people organising the event (they were expecting some kind of praising for XHTML).
Ahem, coming back to real life : yeah, it's a nightware to debug, because there is no way to check whether your XML or Javascript code is OK, except than by running it. At which point you have a choice of :
- Firefox crashes : OK, the XML or Javascript code is definitely no good. But you don't know where or why, just scrape your eyes and try to find it by yourself. Fortunately, Firefox decides to run is "safe mode" and deactivate your extension the next time you run it. Phew.
- (when you try to write XUL overlays) The Firefox UI is totally messed up. Somewhere in the UI you get a rectangle with the beginning of an
error message in red, but unfortunately since this rectangle doesn't have a scrollbar, the interesting parts (like the file name and line number where the error is) are not visible. Just edit your file, find the error by yourself and retry.
- (when you try to write handlers in Javascript) Your Javascript code seems not to work. Well, pal, it's probably because you have a syntax error in your code. That's right, a syntax error, silently ignored, which just make the Javascript interpreter stop parsing your source file, so a bunch of declaration are just ignored. The hint here is that sometimes the interpreter will complain in the Javascript console that some function is missing. Now you know that the error is somewhere above this function.
And the best part is that the whole edit/build extension/install extension/test cycle is a mess, because the install part cannot be automated, you have to manually uninstall the previous version of the extension (though I have found that it's not always required), drag/drop the extension file, wait TWO seconds in front of the confirmation dialog until you are allowed to click OK, close Firefox and restart it.
Now, I know that I have not gathered enough experience to have the proper tools at hand. It looks like there is a hack which allows automatic extension installation. And there is the Venkman Javascript Debugger which I could almost use. But hell, why must it be so darn medieval ? Maybe I'm spoiled now that I'm accustomed to having nice stack traces when something goes wrong, but even the Locomotive Basic on my Amstrad CPC 6128 gave me the line number of any syntax error !
That's all the more sad as the Mozilla platform is very interesting. It's a portable GUI platform with a lot of network components. It's quite fast, too, I mean, given the behemoth that it carries. The HTTP server I wrote in Javascript holds 200 requests a second, which gives you a hint about the quality of the Javascript interpreter and the underlying XPCOM objects. It's asynchronous (look, Pa, no threading !) and it's less than 100 lines of code (most of which have been cutted/pasted from the web and refactored a little bit, of course). XUL is cool once you've put your hands on a good documentation (I recommend the one from XulPlanet). And the platform will become independent from Mozilla with XulRunner. So I guess that this Frankenstein's monster is here to stay, and that I'd better get used to all its idiosyncrasies.
Coming back to Flock, I'm pretty admirative of the courage of these guys. I guess they experience all those annoyances daily. They're pros, so they must have come up with tools, best practive and all, but this musn't have been a bed of roses. Kudos to their team !