Mozilla, four months later. A status update.

September 17, 2010

It’s 17 September which means I’ve been working for Mozilla for exactly 4 months now. I’ve been so fantastically bad about doing regular status updates — unlike some of my more disciplined colleagues — I thought this would make a good opportunity to do one. But since I’ll have to cover so much time, this’ll be fairly high level.

Firefox Sync

As I mentioned in a previous blog post, I joined the Services team at Mozilla, which is mainly responsible for the Firefox Sync infrastructure. Right now this entails

  • the Firefox Sync add-on and — as of Firefox 4 and Fennec 2 — core functionality which I work on,
  • the Firefox Home iPhone app,
  • the server backend (PHP for now, Python in the future),
  • and the database cluster

Even if my work mostly involves traditional Firefox frontend development, the whole infrastructure provides an fun mix of technology and our team an equally fun mix of skills and personalities.

When I joined the team was getting ready to release Firefox Sync 1.3, so for the first few weeks I mostly worked on improving the test coverage — a great way to get to know the code base. After the 1.3 release the priority was to get Sync integrated into Firefox proper. We reorganized the code base of the add-on code so that we could periodically merge the client library for Sync to mozilla-central where Firefox lives. The UI has been tightly integrated with Firefox’s UI: We completely revamped the setup wizard to simplify the sign up process, there’ll be a menu item in the Firefox menu (as well as the traditional menu bar) and an optional toolbar button for those who like to invoke Sync manually.

Landing Sync in Firefox proper has been a fun ride and with a few more 4.0 betas to come, it’s not over yet.

BarTab and the future of tabs

Ever since I’ve been hired I haven’t had much time to work on BarTab, or even read the bugmail I get for BarTab. Apologies to everyone who reported issues. They’re not forgotten, just on the backburner.

The good news is that at the Mozilla Summit a bunch of us sat down together and discussed tabs. Firefox Panorama, or my much humbler Vertical Tabs, is making it very easy to get lots and lots of tabs opened in your browser. The need for throttling the session restore workload was clearly recognized and is being worked on. It might even (secretly) support BarTab’s behaviour.😉

Fun with js-ctypes

JavaScript is undoubtedly an important corner stone of the Mozilla platform and I find its abilities amazing, not just within the browser. The js-ctypes library is a platform feature that was borrowed from Python. It allows platform (as opposed to web) JavaScript to load dynamic C  libraries and call their functions. We use it in Firefox Sync to interface with NSS, Mozilla’s crypto library and alternative to OpenSSL, without having to write glue code in C or C++ and to compile it for every platform we want to ship Firefox Sync on.

Much like with the Python equivalent, you first have to declare your types and functions for js-ctypes. This be a bit tedious as you essentially have to convert large parts of a header file to declarations in JavaScript code. You’d think it’d be possible to automate this… And it is!

Enter gcc-xml, an XML backend to gcc. It can parse files and spit out something like an Abstract Syntax Tree in XML format which you can the process. Though you can also cut out the middle man and use pygccxml, a small Python library that gives you pretty good object representation of what gcc-xml spits out. Thanks to that I was able to hack together a script that can walk through the header files of OS X frameworks and generate the corresponding js-ctypes declarations. See my “OSXTypes” project on github for the script, its output and a much shorter rewrite of the original Add to iPhoto example.

I’m sure this script can be refined. Making it work on other platforms with generic libraries, not just OS X frameworks, would be pretty cool… Other examples would also be awesome. Feel free to submit patches or even better, fork!

6 Responses to “Mozilla, four months later. A status update.”

  1. teohhanhui Says:

    Firefox Panorama will be useless without BarTab. Period.

  2. My main problem with js-ctypes isn’t function definitions (those are generally easily obtainable via Google/MSDN), but constant values. For some code I was porting to js-ctypes, to get constant values I basically had to write C programs printing them out.

  3. Alex Faaborg Says:

    You’ve done more in your first 4 months than some engineers do all year🙂 It’s awesome having you at Mozilla!

  4. You make it sound as if using the same declarations for compiled and scripted languages is novel…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: