Monthly Archives: June 2006

MozLab released

A few days ago I released MozLab. It’s the by-product of months of work with Mozilla and Javascript, where I recreated an enviroment to support the development styles I’m used to: strongly interactive and test-driven development.

By interactive development I mean that you don’t have to demolish a building and rebuild it just to see how a new table fits in your living room, and you don’t have to quit a program and restart it just to see if two new lines of code do their job. You just send those lines to your program while it’s running and they go live immediately. By strongly interactive development I mean that you can, to a point, even modify the building itself, not just its contents, without bringing it down and then up again.

MozRepl takes care of this. (Screencast here.)

By test-driven I refer to that (unhappily named) style of development, where you start by writing a small specification of your program using code instead of words. Then you write the code that lets the specification (itself a program) be executed without errors; then you write some more of the specification, then some more code to have the specification execute correctly, and so on. Your code turns out better because you wrote it with a continuous focus on what it’s required to do, rather than getting lost in the implementation, and you can re-use the specification later as a test suite to check whenever you make a change that the program still runs correctly.

MozUnit provides tools for this. (Screencast here.)

The rest of MozLab consists of libraries I wrote along the way, such as a ModuleManager that lets you load code on-demand from Javascript, instead of XUL <script> tag, and without mixing it with the current namespace. Or the finite state machine that I wrote about some weeks ago that puts some sanity back into the implementation of stateful network protocols.

MozLab seems to be doing well. While I’m writing this, its page at Mozilla Addons , where it was made available eight days ago, reports 647 downloads for the first release (thus no upgrades). If you write Mozilla or AJAX applications and want to give it a try, I’d be happy to hear your thoughts!