Don’t Be A Dick: Compiled Flash and You.

Appeal to Authority

I post here infrequently. My intent with each post has been to show some “clever” abuse of Cocoa or the Objective-C runtime APIs. I don’t want to portray what is presented here as the canonical or “best” way to approach problems – my goal has been to offer readers who are amply qualified to disagree with what’s written something that I feel is worth their time to think about. I hold the Cocoa developer community, and particularly those I associate closely with, in high regard. Coming up with novel ideas and finding the time to adequately document them is, by virtue of the caliber of the audience I hope to address, a difficult task which doesn’t fit into a regular publishing schedule. If you’d like to read something smart at least once a week please consider reading my friend mikeash. Don’t bother clicking that because if you’re here and not already reading everything Mike has to say then there’s something wrong with you that one hyperlink will never solve.

With that preamble out of the way I’d like to assert that I am an avowed fan of the Cocoa frameworks and a believer in the language middle-ground that is Objective-C. The argument that follows is a novel addition to this infrequent spamming of ideas I call a Web-Log in that it is not a tightly focused technical piece. Rather, it is an opinion piece – an appeal to authority.

And to whose authority do I appeal? Mine. Because I know what the fuck I’m talking about.

Non-Native Toolchains vs iPhone OS

May the best man win.

Beyond the well known issues with Flash letting arbitrary interpreted code run on the iPhone is problematic. Primarily it precludes Apple from vetting the code executed on the device after they’ve approved the product for sale on the AppStore. One could argue, and it’s a decent argument, that they should not exert this level of control over the apps that run on the device they sell you but, given that they’ve decided to do so, permitting interpreted code to be executed would be a loophole in this policy. What Adobe announced today, however, is not a Flash runtime – it is a compiler for Flash code that produces first class iPhone (ARM specifically) native code.

Jeff LaMarche has examined the Adobe generated .ipa files and you can learn a little more by reading his Tweets starting here. In full disclosure Jeff has bought me more beers at WWDC than I feel I deserve but I trust his analysis of these files nonetheless. Jeff is a smart fellow and uncovers a few clever things in his dissection of these Flash based iPhone apps.

My take is this: if you produce a binary that honours the iPhone Developer contract (uses only public APIs, is not a Flash interpreter, applies the appropriate code signing, etc) then you have exactly as much right to be on the AppStore as I do. If you compiled some Flash code or even used Mono (.NET) to write your app then so be it. If the final product is playing by the same rules I am then that’s good. Perhaps your tool is better for the job you selected it for.

“Be Thou Not Afraid”

(During my favourite x-files episode an “alien” says, “Be thou not afraid, Rocky”. I tried finding a link to that but this link came up first. Dig the horizontally scrolling text and take time to read the poem too. It won’t hurt, even though it does mention God. And the MIDI. I just noticed the MIDI. Click that link just for the time warp effect).

Let’s be frank here – fuck the tools. If you’re as deep a fan of the Cocoa tool-chain as I am then you likely came to them as I did – after years of dealing with the drastically inferior. Do I believe Cocoa is still the best tool? Yes, I do. But let’s not pretend that it’s the only tool. Some crazy people may prefer other tools, and we may well think they’re insane for doing so. The proof, however, is in the pudding. And it’s the pudding that our customers buy. I’m in love with my oven and at this point I doubt I’ll ever change it but I have no illusions that fashion won’t pass me by. If Adobe, or anyone else, can produce tools that provide a more compelling application on the iPhone then good for them.

Ridiculing their or others efforts is ultimately self defeating. If you love software as I love software you should think twice about being so dismissive of alternative approaches.

Do I think the “Ahead Of Time” compiled Adobe Flash will take over the AppStore? No, I don’t. And I know that because I can write better software than that.

But one day I’ll be wrong. And if there’s one thing I hate more than being wrong it is having dismissed as trivial that which has defeated me.

“I’ve Been Wrong Before”

($0.99. Go buy Dusty Springfield’s I’ve Been Wrong Before. And if you don’t after having heard the 30 second demo then quit bitching about Alyssa. She is carrying my child after all…)

I like to believe I’m a clever fella and here’s my secret to being clever – I am always wrong. Always.

Programming is an exercise in overcoming how wrong you’ve been in the past. At first you’ll overcome the syntax errors, then you’ll overcome the structural errors, and then you’ll come to align your code with the standards of a greater community and you’ll feel safe and like you’ve made it. You haven’t – you’re still wrong because you’re always wrong. You are playing a game you cannot win. And let’s face it – if it was a game you could win you’d not be playing at all.

If you’ve written code then you’ve looked back at your work and known it could have been done better. Think bigger. Think beyond the micro improvements that could be made within the domain we understand best and consider the scope of our experience. If you’ve been around this clock as I have then you’ll recognize a good idea comes every five minutes and one that sticks every fifteen. Let’s not pretend that we know what time it is because we know what we saw last time we checked our watches.

At the top I claimed to be an authority and that I knew what the fuck I was talking about. That’s still very true – If you think you’re an authority you’re wrong. Take it from me, I’m the authority on authority and if you think you know better then eventually you’ll be in for a really big shock.

Be wrong as often as possible – It’s the only way you’ll ever be right.

Love, Guy

26 thoughts on “Don’t Be A Dick: Compiled Flash and You.”

  1. “Do I think the “Ahead Of Time” compiled Adobe Flash will take over the AppStore? No, I don’t. And I know that because I can write better software than that.”

    I don’t know the limitations of AOT Flash apps – but I can see this technology being a huge win for certain classes of apps – mainly casual games (tower defence, line rider, etc, etc). The flash casual games market is huge and there are a LOT of games out there, and the developers are all itching to get onto the iPhone.

    These games are already dirt cheap (often paid for by advertising via mochimedia and co). If the devs can spent a minimal amount of effort and port them to the iPhone and sell them for a $1 or two they will.

    And I think they will be deservedly successful too (assuming Adobe’s tech doesn’t totally suck).

    And I’d actually argue that Flash is the better technology for this kind of thing to boot. 🙂

    1. I agree – there will be classes of apps, particularly quickie games, where Flash could be very well suited. It won’t take over native APIs, of course, but it could still bring some interesting apps to the platform.

  2. Re: Jonathan Wight’s “And I think they will be deservedly successful too (assuming Adobe’s tech doesn’t totally suck).”

    The only problem with this is that the assumption doesn’t fit. Given Flash’s history, current performance on the desktop, and every little piece of information about iPhone-native Flash that has been revealed, there’s just no way I can accept this. It’s like saying “assume a wheelbarrow is a race car.” It makes the entire argument academic.

  3. This is not just for “quickie games”. I’m nearly finished with a moderately substantial iPhone game. My next step after releasing it? Start a complete rewrite from scratch for the web. Look, I like Cocoa as much as the next guy, but if I can deploy to the web and the iPhone from a single codebase, that wins, provided it’s able to provide a good user experience on both platforms. Can compiled flash provide a good user experience on the iPhone? I don’t see why not, but only time and experimentation will tell.

  4. All I know is that I know nothing, but to see the power of this type of “cross compilation” from one SDK to another, just take a look at what google has done with GWT. It’s not beautiful in the aesthetic sense so much (even I know that and take one look at my app’s website and you’ll know I’m no expert on visual appeal!). But look at gmail and google wave, written in java, compiled to javascript, and amazingly powerful and useful.

  5. This is not a completely new thing on the iPhone. There were Java (J2ME) programs in the AppStore literally a year ago and doing well. One game was well into the top 20 non-free games in October and November last year and getting great reviews. This was done using InnaWorks’ “AlcheMo” java to native compiler:

    It seems strange that, a year later, the flash translator doesn’t work on the Simulator and doesn’t provide access to CocoaTouch APIs. AlcheMo does both.

    Disclaimer: I used to work on AlcheMo, but I don’t know what’s used it this year.

  6. This post would all be well and good but… have you played the stuff on the App Store thats made in Flash? Have you seen how badly they chug during just simple alpha fades or dragging a slider bar? If they have the same right to be on the App Store as an xcode app then I expect the same level of quality, I don’t want to have to look at screenshots and worry “it look good… but it might have been made in flash so might run horribly jerky”

  7. This is inspired. Great read.

    I’ve read a lot of reactions from iPhone developers that don’t want to lose their competitive edge since we now have to compete with Flash developers too. Realistically I don’t see that as a problem. Like you said, “… I know that because I can write better software than that.”

  8. And this all begs the issue of whether customers will pay for quality, or not. If flash is slow and clunky, but it’s good enough, then maybe we have to admit that customers would rather have cheap and lousy rather than expensive (omigod $10!) and well made. If its compiled code and it’s secure, let ’em use it and see what the market says. My guess is that the performance will never be good enough, but maybe Adobe can throw enough money at it to make it usable.

  9. I like Cocoa as much as the next guy, but if I can deploy to the web and the iPhone from a single codebase

    No, no, no. Your beautiful Flash apps belong even less on the Web than they do on the iPhone. At least on the iPhone you have compiled your Flash into a native app. Until there is an exporter in Flash that exports as HTML5 your apps are not part of the Web. With Flash CS5 you can export your app as iPhone, Mac, and Windows. You should deliver your Flash app that way, rather than putting a SWF in a Web page. Put the Mac or Windows app there directly as a download, be honest about it.

    What is needed is Android and Blackberry targets for Flash CS5, so that you can make 1 Flash app and export as iPhone, Android, Blackberry, Mac, and Windows. Then Flash is a real IDE, and FlashPlayer can be taken out behind the woodshed, etc. etc.

    To me, that seems to be the most legitimate use of Flash going forward: as an IDE for developing cross-platform mobile apps. Make one Flash app and run it on a wide variety of devices. However, this has to be as NATIVE code so that it is fast enough. In other words, when your app gets to someone’s Blackberry it should be running native on the Blackberry.

    FlashPlayer is like a millstone around the neck of Flash at this point. The iPhone target from Flash is how Flash SHOULD work. Compile with the great big honking PC you’re using and its 2-4-? processors and ungodly memory and storage compared to most devices. Then run native code on the target device.

    Blackberry and Android and so on all need native apps much, much more than the Web needs more software MPEG-4 players. We have MPEG-4 players in all the hardware now, let’s get Flash development focused on making mobile apps that users can buy and download and use again and again, independent of their Web browser and the universal cross-platform Web they find in there.

  10. Someone at Adobe has a C compiler for Flash Runtime. They compiled Doom or Quake (dont remember which) with it and produced a runnable result. Use this with an Objective-C -> C preprocessor ….

  11. BTW – dont forget openFrameworks which is pure C++ and your apps not only run on iphone but also on Win/Mac/Linux. It is intended for interactive art, installations and so on but games are not that different. It is open-source and you use XCode to build so you have full access to Cocoa and can mix with Objective-C. There are a number of openFrameworks apps in the store. An example:

  12. In Reply to Paul, above.

    Adobe have said that the currently available Flash-made iPhone apps use software rendering and are therefore slow. The final Flash CS5 will apparently be able to use the graphics hardware and should be much faster. Sorry, don’t have a link handy.

  13. I, Guy English, on this, the 8th day of October, in the year of our lord 2009, do herby affirm that I will try to use more commas in my prose. Setting aside the obvious structural problems, the lack of proving a thesis in favour of an appeal to emotion, and the floppy, wobbly and weak fallback of a final paragraph it is certainly the inadequate deployment of the comma that is most notable in this piece. I will endeavour to do better in the future.

    And, yes, that sounds like I’m making fun of the comment from erdenfeind but, heck, I choose to take it in the broader sense and will, in the future, try to rant in a manner more befitting the Internet.

  14. Let’s not talk about how easy is to decompile a SWF movie, and extract assets and AS code.

    I wouldn’t trust that except for quick and dirty apps.

    In the end we will have an app store impossible to browse due the massification.

  15. Bruce – I presume the reason for no (direct) access to Cocoa APIs is that this is not about using ActionScript 3.0 as a development language, but about Flash developers to re-use the same code, and the Flash APIs they know – on the iPhone – using native APIs would remove that portability.

    However, I still remain suspicious of ‘cross-platform’ development tools – the BBC’s iPlayer app is written in Adobe AIR and – of course – it has a ‘Settings’ tab in the app window, rather than a Preferences under the file menu.

    But then I’m suspicious of web apps in the same way – they give too much freedom to designers – there is no ‘Web HIG’.

    Which may sound ridiculous, but I’ve become aware how much the strength of OS X is around the consistency between applications – a feeling that operations (like drag’n’drop) will actually work, etc. In contrast, an internal user was surprised when I drag’n’dropped within a Flex application, because it wasn’t something they expected to do within a browser window. Even with HTML 5, until it’s 100% consistently used, it’s going to be a frustrating business of not knowing what behaviours will work on any given page – which means that you tend to fall back on the lowest common denominator.

    To me, that’s a step backwards – as if we threw away the idea of standardised keyboard shortcuts and went back to everyone inventing their own (‘a victory for the freedom of developers’). Although that does remind me of cross-platform apps that insist on using CTRL rather than CMD based shortcuts.

    Now, as yet, we’re not seeing those differences between mobile phones – I can’t think of gestures that have different meanings.

    Anyway, that’s an aside from whether Flash-to-iPhone will be any good, and Windows and the Web says I’m wrong – most people don’t care about consistency between their apps.

  16. Sorry for being an ass but the actual saying is the “proof of the pudding is in the taste” not the “proof is in the pudding”. Maybe its anal, but the real quote is far more appropriate for making your point. Your customers taste the finished product, they don’t disassemble it to see how it was made.

    Don’t bother with more commas though. We are good at parsing!!

  17. Well said, don’t worry about the commas I read it fine. My thought on is this, is that whatever the outcome the platform will be stronger for it. Which is a win win for the users and developers.

  18. JulesLt has hit it right on the target – any “cross-platform” kit isn’t going to deliver an experience that respects the platform. The only benefit it has is that it’s easy for the developer.

    But it’s not about what’s easy for the developer, but rather what delivers a consistent UI and experience for the user. It’s not about you, it’s about the user. (read that again)

    We don’t want the Mac to become a UI free-for-all. And, just like their own apps have become a UI junk yard filled with let’s-see-how-low-we-can-set-the-bar, Adobe has allowed other developers to do the same with AIR.

    Sure, you can say they’ll just use it for puzzle games, but there will most likely be a few who will try to imitate the Cocoa UI, and we’ll have an “uncanny valley” issue, just like with Mac apps ported from other platforms.

    It’s cool if you want to use other languages for the iPhone or the Mac, but please make sure to respect the native frameworks and UI. Don’t try to roll your own imitation of it, because it won’t end well. And performance matters, too. It’s not about what’s easy/fast/cheap for you. It’s about making an experience that fits the platform it’s on, and works well, and runs fast.

    Flash doesn’t do any of those things.

  19. Guy, I found myself having to reread at least one sentence in your post, mentally inserting commas in an attempt to disambiguate the meaning. I was therefore happy to see erdenfeind’s suggestion in the follow-up comments. You’re a good writer with – judging from the few blog posts I’ve read – something meaningful to say. I humbly suggest taking constructive criticisms in stride.

  20. Darren, I was kidding. I’d not have approved nor wrote a response if I’d taken it poorly. The joke was that, yes, that piece is basically an unrefined rant.

    So, there, we, are.

  21. I think the technology is kind of cool, but the argument that Flash on the iPhone is a good step for video games is completely wrong.

    We’ve had a great video game development tool chain for a couple of years now that currently supports building for Windows, Mac, iPhone, and the Wii. Disclaimer: I don’t work for this company. I just think it’s better than what people are proposing to do with the iPhone target for Flash. The name of the software is Unity (

    Great post.

Comments are closed.