Apple shows off Swift, its new programming language

Successor to Objective C has "none of the baggage of C."

Apple announced on Monday that it has developed a successor to its venerable Objective C with a language it's calling Swift. Providing a new language with "none of the baggage of C," Swift code can still be mixed with standard C and Objective C code in the same project.

Further Reading

OS X 10.10 gets a new design that borrows from iOS 7 without cloning it.

Swift seems to get rid of Objective C's reliance on defined pointers; instead, the compiler infers the variable type, just as many scripting languages do. At the same time, it provides modern features similar to those found in C++ and Java, like well-defined namespaces, generics, and operator overloading. From the few fragments of code shown during the demo, Swift appears to rely heavily on the dot-notation that Apple introduced in an earlier iteration of Objective C.

The new language will rely on the automatic reference counting that Apple introduced to replace its garbage-collected version of Objective C. It will also be able to leverage the compiler technologies developed in LLVM for current development, such as autovectorization.

Apple showed off a couple of cases where implementing the same algorithm in Swift provided a speedup of about 1.3X compared to the same code implemented in Objective C. It also showed off a Swift "playground," where code is compiled as it's typed and the output is displayed in a separate pane of the editing window. The goal here is to allow developers to test code fragments without having to recompile an entire complex project.

Use of Swift will be supported as soon as the next version of Xcode is released—it's currently available in beta form to registered developers, and will presumably see more widespread release during OS X Yosemite's public beta later this year. Apple also promises to release a free iBook on the language's syntax later today.