Runtime wars (2): Apple’s answer to Flash, Silverlight and JavaFX

In yesterday’s Runtime wars (1): Does Apple have an answer to Flash, Silverlight and JavaFX?, we surveyed the primary contenders for rich-media, cross-platform application delivery: Flash, Silverlight and JavaFX. And wondered if Apple has an ace up its sleeve.

Apple’s options

Thanks to the surging popularity of Mac OS X and the iPhone, other companies are already bringing their plugins to Apple’s platforms, so the company may feel no urgent need to reinvent the wheel on Mac OS X. With Core Image, Core Animation, Core Audio, QuickTime and Cocoa, Apple’s desktop platform is not exactly a rich-media desert. Most of those capabilities are carried over to its post-PC devices AppleTV, iPhone and iPod touch via Mac OS X, so doing nothing may be one alternative.

Another “Apple should really…” item that refuses to die is the porting of core Apple media technologies to (at least) Windows, with a runtime for Cocoa. The “Yellow Box for Windows” which would have made write-once, deploy-anywhere possible still remains a dream of Cocoa developers.

Yet another option is #1 in Apple fans’ perennial Top Ten wishlist: buying Adobe (for Flash). This one’s quite unlikely, even during a week when Adobe’s CEO just called it quits.

Finally, Apple may choose to leverage an open source project such as OpenLaszlo, capable of outputting to multiple runtimes:

laszlo2.png

Core X

Of course, Apple could also be hard at work creating a brand new platform that integrates its Core X technologies into a new cross-platform runtime.

core-techs.png

One huge barrier to that approach is distribution, however. It’s easy for Microsoft to distribute Silverlight through its OS monopoly. Flash, which Adobe claims is on 98% of desktops, has an unrivaled uptake rate for upgrades. Sun has close relationships with mobile device manufacturers and carriers and Java already runs on hundreds of millions of phones. While Apple claims 500,000 iTunes downloads and QuickTime is also on a lot of Windows desktops, it would still be a very difficult hurdle to get a new runtime on a broad range of platforms at this juncture. Yes, if the new platform is unambiguously superior it could happen, but Apple is coming way behind in this race.

So what then is Apple’s most sensible option? When in strategic doubt, resort to the famous stratagem devised by Odysseus.

Apple’s Trojan horse

Apple has been pretty good with the Trojan horse strategy, leveraging a few key assets (even when regarded as being late to the party) into domination in digital music, for example, and it’s trying the same with the iPhone in the mobile convergence space.

Apple’s Trojan horse in multi-platform, multimedia runtime is a piece of open source technology that’s already on Windows, Mac OS X, Linux, Adobe Flex/AIR, iPhone, iPod touch, Nokia S60 smartphones and Google’s new Android/Open Handset Alliance, with 30+ partners around the globe: WebKit 3.0.

WebKit 3.0

WebKit has come a long way since Apple’s adoption of the open source KHTML rendering engine and KJS libraries from KDE. A flurry of recent additions to WebKit by Apple and WHATWG now include:

Client-side storage via SQLite (bundled by Apple in Tiger and Leopard, but also used as a persistence layer by Google Gears and Adobe Flex) lets WebKit-based browsers store structured data locally.

Enhanced Rich Text Editing has been a problematic area for Safari for a while, especially with Google Docs, GMail and blogging apps. WebKit 3 solves that in an elegant way by providing a fully functional rich-text editing context activated by a simple click on the editable text:

rich text editing editor

Downloadable fonts let designers specify downloadable custom fonts via CSS @font-face rules.

Style-able form controls are now possible via CSS specification in WebKit 3:

stylized buttons

Advanced CSS styling ushers in multi-column text layout, text stroke and shadow, border-radius and shadow for box effects, among others.

Faster JavaScript and DOM parsing in WebKit 3 is said to be 2X or more, thereby speeding up rich-media applications.

New and faster XML technologies in WebKit 3 include XPath, the W3C standard XML Path Language that lets Ajax/CSS developers query document elements more efficiently, as well as XSLTProcessor, DOMParser, XMLSerializer and much improved XMLHttpRequest.

Scalable Vector Graphics (SVG) support for graphical presentantion and interaction via XHTML in WebKit 3 is shaping up to be the fastest among browsers. Although its rich potential has not yet been fully realized, SVG gets an opportunity to ride on the coattails of WebKit to tackle a range applications where only Flash could have been considered until now. Here’s a Mac OS X Dock-like magnification animation in SVG (WebKit 3 required for interactivity):

magnify SVG

CSS animation is a way of specifying animation via CSS, with transition properties like duration, timing, opacity, etc. Safari and WebKit architect Dave Hyatt promises even more:

In future posts I’ll go into transitions in more detail and also talk about another feature we’re adding: explicit animations. We are also preparing a more detailed proposal (full of intimidating spec language) that covers our thoughts on transforms, animation and other advanced visual effects.

CSS Transforms take a page out of currently available JavaScript effects libraries to enable boxes to be scaled, rotated, skewed and translated, with timings for fades, rotation, expansion, collapses, etc. Hyatt:

…transitions are for basic implicit animations. We will also be introducing explicit animations (using actual “animation” CSS properties)…We are exploring ideas for how to do transforms in ways that could affect layout.

HTML5 <audio> and <video> allow extremely simple media embedding in WebKit, with bi-directional JavaScript control:

<video src=sample.mov autoplay></video>

There are other additions and improvements to WebKit as well. As you can see by now, WebKit is no longer your dad’s browser. Bit by bit, it has been gaining rich-media capabilities and Apple appears to be in no mood to slow down.

Renderer on steroids

WebKit architect Hyatt outlines future directions:

Like Microsoft our engine is also used inside many applications on our home operating system. We serve two masters: the Web and OS X (in all its forms). If people need these capabilities on OS X, we are going to provide them, regardless of whether or not they end up in any specification. That said, we are very interested in standardizing this stuff, and are preparing a proposal for the folks at the CSS WG.

Also, CSS has a well-documented means of providing safe non-conflicting extensions (using vendor-specific prefixes), so there is absolutely nothing wrong with CSS extensions. This isn’t like HTML, where you end up polluting the namespace. CSS can actually be extended safely in a way that doesn’t conflict with the standards.

While Apple’s ability to set a new rich-media standard may be limited, with the open source WebKit, even competitors like Nokia, Adobe and Google are helping the company achieve its primary goal of establishing a stable and ubiquitous platform from which it cannot be strategically excluded. That’s some Trojan horse!

Is WebKit as rich and powerful as Flash, Silverlight or JavaFX? No. Certainly not today. But it’s an extremely cost-effective way for Apple to have a pervasive rich-media platform whose future it can certainly affect.

A richer version of WebKit in the near future will have a commoditizing effect on Flash, Silverlight or any other proprietary platform. Remember Apple makes money mostly by selling iPhones, AppleTVs, Macs and related services. To the extent that these devices can have access to non-propriatery runtimes, not controlled by competitors like Adobe or Microsoft, Apple would be happy to sponsor open source development, as it’s doing with WebKit.

Where to next?

Perhaps next on Apple’s agenda is beefing up its development tools for WebKit. WebKit Inspector, a sophisticated development tool to navigate and debug web apps, is already out, as is Drosera, WebKit’s JavaScript debugger. Web Clip, a seemingly simple but extremely user-friendly tool, lets non-programmers create dynamic subscriptions to a selected portion of a web page as a Dashboard widget in just a couple of steps. Here, for instance, a 48-second video of YouTube “videos being watched right now” area turned into a Dashboard widget with a single click, with the widget capable of playing selected videos without going back to a browser, all thanks to WebKit:

webclip.png

Of course, Dashboard widgets are themselves rooted in WebKit and Dashcode greatly simplifies the creation of these small apps. It’s not out of the realm of possibility for Dashcode or a more professional tool to eventually grow into something closer in capability to Adobe Flex Builder or other IDEs based on Eclipse.

WebKit: an open-source, license-free, rich-media capable runtime…on desktops, TVs, phones and all manner of convergence devices to come. Could it be that when Steve Jobs introduced WebKit as the way to develop for the iPhone, he actually meant to signal its future direction?

UPDATE: Today, Apple updated WebKit’s Web Inspector, with a few new features including inline CSS editing and downloaded font previews elevating it closer to a web application IDE of sorts.

inline-css.png

star
Runtime competitors were outlined in Part 1:
Runtime wars (1): Does Apple have an answer to Flash, Silverlight and JavaFX?

12 thoughts on “Runtime wars (2): Apple’s answer to Flash, Silverlight and JavaFX

  1. Pingback: Does “A VC” have a blind spot for Apple? « counternotions

  2. Pingback: Google Chrome: Bad news for Adobe « counternotions

  3. I’ll go out on a limb and predict that a considerable number of iPhone Cocoa Touch apps we’ll soon see could have been done in Ajax.

    In fact, as JavaScript execution speed approaches native, HTML 5 brings local data storage to WebKit and JS/UI frameworks become even easier to work with for development, this trend may accelerate. To the extent that Apple controls both the hardware and the OS, what if it decided to speed up JavaScript with hardware assistance and allocated much greater memory?

  4. What to think about SquirrelFish which makes javascript 1.6 times faster then on webkt 3.1. And what ti think about sproutcore, the javascript framewrk used to build MobileME. That fits nicely in this strategy. Maybe Apple really wasn’t going to release an iPhone SDK and planned to slowly unfold and improve its webstandards/webkit strategy but was caught by surprise. The interest in iPhone apps was just to strong and to sudden.

  5. Pingback: The new UI wars: Why there’s no Flash on iPhone 2.0 « counternotions

  6. Troy: I have my doubts that Webkit can serve the same function as Flash.

    WebKit isn’t trying to replace or, even, compete with Flash per se. It’s Apple’s way of ensuring that there’s a ubiquitous x-platform rendering engine/runtime not controlled by a competitor. As you know, WebKit not only powers Safari, but also Adobe AIR, Nokia smartphones, Google Android, etc., which is a testament to Apple’s hope and ability to get wide traction.

  7. I’ll be contrarian.

    Though biased, I have my doubts that Webkit can serve the same function as Flash. They overlap but.

    Flash for one, isn’t a single runtime. There are mobile, web, desktop, with variable capabilities.

    Flash was designed to stream, code, assets (animations). It was built for a networked world, where as anything based on XML can get bloated quickly. Unlike Java..also designed for a networked world, it starts up quickly.

    The latest version of Actionscript (based on ECMAScript) is fast and approaching the maturity of other languages.

    Adobe is also open sourcing much of the technology so it’s not really as propritary.

    The Flash player (4MB) isn’t a fraction of Quicktime typically bundled with Itunes.

    The authoring tools for creative professionals are still dominated by Photoshop, Illustrator etc that tightly integrate with Flash. Until such time that competitors, and culture shifts people off of that (hard as design agencies set the bar and stardize) it won’t really

  8. The intriguing part is if SVG could be controlled from JavaScript or other language (ECMAscript compliant?) to be able to develop the kind of animations, interactions and the like as Flash.

  9. Yes, it’s possible that the iPhone SDK would be LLVM based. I’ve played a little with LLVM and it’s definitely a well-engineered bit of software. The “VM” part is almost an understatement: It includes an interpreter, a JIT compilation (VM) system, and a traditional code generator/optimizer (plus link-time optimizer). It seems reasonably well documented, and fairly easy to use.

    They (the LLVM project) have already ported GCC’s gcc and g++ to it (i.e., you can use GCC’s front ends with LLVM’s code generation). More importantly, Apple is working on Clang, which is a C/C++/Objective-C front end that aims at being GNU compatible. Clang hooks into LLVM. However Clang (and LLVM) aren’t “encumbered” by the GPL. That could be very significant for Apple, FSF, and many open source projects (e.g., it could significantly diminish the influence of FSF).

  10. Daveed, there’s been talk of Apple using LLVM to ease transition to iPhone development:

    “LLVM may allow developers to use Java and other languages, which are allegedly locked-out on the iPhone. And with LLVM functioning as a transition layer that allows software written in one language to be ‘decompiled’ into an intermediate bytecode, that would make Mac apps recompiled to run on ARM processor a definite possibility.”

    http://www.pcmag.com/article2/0,2704,2143055,00.asp

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s