Objective-J & Cappuccino

7 September 2008, 12:32, by simon

This may be an unusual first post in my Objective-C and Cocoa categories however it is quite relevant as the guys behind 280 Slides have released a new open source extension to the Javascript language known as Objective-J and a new Javascript framework based on Cocoa named Cappuccino.

Other than having a very nice logo designed by the guys at Sofa my first impressions are they have implemented Objective-C in javascript. To me this seems an unusual choice as I can’t image there are that many developers (within the web development industry) who are that familiar with Objective-C. Maybe I am wrong, certainly with the current gold rush to develop for the iPhone this will increase. I must admit I have been toying with Objective-C recently and once I got the hang of the syntax am really starting to enjoy it. So maybe there is method to their madness?

The Cappuccino framework has been likened to the recently released (and overhyped in my opinion – seems slow and clunky to me) SproutCore framework. However I am extreamly impressed with how quick 280 Slides responds to user interactions and in addition to this the set of controls provided with Cappuccino have a nicer OS X quality to them.

My personal opinion is that the future of Rich Internet Applications does not lie with Javascript (though I am biased to Flex). It is not that I dislike Javascript, quite the oposite in fact. My reservations mainly lie in Javascript relying too heavily on the HTML DOM and is at the mercy of browsers and their stakeholders (for which there are too many). One of the nices things with technologies such as Flex and Silverlight is the cross browser consistency. Not only this but also the many rich media features such as image manipulation & processing, the ability to do advanced animation including 3D animation, video features etc. which to me put the Rich in Rich Internet Applications.

I may well eat my words as two major players in the form of Apple and Google are backing Javascript as the future standard for RIA development. Google’s Chrome browser addresses some of the performance and stability issues and Apple has recently based it’s online MobileMe business on Javascript (aparently using SpoutCore) as well as introducing new extensions to Javascript such as the Canvas tag that help overcome some of Javascripts shortfalls.

One thing is sure I take my hat off to these guys for pushing the boundaries of Javascript and in particular for implementing Objective-C in Javascript. If you are an Objective-C developer, it is well worth a look as you will be able to quickly develop javascript web applications using a near identical language. If not, check it out anyway. These guys can certainly claim that this is Cocoa for Web Development.

Update

I wanted to include a couple of code snippets (taken from Cappuccino.org) just to illustrate how similar to Objective-C, Objective J is.

In Objective-J classes are declared much like an Objective-C header file:

@implementation Person : CPObject
{
   CPString name;
}
@end

Methods are declared using the identical Objective-C syntax:

- (void)setName:(CPString)aName
{
	name = aName;
}
- (CPString)name
{
	return name;
}

And class methods can be called using a once again similar syntax:

[myPerson setJobTitle: "Founder" company: "280 North"];

Cocoa Master Scott Stevenson has done a nice comparison between Cocoa and Cappuccino, well worth a read..



3 comments below:


it’s simple : javascript is a very elegant syntax : dynamical and all

but objective-C has many features making Cocoa possible. cocoa is a really good mvc framework to create application

so, the main quality of “cappuccino” is the Framework, NOT the language, not “objective-J”, objective-J is here to make possible the recreation of Cocoa : cappuccino but it’s not the end. The end is a “web Cocoa” aka Cappuccino.

-
the javascript (and so whatever framework you want, sproutcore or cappuccino) is efficient, but it’s of course constrained by the browser

and that exactly where HTML 5, apple, mozilla, opera and now google are changing.

Canvas, local storage, many networks services, efficient execution, security and so on. More and more, the webbrowser is, from start, able to do what “external plugins’ was doing .

but with a plus : real control by the browser, real-time DOM manipulation, real desktop os integration, no more “black box” plugins (as Google explains they hate in their google chrome comics, simply old complains of webbrowsers developpers)

-
In the end, the browsers will be the platform, javascript its langage, frameworks the api.

-
flex is the baby of one company
silverlight is the baby of one company

it’s not good. it’s not efficient. it’s dangerous to build a business on it. and there are older stories to remind that.

Comment by oomu — 8 September 2008 @ 14:40

Oomu,

I certainly agree about your comments regarding flex and silverlight’s proprietry standings and this is a real strength of Javascript! The future is intersting and not being tied to any particular technology I look forward to what it holds… Thank you for your comment

Comment by Jon — 8 September 2008 @ 14:51

The thing I object to about the ‘browser is the new platform’ is that when it comes to desktop or server development I have a HUGE choice of languages, and one that grows with each year.

On the browser, we have . . . JavaScript.

On positive news it looks like Mozilla at least are interested in client-side support for Python and Ruby on the Tamarin VM, as is Silverlight on the DLR, but of course fragmentation is useless.

It’s not that I completely dislike JavaScript (JavaScript The Good Bits is an interesting read) but that lack of choice is bad.

Comment by JulesLt — 10 September 2008 @ 23:30

Leave a comment

About simon

Simon comes to Go Tripod after nurturing two other successful software businesses. He knows the industry like the back of his hand and is the man in charge of traversing the country and shaking hands to bring in the big bucks, but when he sits down at his desk his technical skills come out to play. Food, drink, his kids, his beer, the dog, the wine, and the social high life – Simon works hard and plays hard.

Go Tripod Ltd

Go Tripod Ltd is a UK-based development company working with some of the most exciting software technologies around. Simon Ashley, Jon Baker and Colin Ramsay are the brains behind projects such as Stubmatic, and are developing bespoke web, mobile and desktop software for clients with household names. We believe in good service as well as good software, and we’re eager to work with people who feel the same.