Vishal Shah - #V's Blog

  • Archive
  • RSS
  • Ask me anything

What Apple *now* needs to bring even more & better apps to its platform

Summary

I seriously think that supplementing iOS’ development features to support building native apps via a dynamic programming language like JavaScript or Python/Ruby will change everything one more time. The pace at which developers can then build apps will be phenomenal, and it will further help attract web developers to the iOS’ native platform. Furthermore, this will become Apple’s contribution to further support for what I believe will be the foundation of next-gen applications, which will be built using hybrid designs - part native, part HTML5 - the native layer for following the foundation and the core structure of the application and the web/HTML5 layer for content display which can be easily changed on the server side.

Apps & iOS

Technical and Technological marvels in the making

The iPhone & iPad are simply put, technical and technological marvels in the making. If you just knew what’s packaged in those shiny looking little bricks, you would know what I am talking about. And if you know a thing or two about design, you have seen how beautifully the hardware and software are fused together to make a complete whole. Its truly beautiful.

Beauty and the apps

No doubt the sheer beauty combined with the focus on simplicity has helped Apple turn them into instant successes. Both don’t ignore the all the apps out there - the apps we love, both Apple and 3rd party; the games, the camera apps, the utility & productivity apps, the news apps, that beer simulator app. Apps define who apple iPhone users are and they are one of the biggest reasons, the iPhone is where it is today.

App Development redefines the mobile OS

Apps today are the centerpiece of the iOS. The OS itself these days mostly evolves around better supporting applications - how to be fair to all apps, yet act judiciously on behalf of the user. You will not believe how much time and effort is spent by Apple on just app development tools, frameworks, libraries. You will also not believe how much the OS itself is developed with apps in consideration. And so much of the OS code is devoted to this particular aspect. The iOS would be of many magnitude simpler if Apple would have chose to keep it locked for internal apps only. Then again iPhone and iPad would not have been the same without 3rd party apps. There would not have been Angry Birds and imagine your iPhone without it. Bottom line - Apps are centerpiece no matter how you look at iOS.

Dynamic language support

Easier app development - why not?

If apps are centerpiece, and if I was at Apple, I would seriously think about getting even more and higher quality apps in the appstore. Its just a win-win situation, isn’t it? Win for Apple. Win for app developers. Win for users.

Today native app development with Xcode is fun and tooling from Apple is simply phenomenal but apps today are developed using Objective-C, a language originally developed in the 80’s. Sure, it has evolved, there is a 2.0 version and the team has done a terrific job adding features such as automatic reference counting (ARC), a compiler feature that makes it easier for app developers to manage with the app’s memory space and leaks. But it still is quite a chore to program in when compared to dynamic programming languages such as JavaScript, Python, Ruby, etc.

Just ask a developer how to filter an array of values based on some condition in Objective-C vs say in Python. And just sums it.

I actually like Objective-C and it certainly needs to be there. Power developers and apps with complicated development requirements can very much benefit. But a good 70% of apps can do away with it and instead opt for the much simpler dynamic language route.

Some of the benefits of dynamic language over static languages include - * No compiling of code at development time * Loose typing aids in quick development * Higher level constructs such as cloures/blocks and functional programming paradigms are more easily supported with dynamic languages * Ability to build iOS apps without learning a new language (and trust me Objective-C is quite an oblique language to many developers new to Apple development) * Code and library reuse across web and iOS native applications

Does a particular dynamic language matter? Or do we only need dynamic syntactic sugar?

Apple has couple options to support dynamic languages for its iOS and Mac platforms - 1. Choose an existing dynamic language such as JavaScript or Python or Ruby 2. Come up with Apple’s own Objective-C variant of a dynamic language

I don’t think it matters that much, but option 1 to me appears to be a no-brainer.

How to build dynamic language (DL) support for iOS? What are some of the challenges?

I am afraid its not as easy as picking a dynamic language and saying done. There are caveats and decisions to be made. Would I support building full fledged apps using DL or would it be smaller subset? Apple faces some really tough challenges, since it has not supported non-C based programming languages in the past. Other platforms such as Java and .Net use a common runtime layer that other languages translate its code into and the common runtime code is what at the end of the day gets run by the hardware. Unfortunately its a little late for Apple to build such a layer. And its a complex tasks with questionable returns.

Hence, the only option I see fit is to support a translation layer. A layer that translates dynamic language code to low-level C code. This in theory is similar to Google’s GWT (Google Web Toolkit) which translates Java code to optimized JavaScript.

The key is that code generated is heavily optimized and that the generator understands platforms such as iOS and Mac. However, I don’t think its a terribly hard assignment. Nor one that changes much for Apple. Apple continues to base its frameworks and OS on C-based languages and Objective-C, while giving developers the choice of developing with Objective-C, a static programming language or an even higher level dynamic programming language.

What’s the cost to support Dynamic Language (DL) on iOS?

The cost involves around - * Building the DL to SL translator & generator * Tooling to support the language in Xcode and tools such as Interface Builder and Instruments. * Documentation to aid developers * Bringing some of the conventions and best practices from Objective-C and C to DL based app development

There are no significant runtime or OS level changes. The thing however I am most worried about is bullet #2 above. Xcode is quite a complicated piece of software and I fear incorporating a DL might be non-trivial, but its hardly impossible.

Also, Apple developers have learned to follow a lot of conventions and nuggets of wisdom that might be a bit difficult to translate to the DL layer, but I do not see it as a show stopper.

Think about the upside. Think about the benefits if Apple say adopts JavaScript. HTML developers can rejoice and start leveraging their JS skills to build native iOS apps. What a dream come true. Sure, they will not be able to build sophisticated OpenGL ES games with it (which too is a possibility, look at WebGL) but they can build fairly sophisticated apps with it without learning a new language and dealing with lower-level memory management constructs. And the hardcore Objective-C developer can continue to use what they do today.

Hybrid Apps

In fact, what I would be most excited about is (shhh, its a secret) is the ability to build apps using a combination of dynamic language for some parts of the application and Objective-C or C for the rest. This can be a powerful concept that I can’t wait for! If I were to build a simple photo sharing app, I can start building the UI with DL and leverage Objective-C for photo editing and possibly network optimizations if needed.

Conclusion

I love dreaming about hard problems, and this one kept me busy for a while. But I do believe this at least warrants a R&D project.

Vishal

    • #apple
    • #mobile
    • #insights
  • 6 months ago
  • 1
  • Permalink
  • Share
    Tweet

About

  • Blog Archive
  • Vishal's Home Page

I like designing & architecting things that help better and simplify life in some way or other.

I have degrees in Computer Science & Mechanical Engineering and have studied Industrial Design in San Francisco, CA.

Pages

  • Reading
  • Playing
  • Work
  • Contact
  • Following

Me, Elsewhere

  • @whos_v on Twitter
  • goldenv on Flickr
  • Linkedin Profile
  • Xbox Live Profile

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr