Archive for the ‘Articles’ Category.

Safari as an SDK

So, when Jobs said on stage that “if it renders in Safari, it will render on the iPhone”, he was just kidding.

In addition to various JavaScript rendering glitches (e.g., side scrolling), it seems that the iPhone cannot pass acid2 .

This is odd, because WebKit has passed acid2 since 2005 .

If you are looking for the iPhone’s WebKit version, it identifies itself as:

mozilla/5.0 (iphone….gecko) version/3.0 mobile/safari/419.3
applewebkit version 420
Thanks to intelinsanex

For reference, Safari 3.0.2 beta is:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en)
AppleWebKit/522.11 (KHTML, like Gecko) Version/3.0.2 Safari/522.12

While the latest Safari 2.0.4 is AppleWebKit 419.2.1, Safari/419.3. I’d like to pull the full user agent string, but Safari 3 beta overwrote my stable copy of WebKit used by Safari 2. Thanks, Apple.

Safari mobile, while “between Safari 2 and 3”, is far closer to v. 2. It is also a very heavily modified build that breaks who knows what else. There’s no bug list yet, according to WebKit developers.

From an IRC chat session in #WebKit last week:

AnObfuscator: On that note, is there a list of known bugs between Safari/OSX/Win and Safari/iPhone — specifically, CSS rendering glitches?
othermaciej: AnObfuscator: we don’t have an exhaustive list, no
othermaciej: AnObfuscator: we are working to bring all the versions of Safari closer together in rendering
AnObfuscator: othermaciej: Cool. is that a webkit project? Is there somewhere specific in the bugtracker I can follow along, perform tests, etc?
AnObfuscator: othermaciej: I noticed the acid2 glitch, and that kinda surprised me
pewtermoose: othermaciej: are all the iPhone changes in svn or is that coming (or at all)?
othermaciej: pewtermoose: they are not in SVN currently
othermaciej: we do expect the trees to be synced in time

So, the bugs exist. They are known. They are not provided to developers. The code that contains them is not yet available to developers (thanks, Apple, for violating the LGPL).

Does anyone out there still believe that Apple takes its “pretty sweet solution” seriously, as a development platform?

SDK? Web browser? I can’t tell the difference, either.

Apple is reputed as the computer company of surprises. 2007’s WWDC gave us many surprises, but few were gratifying. The biggest and most anticipated surprise was the iPhone SDK — otherwise known as a modern web browser. To make sure everyone1 has access to such a modern web browser, Apple has released Safari for Windows.

1 Or rather, everyone except those of us who run non-Apple, non-Microsoft operating systems.

Despite Jobs’ best attempts with his RDF to sell web apps as “very sweet” and “innovative,” Developers aren’t satisfied. Blogger John Gruber of daringfireball.net wrote:

Telling developers that web apps are iPhone apps just doesn’t fly. Think about it this way: If web apps – which are only accessible over a network; which don’t get app icons in the iPhone home screen; which don’t have any local data storage – are such a great way to write software for iPhone, then why isn’t Apple using this technique for any of their own iPhone apps?
[...]
If all you have to offer is a shit sandwich, just say it. Don’t tell us how lucky we are and that it’s going to taste delicious.
WWDC 2007 Keynote News

Gruber isn’t alone in his sentiments; most expected more. Jobs gave two reasons for Apple’s cold-feet — security, and UI concerns.

Jobs said, in effect, he didn’t want users having cluttered interfaces, and he didn’t want crashy apps interfering with the iPhone experience.

I find this concern to be absurd. Palm has had 3rd party development for years. They designed their UI with this consideration in mind; a single tap returns you to a home screen of the standard Palm apps. There is no confusion, and no clutter — just an easy-to-use, customizable interface. The UI is clean, consistent, and well-organized, even with a host of randomly-downloaded add-ons. There are plenty of intuitive and navigable ways to display 3rd party apps. If Apple wanted to let others develop iPhone-native apps, Apple had plenty of examples from which to draw.

While there have been several virii released for handhelds, none have been able to reach critical mass — not even the ones for Windows CE/Mobile. There are SDKs and 3rd party apps for Blackberry, Windows Mobile, and Palm. The application ecosystems for these devices is flourishing. The security concerns, even for dominant platforms, have been low — even for systems inherently less secure than OS X. Handhelds are challenging for worm writers; even handhelds running the same system may have substantial differences in hardware platform, network interface, and system services. This, combined with low market penetration, has kept handhelds from being primary targets.

However, Apple’s goal for the iPhone is fairly substantial, and its platform is high profile, to say the least. With a unified platform, security glitches become easily exploitable. Hackers have been hacking for decades without SDKs. If Apple neglected to put in a reasonable security model, hiding behind a closed platform will not save them. Security through obscurity has been proven false many times over. Considering Apple’s overwhelming desire to be seen as “secure”, I doubt they overlooked this issue.

Stripping down a resource-intensive desktop OS to an embedded OS is challenging, to say the least. It may be that Apple has had to remove most of OSX’s userland, requiring apps to run directly on kernel calls. Task priority may be another issue. Apple may have fine-tuned the thread prioritization with its apps to guarantee a seamless UI experience. Thus, Apple doesn’t want 3rd party apps running in this carefully balanced structure. A poorly written program could cause a host of priority issues. If Apple did chose to go such a route, we will never see a true iPhone SDK, at least for this product generation.

Bearing that depressing thought, a lot of pundits claim there will be no “killer app” for the iPhone. The iPhone is not designed to be a platform for killer apps; rather, it is its killer app. While there are plenty of other smartphones on the market, most are targeted aggressively towards the business market. The few that are consumer oriented, are total crap — the SideKick and BlackJack spring to mind. Apple’s product is stylish and desirable. Knowing Apple, it will “just work”. Smartphones like that are as rare today as compact hard-drive MP3 players were in 2001.

The iPhone doesn’t run true 3rd party apps. Apple just doesn’t want them, or Apple can’t let them exist. Regardless, their existence will not determine the success of the iPhone. If the iPhone can perform its tasks as well as an Apple product should, its success is guaranteed.

Carbon, Cocoa, and the Finder in 64 bit Leopard

On the CarbonDev wiki, this page contains numerous interesting tidbits about Leopard’s 64 bit support for Carbon. Notably:

In practice, it looks like Carbon means “the UI(User Interface) portions of HIToolbox”. So for 64-bit there will not be a Control Manager, Menu Manager, Window Manager, etc. We are still planning to support the Carbon Event Manager and Text Input Sources, to name two mostly non-UI API‘s.

You might wonder, what about the Memory Manager, or the Alias Manager, or the Process Manager, or other lower-level managers? At this time, it looks like most, if not all, of the APIs provided by the ApplicationServices and CoreServices umbrella frameworks will still be available in 64-bit (subject to further changes in plans).

There is no explanation as to why Apple is deprecating Carbon; we all have a pretty good guess. However, the developers are discouraging this point of view:

Q: I’m not privy to the internal discussions within Apple, but I’m willing to bet a quarter they don’t even know themselves for sure at this point. Apparently they have working 64-bit Carbon that they’re just arbitrarily opting to not ship because they want to send a message to developers.

Larry is correct up to the word “because,” at which point he makes an assumption.

Onto the idea of a Cocoa Finder. Finder’s Carbon-ness has rubbed quite a few people the wrong way. With the demo of Leopard, some key Cocoa features were demonstrated. But for those of us hoping for a Cocoa-native Finder:

(T)he Finder in Leopard is a 32-bit app. The only Leopard app I’m aware of that ships as a 64-bit app is Xcode.

(T)he Finder is still largely a Carbon app in Leopard, although it does use our new HICocoaView capability to allow embedding NSViews inside a Carbon window to implement the coverflow view.

Well, some Cocoa is better than none, I suppose. Hey, there’s always 10.6, right?