Apple unveils Swift, a new programming language for iOS, Mac

Developers at the Apple WWDC event enthusiastically applauded the introduction of the new Swift programming language

With plans to slowly retire the long-used Objective-C, Apple has introduced a new programming language, called Swift, for designing apps and applications to run on Apple iOS devices and Apple Macintosh computers.

Apple designed Swift to be as intuitive and easy to use as popular interpreted languages such as Python and JavaScript, while maintaining the speed and flexibility of compiled languages such as C++.

"Swift is fast. It is modern. It is designed for safety and it enables a level of interactively and development you've never seen before on the platform," said Apple CEO Tim Cook, who introduced the language to the surprise of the audience at the company's Worldwide Developers Conference, being held this week in San Francisco.

Cook explained that Swift was designed to eliminate entire categories of common programming errors. It includes modern constructs such as generics, closures, type inference, multiple return types, operator overloads and other time-saving capabilities that developers have wanted to see in their languages.

Many Apple developers expressed cheer at the news of Swift. The WWDC audience applauded thunderously upon Cook's introduction to the language. The enthusiasm is understandable given the shortcomings of the aging Objective-C, which was created in the 1980s and came to Apple by way of Steve Jobs' NeXT workstation company, purchased by Apple in 1996.

On Twitter, one programmer expressed satisfaction that Swift could treat emojis -- electronic smileys formatted in unicode -- as variables. Another posted a picture of a Objective-C programming book that had been tossed into a trash can.

Although Apple has done a commendable job of maintaining the language, and its developer ecosystem, Objective-C still suffers from undue complexity in many ways, noted Al Hilwa, program director for software development research at IDC. Objective-C was based on C, a programming language which on its own is difficult to master. Secondly, the approach that Objective C takes to passing messages between an application or within an application is difficult to learn as well.

Swift has all the power of Objective-C, but without the "baggage of C," Cook told the audience. He compared some benchmarks that showed Swift code running faster than Python and just as quickly as Objective C.

Swift may be easier to learn and work with, but it will still take developers time to switch from Objective-C, Hilwa speculated.

Apple is working to make the transition easier, though. Swift code can be run on the same run-time as Objective-C, and uses the same memory management module. It also can use Objective-C's Cocoa libraries. "Your Swift code can fit along side your Objective-C code and C code in the same application," Cook said.

Apple is updating its Xcode IDE (integrated development environment) to include a feature called Playground, which allows the developer to inspect the output of code as soon as it is typed in.

Swift does not appear to be related to another language with that name, designed for writing scripts to run in parallel computing environments.

Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab's e-mail address is Joab_Jackson@idg.com

Join the Good Gear Guide newsletter!

Error: Please check your email address.

Tags Development toolsapplication developmentAppleLanguages and standardssoftware

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Joab Jackson

IDG News Service
Show Comments

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?