O'Reilly Network    
 Published on O'Reilly Network (http://www.oreillynet.com/)
 See this if you're having trouble printing code examples

Mozilla as a Development Platform: An Interview with Axel Hecht

by Edd Dumbill

Author's note: Axel Hecht is a member of Mozilla Europe's board of directors, and a major contributor to the Mozilla project, working on XSLT and RDF, among other things.

At O'Reilly's European Open Source Convention (October 17-20), Dr. Hecht will be talking about Mozilla as a development platform. O'Reilly Network interviewed Dr. Hecht to find out if the long-held dream of Mozilla as a development platform was about to come true.

Edd Dumbill: You're speaking about Mozilla as a platform at Euro OSCON. We've heard Mozilla presented as a platform for years, but it's never really happened properly. Why now?

Axel Hecht: Actually, I got involved with Mozilla back in 1999 when looking for a toolkit. Not that it actually was one back then, of course. It's really hard to find out which code is part of your platform and which code is part of your application, if you just have one platform and one application. With the shift of focus from the Mozilla Suite to the independent programs Firefox and Thunderbird, with Sunbird in the queue and of course Nvu, there is a much better testing field to find out which part is platform and which part is application.

On top of that, we still have to compete with software that most users have readily installed on their computer as it is delivered, so download size is a big argument. Thus factoring out the application-spanning parts and collecting them out into a platform, that we actually ship as a product, is a natural step and required to make Firefox and Thunderbird even better.

Axel Hecht
Mozilla as a Development Platform

O'Reilly European Open Source Convention

O'Reilly European Open Source Convention
17-20 October 2005
Amsterdam, The Netherlands

ED: Are there any recent technical changes that have helped Mozilla become a more viable platform?

AH: There is a considerable amount of energy going into XULRunner these days. This is the platform that we will port our applications to. We are going to start with Firefox, but there are already people actively using the IRC client Chatzilla as an XULRunner application. XULRunner will include Gecko and a set of other modules usable for application creation.

Writing an XULRunner application is as easy as writing a few text files, there is no compilation involved and for the most part, you don't have to ship any binary code besides XULRunner itself. Applications can readily use the localization support, theming, and even the extension manager and its back end. We already provide XULRunner nightlies, so people can test it.

Another semi-technical change is the growing amount of documentation on Devmo. It's wiki-based, and set up to support multiple languages. This is quite a big change for Mozilla to become a viable platform. If you're interested in XULRunner, I suggest you read the "Toolkit API" section. But there are more resources; XULPlanet is going to move its content over to Devmo, so there will be XUL and XPCOM references. There is an updated version of the old Netscape DevEdge content there, too, so you can check out the JavaScript guide and reference.

ED: We know Mozilla has a GUI toolkit in XUL, but what about the rest of the services that make a platform? Can you tell us about IO, networking, and databases?

AH: Anything you need to write an application is included in our platform. We need that, because we're writing applications ourselves. IO and networking work pretty similar for the most part. Using "necko," our network library, is commonly the best way to do IO. One of the cumbersome parts in IO is Mozilla's preference for asynchronous IO. Most people don't think that way, but I can only suggest you do use asynchronous IO whenever you can.

With respect to databases, I'm not the most proficient guy to talk about it. That said, there is mozStorage, which is based on SQLite. There is extensions/sql in the CVS repository, which has code to talk to SQLite, MySQL, and PosgreSQL, but that's not actively maintained and won't be part of XULRunner.

ED: Does programming for Mozilla mean we have to use JavaScript?

AH: No, you can use any language that has an XPCOM binding. I know those exist for Python, Perl, and Java. Mozilla itself is written in C++ and JavaScript. Our scripting security model is bound to JavaScript, though, and nice features like interface flattening are only exposed to JavaScript right now. There is ongoing work to enhance the support for other scripting languages such as Python. More information on the progress of this work can be found on the wiki and the bug reports linked there.

ED: Can Mozilla-based programs access legacy code bases (like P/Invoke in .NET or JNI in Java)?

AH: Any code that you can access from C++ can be used. There are a few places in Mozilla code that actually do that, for example to check for particular graphics libraries to be used by the SVG code. Of course, if you do, you should make sure that you fail gracefully if the library is not installed on your user's system.

ED: It's often said that cross-platform UI is impossible to get properly right without making special cases for each OS. For instance, most OS X users know about Firefox, but most still seem to choose Safari. Is the cross-platform UI thing an issue in the real world?

AH: Don't all of those use Camino? Ok, seriously, yes, it is an issue. You will actually find UI differences in the upcoming 1.5 releases of Firefox and Thunderbird. Our UI is written in XUL, but we moved away from using the plain source and instead preprocess quite a few of our files.

On the one hand, this reduces code size, as we strip license headers, for example. On the other hand, it enables us to do platform-specific adjustments to the UI, mainly the Mac. Josh Aas is working full time to improve our Mac experience, and you'll see quite a bit of improvements in this area.

ED: Will we see Mozilla-targeted programs able to run on mobile devices?

AH: I have seen Mozilla code run on mobile devices. There are occasional screen shots (with digi cam) on the blog of Doug Turner, and we had a live demo at the FOSDEM 2004. The project that does this is called "Minimo."

ED: Is programming for Mozilla still something for tomorrow, or are real businesses using it today?

AH: There is an interesting page on mozdevgroup.com about their customers. IBM is paying Mozilla contributors, and is actually contributing the XFORMS plugin. Google pays a few Mozilla contributors, too. I have read about Yahoo hiring XUL hackers. I don't have more than an educated guess to offer here.

ED: What would you recommend people who wanted to get started with writing applications for Mozilla to read or do?

AH: Go for a read on Devmo. The XUL tutorial (of XULPlanet fame) is worth a read, just as is the Toolkit API section. Download an XULRunner nightly and look at the simple example it ships with. Find a simple application that you want to do and start from there. You can even make your XULRunner application work as a Firefox extension at the same time.

ED: Are there any IDEs for working with Mozilla, or other programming aids?

AH: There have been efforts on and off to create such for years. Right now, there are a few efforts going on again, and I'm a tad more confident that we can come up with something than I was before. Partially, because I work on one of those efforts myself. I favour reusing the IDE backend that Eclipse provides. This is cumbersome to some folks, because Mozilla is supposed to be a platform itself. But an IDE is so much more than that, just the support for versioning systems, editors, highlighting, completion, and so on. I consider writing an IDE on top of the Mozilla platform as a "Joel-on-Software" yourself. There are different approaches flying through the blogsphere as we speak, but I do see good chances to merge those efforts. I hope to have concrete news for my talk.

ED: What attracted you to working with Mozilla?

AH: As I said above, I was looking for a toolkit, cross-platform and free. I was working on a beefy multi-processor 64-bit Sparc machine at the time, which was the number-cruncher of our institute. (A mathematics institute, by the way, completely unrelated to open source software.) So I tried to compile Mozilla, with heavy parallelism, and failed. With much help of Chris Seawood, I filed and fixed a bunch of build bugs, then started working on the build for our XSLT module, became a "peer" on that module and stuck. A typical open source story, I guess.

ED: What's the most exciting feature of Mozilla for you?

AH: The community. I started the European Developer Meetings in Europe back in 2000, and have been involved in the organization of the yearly meetings ever since, to some extent. I'm a member of the board of Mozilla Europe. And it's really the people I'm working with that make it worthwhile.

Our product quality would be nowhere without the huge amounts of testers, who beat our nightly builds around the bushes. We couldn't make a lean and small UI like we did for Firefox and Thunderbird without an active and passionate community writing extensions. When it comes down to product adoption, we would be nowhere without the community and its viral marketing.

Mozilla here is really the Mozilla project, and that doesn't have a clear boundary. From core hackers working full time, to passionate volunteers working just as much as occasional hackers, to localizers, to testers, to users, down to moms, dads, and neighbors just trusting that kid. All of them passionately contribute the best they can offer. Sometimes it's producing some tough heat, but most of the time, it's just cozy "love and understanding," to quote Jimbo Wales.

ED: Which applications would you most like to see for Mozilla?

AH: Looking at the applications I have in mind, and the applications I have seen during the years at FOSDEM, I'm not the right guy to ask. We had Alex Fritze from Crocodile Clips at the time using XBL and SVG to create math applications for schools. Then he created XTF to make that perform well, which is now part of the Mozilla platform and used by the XForms plugin. We saw demos of Minimo. We have seen web applications based on Mozilla and some server editing of Microsoft Office file formats.

I feel quite comfortable with trusting you guys to come up with great applications; I'll focus on coding for Mozilla, and making development with Mozilla easier and easier.

Edd Dumbill is co-chair of the O'Reilly Open Source Convention. He is also chair of the XTech web technology conference. Edd conceived and developed Expectnation, a hosted service for organizing and producing conferences. Edd has also been Managing Editor for XML.com, a Debian developer, and GNOME contributor. He writes a blog called Behind the Times.

Return to the O'Reilly Network

Copyright © 2009 O'Reilly Media, Inc.