Search This Blog

Friday, September 5, 2014

SWIFT - The new programming language by Apple

Swift is a new programming language for developing apps across Apple’s platforms OSX and iOS in a fantastic way. Apple has announced it recently in its annual Worldwide Developers Conference (WWDC), held in June this year.
It has been almost around two decades Apple used Objective-C as its programming language of choice, and till now most of the apps on Apple devices have been built using it. But now Swift is looking to replace Objective-C as the main language for the future of Apple software development. According to Apple, their new programming language is superior to the predecessor, i.e. “Swift is Fast, Modern, Safe and Interactive”.
Swift is the result of the latest research on various modern languages, such as Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, JavaScript, Go(Golang), and others, which makes it the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language.
Developers will be provided significant speed advantages by Swift. As an example, a complex object sort will run 3.9x faster than an implementation of the same algorithm in Python (a blazing fast scripting language). That is also faster than Objective-C, which is 2.8x faster than the Python version. In addition, using the incredibly high-performance LLVM compiler, Swift code is transformed into optimized native code, i.e. it supports Cocoa and CocoaTouch development (so both iOS and OS X development is possible).
Swift integrates with a new innovative development feature of Xcode, called ‘Playgrounds’, which makes writing Swift code incredibly interactive by instantly displaying the output of Swift code, i.e. type a line of code and the result appears immediately. This will allow developers to test code fragments without having to recompile an entire complex project.
A unique aspect of Swift is being its concise coding, i.e. you do not need to write much to get a lot done. For example, adding a single character can replace what used to be an entire line of code in Objective-C.

Apple has recently published a 500-page guide in the iBooks Store, for learning more about Swift. In addition, Swift is included in the Xcode 6 beta, which developers can download and get started now. Swift eliminates entire categories of common programming errors, which helps developers write much safer and more reliable code.

For more interesting topics, please visit www.dsource.co/blog/

No comments: