satine.org

by Charles Ying

Archive for the ‘Life’ Category

Dashing Xcode

Tuesday, July 6th, 2010

Jesper thinks that Apple is working on a new language. I’ve posted something similar in 2007, but a lot has happened in 3 years.

I believe Apple’s new runtime language successor to be (or very close to) JavaScript with an Objective-C bridge. Here’s why:

  1. JavaScript is already one of the iOS platform languages.
  2. JavaScriptCore Nitro is fast.
  3. JavaScriptCore already bridges with Objective-C.
  4. Apple uses JavaScript in deep, key areas: iAd, iTunes 9, Mobile Me
  5. DashCode (and PastryKit).

Apple is probably still sorting out:

  1. Security + sandboxes. I once asked Doug Crockford what he thought was in JavaScript’s future and this was it.
  2. LLVM compilation. For Apple, it makes sense to have a compiled language story that improves JavaScript performance even further via compile-time analysis and optimization, courtesy of LLVM. It’s great for iOS code validation too.
  3. Framework design. Apple is known for taking time to try out features and APIs to get them right before publishing them.

Update To Jesper’s point about replacing Objective-C. I believe this successor adds a new level to the Apple language family and doesn’t replace Objective-C. Use JavaScript where appropriate: high level memory safe, dynamic, functional code with a productive, concise syntax. Drop into Objective-C to do performant, memory efficient, or security-privileged things. Drop into C for more speed, more efficiency. It’s turtles all the way down, and in many ways, we’re already there.

Technorati Tags: , , , ,

Fortune Favors the Brave

Sunday, April 11th, 2010

Section 3.3.1 of the iPhone SDK Agreement:

3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).

The thing to understand about Section 3.3.1. is that it is the legal letter of the SDK agreement, but not the desired intent.

Developers are allowed to use SQL for database operations. Developers are encouraged to use GLSL via OpenGL ES 2.0 for fast graphics. SQL and GLSL are not languages in the Objective-C family and they are compiled / interpreted. But they also don’t directly link against the Documented APIs (e.g., there’s no “SELECT subviews FROM UIView”).

Regular expressions and XSLT (ugh) are also similarly permitted.

How I intend to interpret Section 3.3.1., as an independent iPhone developer is as follows: Use Objective-C where it makes the most sense: directly interfacing with the iPhone SDK. When I need different tools to achieve something application specific, like an AI in Lua or printing commands in PostScript, I’m going to use them.

For me personally, I feel that this is what Apple permits and practices in the course of mobile software development.

Practices? Yeah. Have you looked at what iPhone OS itself uses? XML and JSON for data serialization. Nibs, property lists, XSLT in XML domain specific languages. TinyScheme to interpret Scheme code for sandboxed process permissions. hunspell‘s DSL drive the spell check dictionaries.

For sure, Apple has impure motives. But that doesn’t mean they’re wrong. Mobile constraints are different. Battery life and performance matter. A lot.

Use the right tools for the job: Objective-C when talking to iPhone OS. But whatever your application’s brain needs to think different.

Technorati Tags: , , , , ,

The LOST iPad Icon

Tuesday, February 2nd, 2010

The iPhone was introduced at Macworld 2007 without one mystery app. Apple later revealed that mystery app only 9 days before the iPhone launch to be YouTube which propelled iPhone hype into orbit.

With 52 days to go, and the iPad rumor mill kicking into gear, the question of the day is, “what is the iPad’s mystery icon?”

So, if you think it’s crazy for Apple to be hiding mystery iPad software and hardware, remember that history tends to iRepeat itself.

Personally, I’m looking forward to iChat and Dashboard widgets on iPad.

Update: Felipe makes a good point in the comments. On June 18, 2007, 11 days before the iPhone launch, Apple also upgraded the display hardware from plastic to glass. Glass display parts are $16 today, while camera parts are roughly $10.

Technorati Tags: , ,