Apple triggered much buzz among computer enthusiasts when they released Swift, a new programming language to create iOS and Mac OS X apps. The new language is designed to be modern, fast, and easier to learn than the code commonly used today.
The popularity of dynamic and user-friendly programming languages, like Python and Ruby, has grown throughout the developer community in recent years. Swift is estimated to be another step in that direction. Swift is the successor to Apple’s Objective-C, which is what, is currently used to create Mac apps. The new language includes full support of Cocoa and Cocoa touch (the frameworks for iPhone apps and Mac OS X apps, respectively) so apps can be designed for iPhone, Mac computers, and iPads. Apple has been using Objective-C for 20 years, but a company representative stated that it is starting to show its age.
Apple stated that Swift is designed primarily for safety, improving memory corruption bugs caused by multi-threaded coding. Some of those who have experimented with the new code say that it is much easier to read. The computer company said that named parameters are expressed in a cleaner syntax that makes APIs in Swift simpler to maintain and read. Swift has a collection of new features that include generics, functional programming parameters, structures to support methods/extensions/protocols, tuples and multiple return values, and closures unified with function pointers.
Swift, as its name would suggest, is built to be fast. By utilizing the optimized LLVM compiler, Swift code is translated into streamlined native code that gets the most out of modern iPad, iPhone, and Mac hardware. The syntax of the code is designed to be an obvious representation of what you want it perform. The code provides object-oriented features like classes, methods/protocols, and generics. Swift includes a Read-Eval-Print-Loop (REPL) to optimize debugging within a program. While the app is running, developers can evaluate and interact with it, and write new code to see how it works within a script-like environment. Swift is available for learning and use today. Those who want to test the new code simply need to download the Xcode 6 beta.
Apple created the code after extensively researching what developers like, or more importantly, do not like about current programming languages. According to Apple, Swift is the modern programming language for the modern developer. Swift uses the same LLVM compiler that Objective-C currently uses, so programmers can run Swift, Objective-C, and C code, all in the same program.
Swift also has a new feature called Playgrounds, which provide users with live feedback as they code, making it possible to test exactly what is going to happen inside an application. Playgrounds also give complete control of time inside a program so users can see what their code is doing moment by moment. Apple has made a guidebook available to developers on iBooks for Swift, and they will be able to submit applications created by the newly developed language on the day that the computer manufacturer launches OS X Yosemite and iOS 8.
By Andres Loubriel