Universal Binary Guideline Notes
June 07, 2005

Richard Buckle has posted some useful notes on Apple’s newly published Universal Binary Guidelines.

I’d add a couple of things:

Move On Up

Migrating to XCode/Mach-o is all very well, but my gut feeling is that the higher level language you are using, the less pain you are likely to suffer, so I would change the emphasis slightly.

If you are still using Carbon plus C/C++, consider moving to Cocoa plus Objective-C, Java or Python. This is only repeating what Apple have been saying for a while.

Let Someone Else Store Your Data

I concur completely that byte swapping will be the big deal. All of my decade of (often painful) experience working on cross platform projects and porting games tells me that most of the hard work comes in this area (alignment and other things may affect performance, but byte swapping will introduce most of the bugs).

The best way to minimize the pain is to move to some sort of structure storage library. I suspect that people using Core Data, or one of the object persistence APIs in java or python will win big here - always assuming that the maintainers of whatever they are using do a good job!

Short of that, write your own simple API for file operations, add an endian tag to your file formats, and make sure that you stream data in and out of your API in primitive sized chunks (ie pack/unpack structures rather than writing them directly), so that they can be auto-magically swapped later.

« Feed Me: Bayesian News Filtering Open Source Licensing »
Got a comment on this post? Let us know at @elegantchaoscom.