Gianduia vs. Flash

May 10th, 2010

Today, internet is full of stories about the Apple’s secret weapon that will kill Silverlight, Java and Flash once and for all… Again! Sadly this is becoming sort of a cliche (of everyone wanting to kill Flash) and it’s my second article in a row trying to give you a completely different point of view.

The mythical new framework is called Gianduia which relates to Gianduja a sweet chocolate containing about 30% hazelnut paste, invented in Turin by Caffarel in 1852 (wikipedia). I’m betting on a hazelnut reference in the logo once Gianduia is out!

Since early version of Gianduia is already deployed on some parts of Apple.com (here and here), I went to find out what exactly is it. Here’s what I found by digging through the available information and sources.

Gianduia is:

  • A client-side Model View Controller based framework in JavaScript 1.x
  • Cocoa (with CoreData) and WebObjects translated to JavaScript
  • Lots of OS X / iPhone / iPad style interfaces in your web browser
  • Targeted at building HTML5 web apps using Cocoa
  • Meant to unify multiple JS frameworks used by Apple into one piece

What it’s not:

  • A Flash, Java, Silverlight or any other “killer” – it’s just another JS framework running in your browser
  • Portable – it runs in the browser, but it needs XCode+Mac to compile from Cocoa.
  • Self sufficient – it relies on device or browser for delivering video / audio / interactivity to the end user

Gianduia’s direct competition:

So if it’s not the next “Flash Killer” what exactly is Gianduia’s purpose? The answer is simple: Apple are just trying to fix their own loose web application toolset and to put all components under a single unified framework. In this case however they will be competing with other JS frameworks out there such as:

Gianduia’s APIs

At the time of writing, Giandua’s main framework file is located here. Depending on requirements on each application, it would call and load multiple “modules” which appear to be sort of a descriptor files of an equivalent UI element or utility class in Cocoa, just written in Javascript.

For those of you who want to peek under the hood and check the inner workings of the framework, below is a list of some of Gianduia’s framework classes (links to Javascript files). Whitespace has been removed from JS files, but they uncompressed and still more or less readable.

You can see some really interesting stuff here like NSPersistentStore or NSBindingDeclaration, take a look:

Foundation

AppKit

CoreData

The Unusual

While browsing through the new API I noticed a new syntax which probably relates to Gianduia’s data binding features. The following bit comes from a script type="text/declaration" tag located in the head section of Apple iPhone reservation tool.

Maybe someone from readers could provide more ideas on what this code does? Do you think it’s a good approach?

[HTML]

[/HTML]

Impressions

I might be mistaking, but after playing around with the live demos and looking at the sources I think Gianduia is not meant to be written by hand rather than generated by a compiler – syntax is sort of unusual, hacky and difficult to read.

However even in this case Gianduia will have a slight edge over other JS frameworks due to the fact that it’s developed by Apple; This means if this framework ever gets released to the wild you can expect very tight integration with XCode and ability to choose “web” as a compile target for your next Cocoa application.

The dark side of this is the new language lock-in trend that starts to emerge – it seems that Apple wants everyone to write their code only with Obj-C in XCode, on a Mac and compile to other platforms, but not the other way around.

As far as the demos go, I was not impressed. What I saw was pretty basic and static web forms and still the UI components did not seem very responsive. I would really like to experience this framework integrated in a more advanced web application to test how well it performs handling difficult tasks.

Gianduia seems to have implemented a dependency model which results in chain-loading of framework components. At one point during my test of Apple iPhone reservation tool I had user interface frozen (with unresponsive inputs and no preloader) for 12.7s while the dependencies were loading in the background – that’s a bad user experience!

Conclusion

It’s shaping to be a nice extension for developers using XCode and a solid framework for building layout based HTML apps but we will have to wait and see if it’s anything more than that.

Just don’t put your bets on Gianduia killing Flash –

it just won’t happen.

Mediatemple.net DV4.0 Server

8 Responses to “Gianduia vs. Flash”

  1. joe Says:

    “I might be mistaking, but after playing around with the live demos and looking at the sources I think Gianduia is not meant to be written by hand rather than generated by a compiler”

    - It is written in an Objective-C like syntax which is then translated to Javascript code. What does this mean? Well if you are building Mac/iPhone/iPad apps and already using Objective-C then about 90% or more of your code can be reused to build a web version of the application.

    “syntax is sort of unusual, hacky and difficult to read.”

    - I am guessing you mean some other examples you’ve seen as the script you posted above was extremely easy to read to anyone familiar with Cocoa. Mind you the code you posted would have been generated and not written by hand so you are correct in that assumption. Although to be honest the script posted above looks cleaner than the majority of Javascript you see, maybe you are just unfamiliar with the Cocoa framework?

  2. joe Says:

    Oh I forgot to mention that you could also check out Cappuccino: http://cappuccino.org/

    It is very similar to what Apple is doing and I would be surprised if the people working on it aren’t offered jobs by the end of the year.

  3. Paulius Uza Says:

    @Joe thanks for the input.

    When I said “hacky and difficult to read” I was referring to the readability of framework modules and website scripts. The example I posted inline looks like a binding description, and actually *does not DO anything*… And yes, it does look a lot like Cocoa, but it’s totally alien to JS developers that are not familiar with Mac development.

  4. Paulius Uza Says:

    @Joe, Cappuccino is already mentioned in the article under “Gianduia’s direct competition”

  5. joe Says:

    Oh I know but I just meant for reference to how the JS would be generated as Gianduia will definitely uses the same route.

  6. John Dowdell Says:

    Thanks for the detailed investigation, Paulius.

    But even with a cursory examination, other bloggers should not have pumped this framework up into something it isn’t, just for the clickthrough effect of dramatic storyline. Dilger used a year-old tweet and got copycat posts. That’s more dysfunctional than any poorly-coded SWF could ever be…. :(

    jd/adobe

  7. Paella pan guide Says:

    Very inspiring article, Thank you !!…

  8. serp Says:

    Τhis іs the rіght webpage for anyone ωho really
    wants to find оut about this topiс. You
    know а ωhole lot its almoѕt hаrd to arguе with you (not that I personally
    ωill need to…HаHa). Yοu dеfіnitelу put a fresh spin on a subject
    whiсh haѕ been written аbout for
    a long time. Exсellеnt stuff, just eхcellent!

Leave a Reply