Thursday, July 29, 2010

Mac OS, iOS, XCode4 and Foundations/Frameworks

WWDC10 videos provides a wide range of detail information about Mac OS and iOS, mainly for Mac and iPhone developers. Not only did I enjoy so much learning the new frameworks and technologies from those video sessions, but I also gained better understanding of the evolution of Mac OS and iOS, as well as the foundations or building bricks behind them.

Core Building Brick of Mac OS X and iOS

When Mac OS X Snow Leopard was released on August 8, 2009, I was amazed by its great offer: to give me back hard drive space, as I made a note in my mac blog. I got 11GB space back after I updated my OS X to Snow Leopard.

I was puzzled by this result. For sure, I guess that Apple must have done tremendous work to fine-tune its core OS engine in many ways such as rewriting its OS to optimize OS frameworks. WWDC10 reveals more information on how this was done. Apple has rewritten its compiler. The Snow Leopard was built on the new compiler LLVM, and iOS on its way from GCC to LLVM. With LLVM and Clang (compiler front end for C/C++ and Objective-C), Apple said that OS X was reduced in file size by 27%.

Compiler is the fundamental tool to convert source codes are converted into a binary language that a computer machine understands. Windows or Mac OS are built by compilers. No matter what languages we use, or whatever frameworks we have a in a language, eventually they will be compiled into machine language as packages. I think that Apple is right on the key point to restructure its compiler on assembly or machine codes. It is really hard work but all the effort has tremendous water ripple effect on Mac OS and Apple's future.

According to Apple's developer web site on What's New in XCode4, LLVM compiles codes twice quickly as GCC. The new compiler generates optimized machine codes tailored to today's modern chip architecture with a set of highly optimized libraries. As a result, the compiled applications run faster than GCC's as well.

That's why I call it as Mac OS' core building brick.

XCode4

Snow Leopard OS X has been in use for about one year. It has been approved as a solid and great OS. Now it is time for Apple to move on.

XCode 3 has been used as an IDE for developing Mac and iPhone applications. WWDC10 revealed a new beta XCode4 released for paid developers. Basically XCode4 is built based on LLVM and LLDB (as debuger). The compiler has a parser part to process source codes. XCode4 utilizes the parser to provide right and accurate information about source codes with the most advanced technology and architecture built in LLVM. As a result, XCode4 provides a much better development environment and tools for developers, than the current XCode3. For me, this is a great news. I just cannot wait for its release.

Other Foundations/Frameworks

WWDC10 reveals many other new foundations/frameworks for iOS. Most of those foundations/frameworks have been available in Mac OS since the Snow Leopard release. Those foundations/frameworks provide various ways to felicitate mobile application development, some of them with lower access to Apple's hardware, and some new ones are specially for iOS such as multitasking, iAd, GameKit, and more.

Many of new features in iOS are from Mac OS X or Snow Leopard. For example, blocks are very powerful feature in Mac OX and now available in iOS. It makes multitasking much easy to implement and many other foundations/frameworks with blocks are available as they are.

EventKit.framework provides interfaces to access calendar events on devices.

The Core Motion framework (CoreMotion.framework) provides a single set of interfaces for accessing all motion-based data available on a device. The framework supports accessing both raw and processed accelerometer data using a new set of block-based interfaces.

iAd. Framework provides simple interface APIs for developers to to deliver banner-based advertisements from their applications.

Graphics and Multimedia frameworks provides APIs in either Objective-C or C level APIs to access to graphics, video and audios devices.

GameKit provides multi-player capabilities to mobile game applications with peer to peer network connectivity, using a Bluetooth connection - no pairing required. In addition to that, it provides scores and achievement rewards to users.

iOS provides over 1500 new APIs and above are just a few of them. Refer to Apple web sites for more detail information such as What's New in iOS 4.0.

0 comments: