Alex Payne is a writer based in Portland, Oregon.

since 2001, has served as his online home.

Liveblogging C4-[2]: Objective-J

Objective-J is a new language on top of JavaScript, recently open sourced, that aims to circumvent the slow-moving standards bodies and provide an easier, better way to develop rich applications for the web.

The speaker runs through some features. Objective-J is lightweight and interoperable with JavaScript. It has a runtime object model and supports message sending like Objective-C (and Smalltalk before it). They support categories, import statements, and will soon support optional static typing.

Cappuccino is a re-implementation of Cocoa for Objective-J. They’ve provided most of AppKit, many widgets, the event system, and more. The “NS” prefix common to Cocoa libraries, inherited from the NeXTSTEP days, is replaced by a “CP” prefix.

The speaker cautions that using Cap is very much an investment in “Cocoa-land”, and that the framework is new, incomplete, and complex. “We’re not very good API designers,” he says by way of explanation for borrowing so much from Apple. “We’re starting with the desktop. […] It’s a mistake to discount all the lessons of the GUI world.”

Next, a demo of porting a simple random number generator from a Cocoa application to a Cappuccino application. The speaker makes a series of small changes to translate several methods from Objective-C to JavaScript. Adding buttons to the application is a manual process, one that normally would be handled by Interface Builder. For the trainspotters, the speaker is editing in SubEthaEdit. A category is added to CPNumber to provide a cssString method. Once added, the demo works. Much clapping. Six minutes from Cocoa app to Cappuccino app.

Another demo: a Twitter client (woo). It’s not a lot of code, and we get a quick tour of it. Sadly, the demo doesn’t work.

al3x's Rules for Computing Happiness

Computing Simplicity, Minimalism, and Trust