Apple announced plans to open source its Swift programming language, a move that is sure to enhance the usage of the already popular language.
At the Apple Worldwide Developer Conference 2015, Apple announced Swift 2.0, a new version of the language along with the plan to open source the technology later this year.
Swift is an intuitive programming language for iOS, OS X, and watchOS. Swift builds on the best of C and Objective-C, without the constraints of C compatibility, Apple said. The language adopts safe programming patterns and adds modern features to make programming easier and more flexible.
Craig Federighi, Apple’s senior vice president of software engineering said the company is “stepping on the gas this year with Swift 2. We think Swift is the next big programming language, the one we will all do application and systems programming on for 20 years to come. We think it should be everywhere and used by everyone,” he said.
In a post on the Apple Developer blog, Apple said Swift 2.0 has even better performance than before, a new error handling API, and first-class support for availability checking. And platform APIs feel even more natural in Swift with enhancements to the Apple SDKs, the post said.
“Swift is a well-designed language with a best-of-breed feel to it, gathering features from many languages that have become trendy,” said Al Hilwa, an analyst with IDC.
The open-sourcing of Swift is big for the Apple developer community, as developers will be able to delve into the code, redistribute it and modify or extend it. With more eyes –and hands — on the code, there is a better chance that the language will become even better, many observers say.
“I think open-sourcing Swift would improve the language,” said Igor Perisic, vice president of engineering at LinkedIn, which has developed some apps using Swift. “The key thing is how do you control quality when you are open sourcing a language? Apple is really a full stack, all the way down to the hardware. You have hardware, OS and then languages on top of it. So they can leverage all of that. As they move forward, a lot of people will contribute to it because a lot of people are leveraging the Apple platforms and writing code for it. But how do you keep control of quality and how do you keep control of making sure that later versions of the OS will be fully compatible, etc.?”
Apple has yet to share details on how it plans to proceed with the open source move. However, here is what the company said in the blog post: “Swift source code will be released under an OSI-approved permissive license. Contributions from the community will be accepted — and encouraged. At launch we intend to contribute ports for OS X, iOS, and Linux. Source code will include the Swift compiler and standard library. We think it would be amazing for Swift to be on all your favorite platforms.”
Apple Expects Open-Sourcing Swift Language to Boost Adoption
While some viewed Apple’s announcement as groundbreaking, others saw it as the natural order of things. “I don’t understand why it’s news that Apple is OSS-ing Swift,” said Mike Milinkovich, executive director of the Eclipse Foundation, in a tweet. “They would be crazy not to open source it. What took them so long?”
Apple has high hopes for the language. “We are excited about the opportunities an open source Swift creates for our industry,” Apple said in its blog post. “Baked-in safety features combined with excellent speed mean it has the chance to dramatically improve software versus using C-based languages. Swift is packed with modern features, it’s fun to write, and we believe it will get used in a lot of places.”
Could Swift become the Java of a new generation?
“I’d be excited if this worked the same way as when the community extends Java,” Perisic said. “The nice thing about when you open source something, whatever you did suddenly has a life of its own and you don’t control it anymore. The open source community is going to take into all of these incredible spaces. And it’s going to realize the full potential of what you created. You control that potential at the beginning within the space of your strategic vision. When you put that in the open source community that strategy is blown away. Because somebody may have a brilliant idea and suddenly Swift is a language that controls drones or something like that.”
Meanwhile, Swift is gaining traction among developers, as Objective-C, up to now the primary language for developing iOS apps, is losing steam.
According to the most recent TIOBE Index of the most popular programming languages, Objective-C is the fifth most popular language and falling dramatically, while Swift is the 14th most popular language and rising.
“Objective-C is really going into freefall,” the TIOBE Index said. “The last couple of months it is losing about 1 percent of market share per month. If this trend continues, Objective-C will leave the TIOBE index top 20 before the end of this year. The main cause of this is Apple’s announcement last year to replace Objective-C by its new programming language Swift. The programming community embraced Swift because it fits the bill much better. Apart from this, there is also a trend to use C++ more frequently to program the lower layers of an iOS application.”
IDC’s Hilwa said the outcome of open-sourcing Swift will be determined by the ecosystem.
“In the end how it is evolved and where it is driven by Apple or the ecosystem that forms around it will determine how far the language can go,” he said. “Having it in open source begins the process of ecosystem building. One thing that has helped Java is that it has a strong system of governance which the ecosystem participates in. The other thing that has helped Java is the reach from micro devices to servers. We have to wait and see if Swift makes it into the server world. It is definitely early days for Swift.”