Wednesday, February 22, 2012

I want an iOS HTML5 application development environment


As a developer, I have a distinct disinterest in mastering the arcane details of android-java or iOS-ObjectiveC. Not that they have intrinsic faults, they are just different from what I already know, and my interest is in making my application more than dealing with a platform. Being able to write it once and compile it to other devices would be ideal. Java had this promise, and succeeded in servers, of all places. Flash succeeded on desktop, then faceplanted on mobile. If Flash hadn’t lost its mojo, I think Adobe Air would be a very interesting application development environment.

If HTML5 is to replace Flash as a development tool, then having a cross-platform runtime (like Air) would be the best way to facilitate application development. Excluding iOS, that cross-platform is represented by the web browser, but on iOS the closed ecosystem disallows any other browser but Apples. The key to me is to not discount the iOS platform, but instead prioritize decisions that would work within Apple’s established guidelines. Those guidelines including: no executing writable memory (no JIT), no browser other than UIWebView/Safari, and no downloaded code or metacode, all behavior is driven by native compiled executable. And content does not appear differently from the time the application was reviewed by Apple

There’s a number of middleware today that meet Apple guidelines. For example, Unity, which even includes a javascript runtime. But very few of them are HTML5, and they all have some drawbacks of one kind or another. Most HTML5 middleware follow the phonegap model of Safari dependence via UIWebView. But UIWebView/Safari is not good for games (slow and no WebGL) The only alternative to UIWebView to date has been dropping the DOM model and packaging JavaScriptCore as a runtime interpreter, which definitely works, but isn’t the optimal performance or api accessibility. ARM compiled javascript would crush JavaScriptCore interpreter.

Mozilla should be capable of creating my ideal HTML5 development environment: applications that are coded using javascript, html, and importantly, WebGL. Some hypothetical Mozilla tool could create a package that is a compiled executable, including javascript as assembly, not bytecode and text-based. The ahead of time javascript compilation step is the magic that would make this solution better than any other. The compiled application is signed with XCode and is submitted to the app store. IOS support would be my priority #1, amazon/android #2, and mozilla marketplace #3.

I think this idea would also be highly consistent with Mozilla’s goals of making the web free and of the people. The web universe and the application development universe are not the same, but they do seem to be converging. Runtimes that support applications as web pages are proposed and Mozilla has boot-to-gecko, XULRunner and WebRT technologies, that are similar to my description. But really what is missing is acknowledging that desktop has become secondary to mobile for application development, and iOS is the key to mobile success.

iOS is a walled garden, and the wall is a barrier that will prevent Chrome or Firefox from successfully supplanting the device operating system. As long as WebRT, WebGL, WebRTC, etc are not included by Web Safari; they have no utility for iOS, and Apple prevents these new technologies from being widely adopted. This impedes the evolution of the open web and preserves App Store revenue. Apple’s App Store is responsible for billions of dollars of revenue. (4b in 2011 received by third party developers) Developers won’t use technologies that iOS does not support since that would shut them off from participating in the revenue steams Apple is responsible for.

If there was a tech to make App Store and Amazon market compatible applications using HTML5, developers would flock to it. In fact they have flocked to PhoneGap, which is a facsimile of web application development that's store compatible, but it is too slow for games; and has recently come under fire for how easily one's content may be repackaged. Making application development as easy as making a web site gets people's attention, but being on iOS creates revenue to fullfill application developers' goals and ambitions. 



No comments: