Apple has announced Swift, a new programming language for iOS and OS X. Designed for Cocoa and Cocoa Touch, Swift combines the features of compiled languages with the simplicity of popular scripting languages. The company says that Swift eliminates "entire categories" of common programming errors as it also coexists with Objective-C code, so developers can integrate Swift into their existing apps.
"Xcode Playgrounds make writing Swift code interactive by instantly displaying the output of Swift code. iOS 8 also includes Touch ID APIs enabling developers to authenticate users within apps, protect logins and user data, and unlock keychain items. With iOS 8, developers can provide authentication with a successful fingerprint match while keeping your fingerprint data safe and protected in the secure enclave," said the company.
A beta version of Swift is available immediately for iOS and OS X Developer Program members at developer.apple.com. The final version will be made available this fall, and apps written in Swift can be submitted to the App Store and Mac App Store when iOS 8 and OS X Yosemite are released.
Swift was built to be fast. Using the high-performance LLVM compiler, Swift code is transformed into optimized native code, tuned to get the most out of modern Mac, iPhone, and iPad hardware. The syntax and standard library have been tuned to make the most obvious way to write code also perform.
Olly Berry, head of iOS at mobile application development company Mubaloo spoke to Dr. Dobb's directly to say, "From what we saw briefly in the keynote, it looks like it should be pretty quick for iOS developers to pick up Swift. In many respects, it appears to be a natural evolution in programming terms from Objective-C. I don't necessarily think it's going to be any easier to learn than any other modern programming language, so novice developers will still have to go through training."
Berry continued, "My early feeling is that it won't make developing apps much quicker; it will, however, give us powerful new ways to write better code that compiles and runs faster; it won't slow us down. Swift should tighten the feedback loop between writing code and seeing its effect in real time and allow for faster prototyping. I'll be encouraging my team to start learning Swift immediately so we're all up to speed by the time iOS 8 is released, and of course we'll be able to use it side-by-side with Objective-C/C anyway."
Dr. Dobb's newsdesk wanted to hear more. We spoke to IDC software application development favorite Al Hilwa. "It is the golden age of the programmer, so it must also be the golden age of programming languages. Computer scientists never tire from creating new languages and this is illustrated by Apple's latest creation called Swift."
IDC's Hilwa continued, "There have not been too many examples of single-vendor-promoted languages achieving wide adoption. Most of the popular programming languages that have come to widespread use, like COBOL, FORTRAN, C, and Java, have had multi-vendor support. Objective-C was catapulted into fame by the unique disruption of Apple's iPhone, and C# was promoted by Microsoft during its pinnacle of dominance as the language for Windows apps."
Would Apple's new Swift be as successful asks Hilwa? That depends on how hard Apple pushes it and how much of the Apple ecosystem apps are still to be written versus have already been written.
He says that Swift has a good chance of being dominant in five years. Programming language skills are hard-earned by developers who invest a lot of time and effort to master. Hilwa's opinion is that the reality is that Objective-C is outdated and complex for new developers, but Apple has worked hard to make great tools for developers and the pull of the platform has been compelling. So compelling in fact, that many Apple developers will likely continue to use it for a long time to come.
Apple also released its iOS 8 SDK with more than 4,000 new APIs. The firm has promised major extensibility features like Notification Center widgets and third-party keyboards — iOS 8 also includes Metal, a new graphics technology that maximizes the performance of the A7 chip.