<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uza&#039;s Blog - Adobe Flash &#38; AIR &#187; Javascript</title>
	<atom:link href="http://www.uza.lt/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.uza.lt</link>
	<description>Adobe Flash &#38; AIR, JS, AS3, Unity3D</description>
	<lastBuildDate>Wed, 09 Mar 2011 21:34:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Gianduia vs. Flash</title>
		<link>http://www.uza.lt/2010/05/10/gianduia-vs-flash/</link>
		<comments>http://www.uza.lt/2010/05/10/gianduia-vs-flash/#comments</comments>
		<pubDate>Mon, 10 May 2010 01:16:03 +0000</pubDate>
		<dc:creator>Paulius Uza</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[AppKit]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[CoreData]]></category>
		<category><![CDATA[Foundation]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Gianduia]]></category>
		<category><![CDATA[Killer]]></category>

		<guid isPermaLink="false">http://www.uza.lt/?p=379</guid>
		<description><![CDATA[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. [...]]]></description>
			<content:encoded><![CDATA[<p>Today, internet is full of stories about the Apple's secret weapon that <strong>will kill Silverlight, Java and Flash</strong> once and for all... <strong>Again!</strong> 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. </p>
<p>The mythical new framework is called <strong>Gianduia</strong> which relates to Gianduja a sweet chocolate containing about 30% hazelnut paste, invented in Turin by Caffarel in 1852 (<a href="http://en.wikipedia.org/wiki/Gianduja_%28chocolate%29" target="_blank">wikipedia</a>). I'm betting on a hazelnut reference in the logo once Gianduia is out!</p>
<p>Since early version of Gianduia is already deployed on some parts of Apple.com (<a href="http://concierge.apple.com/reservations/R002" target="_blank">here</a> and <a href="https://iphone-reserve.apple.com/WebObjects/RPRCustomer.woa/wa/buyiPhone?lang=en&#038;country=CA" target="_blank">here</a>), I went to find out what exactly is it. Here's what I found by digging through the available information and sources.</p>
<h2><strong>Gianduia is:</strong></h2>
<ul>
<li>A client-side Model View Controller based framework in JavaScript 1.x</li>
<li>Cocoa (with CoreData) and WebObjects translated to JavaScript</li>
<li>Lots of OS X / iPhone / iPad style interfaces in your web browser</li>
<li>Targeted at building HTML5 web apps using Cocoa</li>
<li><strong>Meant to unify multiple JS frameworks used by Apple into one piece</strong></li>
</ul>
<h2><strong>What it's not:</strong></h2>
<ul>
<li>A Flash, Java, Silverlight or any other "killer" - it's just another JS framework running in your browser</li>
<li>Portable - it runs in the browser, but it needs XCode+Mac to compile from Cocoa.</li>
<li>Self sufficient - it relies on device or browser for delivering video / audio / interactivity to the end user</li>
</ul>
<h2><strong>Gianduia's direct competition:</strong></h2>
<p>So if it's not the next "Flash Killer" what exactly is Gianduia's purpose? The answer is simple: Apple are just trying to <strong>fix their own loose web application toolset</strong> 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:</p>
<ul>
<li>Cappuccino (<a href="http://cappuccino.org/" target="_blank">home</a>, <a href="http://en.wikipedia.org/wiki/Cappuccino_%28application_development_framework%29">wiki</a>)</li>
<li>SproutCore (<a href="http://www.sproutcore.com/" target="_blank">home</a>, <a href="http://en.wikipedia.org/wiki/SproutCore"  target="_blank">wiki</a>)</li>
<li>JavascriptMVC (<a href="http://javascriptmvc.com/" target="_blank">home</a>, <a href="http://en.wikipedia.org/wiki/JavascriptMVC"  target="_blank">wiki</a>)</li>
</ul>
<h2><strong>Gianduia's APIs</strong></h2>
<p>At the time of writing, Giandua's main framework file is located <a href="http://concierge.apple.com/concierge/18110/scripts/common/ccweb/1-2-SNAPSHOT/Gianduia.js" target="_blank">here</a>. 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.</p>
<p>For those of you who want to peek under the hood and check the inner workings of the framework, below is a list of <strong>some</strong> of Gianduia's framework classes (links to <strong>Javascript files</strong>). Whitespace has been removed from JS files, but they uncompressed and still more or less readable. </p>
<p>You can see some really interesting stuff here like <code>NSPersistentStore</code> or <code>NSBindingDeclaration</code>, take a look:</p>
<p><strong>Foundation</strong></p>
<ul>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSString.js">NSString</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSArray.js">NSArray</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSDictionary.js">NSDictionary</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSDOMNode.js">NSDOMNode</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSNotificationCenter.js">NSNotificationCenter</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSHTTPRequest.js">NSHTTPRequest</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSObject.js">NSObject</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSException.js">NSException</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSImport.js">NSImport</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSKeyValueCoding.js">NSKeyValueCoding</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSKeyValueObserving.js">NSKeyValueObserving</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSKeyValueBinding.js">NSKeyValueBinding</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSPredicate.js">NSPredicate</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSIndexSet.js">NSIndexSet</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSValueTransformer.js">NSValueTransformer</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSJSON.js">NSJSON</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSExpression.js">NSExpression</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/Foundation/NSInflector.js">NSInflector</a></li>
</ul>
<p><strong>AppKit</strong></p>
<ul>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSComponent.js">NSComponent</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSResponder.js">NSResponder</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSBindingDeclaration.js">NSBindingDeclaration</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSWindow.js">NSWindow</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSAnimation.js">NSAnimation</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSCSSAnimation.js">NSCSSAnimation</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSEvent.js">NSEvent</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSImage.js">NSImage</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSDynamicString.js">NSDynamicString</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSDynamicElement.js">NSDynamicElement</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSConditional.js">NSConditional</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSPopUpButton.js">NSPopUpButton</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSRepetition.js">NSRepetition</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSRadio.js">NSRadio</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSInput.js">NSInput</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/AppKit/NSHyperlink.js">NSHyperlink</a></li>
</ul>
<p><strong>CoreData</strong></p>
<ul>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSManagedObjectContext.js">NSManagedObjectContext</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSEntityDescription.js">NSEntityDescription</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSManagedObject.js">NSManagedObject</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSManagedObjectModel.js">NSManagedObjectModel</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSPersistentStoreRequest.js">NSPersistentStoreRequest</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSPersistentStoreCoordinator.js">NSPersistentStoreCoordinator</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSPersistentStore.js">NSPersistentStore</a></li>
<li><a target="_blank" href="http://iphone-reserve.apple.com/rprcustomer/3810/scripts/common/ccweb/1-2-SNAPSHOT/CoreData/NSFetchRequest.js">NSFetchRequest</a></li>
</ul>
<h2><strong>The Unusual</strong></h2>
<p>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 <code>script type="text/declaration"</code> tag located in the head section of <a href="http://iphone-reserve.apple.com/WebObjects/RPRCustomer.woa/wo/8.">Apple iPhone reservation tool</a>.</p>
<p>Maybe someone from readers could provide more ideas on what this code does? Do you think it's a good approach?</p>
<div class="igBar"><span id="lhtml-2"><a href="#" onclick="javascript:showPlainTxt('html-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-2">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/declaration"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; skuThumbnailC : Gianduia.AppKit.NSImage {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; src = skuRepetitionC.objectAtEnumerationIndex.url;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; } </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; skuNameC : Gianduia.AppKit.NSDynamicString {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;value = skuRepetitionC.objectAtEnumerationIndex.name;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; selectedPlanInputC : Gianduia.AppKit.NSDynamicElement {</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; value = selectedPlanURI;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; errorMessageC : Gianduia.AppKit.NSDynamicElement {</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; elementClass=&quot;alert&quot;;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; innerText = errorMessage;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; hideWhenNoWhereAvailableC : Gianduia.AppKit.NSConditional{</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; condition = skuRepetitionC.objectAtEnumerationIndex.hideNotAvailStoreDesc;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; negate = true;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h2><strong>Impressions</strong></h2>
<p>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. </p>
<p>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 <strong>you can expect very tight integration with XCode</strong> and ability to choose "web" as a compile target for your next Cocoa application. </p>
<p>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.</p>
<p>As far as the demos go, <strong>I was not impressed</strong>. 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.</p>
<p>Gianduia seems to have implemented a dependency model which results in chain-loading of framework components. At one point during my test of <a href="http://iphone-reserve.apple.com/WebObjects/RPRCustomer.woa/wo/8.">Apple iPhone reservation tool</a> I had user interface frozen (with unresponsive inputs and no preloader) for <strong>12.7s</strong> while the dependencies were loading in the background - that's a <strong>bad user experience!</strong></p>
<h2><strong>Conclusion</strong></h2>
<p>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. </p>
<p>Just don't put your bets on Gianduia killing Flash -<br />
<h3><strong>it just won't happen</strong>.</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.uza.lt/2010/05/10/gianduia-vs-flash/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

