maciek905 - Fotolia

Why Apple is wooing open source developers with Swift

Apple is among the most closed of tech companies, yet it is serenading open source with its Swift programming language

This article can also be found in the Premium Editorial Download: Computer Weekly: Apple lures open source developers with Swift

It seems developers love Apple. Go to any developer conference and the Apple logo shines like a badge of honour on the back of their laptop screens. Now it seems this love is finally being reciprocated.

Chris Wanstrath, CEO and co-founder of the open source code repository GitHub, told delegates at the European GitHub conference in Amsterdam that Apple is starting to embrace open source. He specifically highlighted the work that Apple has been doing on GitHub, as a shining example of its new ways of working.

“Open source is a lot more than an ideology. It is a great way to build software. Companies see the benefits of open source," he said.

Wanstrath said he was particularly impressed by Apple’s approach to the open source community with its new programming language, Swift: “Apple’s Swift is a new open source project. It is a great open source project and is fostering a great community defining great open source standards.”

Specifically Apple has issued a code of conduct for people who wish to contribute. This states: “The Swift.org community has the singular goal of making the world’s best general purpose programming language. Collectively we will develop the language in the open, with contributions from anyone who wishes to participate.”

Apple explicitly states it will work with the Swift community to add new capabilities to the language, and make it available to more developers across more platforms.

On its GitHub page, Swift is described as, “a high-performance system programming language. It has a clean and modern syntax, offers seamless access to existing C and Objective-C code and frameworks, and is memory safe by default.”

Read more about open source development

Open source is not just about free code. It also offers a way to collaborate and share best practices.

It’s round two in the fight between open source and commercial software, and open source is punching well above its weight.

In essence, Swift is a programming language for MacOS, iOS and Linux. There is no version for Windows or Android yet. The code is licensed under the Apache 2.0 licence with what Apple calls a Runtime Library Exception. The GitHub entry states: “This removes the attribution requirement when using Swift to build and distribute your own binaries.” In effect, apps and applications built using the Swift runtime remain the property of the original developer.

The list of contributors to Swift include many from Apple, but there are also email addresses from Paypal, DropBox and a few educational institutes, suggesting the project has a broad base of contributors.

Wanstrath said: “Apple is being open with its business goals and is not keeping quiet. Everyone know Apple wants to make Swift a great programming platform so it can continue to sell more iPhones. But as a developer who wants to make my living off this ecosystem I am okay with that.”

Even Microsoft is going open source

It is a similar story at Microsoft, which has put .Net into the open source community. People may be concerned that Apple and Microsoft and other technology giants that contribute open source may be pushing their own agenda. But this may not be such a bad thing, according to Wanstrath.

He said: “Their agendas are aligned with doing the right thing and there are a lot of companies who now realise that doing the right thing is what makes them money.”

There was a time in the evolution of open source where commercial organisations tried to steer projects in a particular direction, but Wanstrath believes that phase is now over. Instead, he said the community will support a company that is upfront with its business goals.

There is a reason Microsoft is becoming more open. It is not because there’s a hippy running it but because being open is a better business strategy
Chris Wanstrath, GitHub

When .Net was released as open source Microsoft had a roadmap of business goals it wanted to achieve with the code. “One of these was to run .Net on Linux. The implication of this is that Microsoft can get more developers building on Microsoft software and paying for Azure cloud services. The community made .Net run on Linux,” he said.

“By making their agenda open and being honest about their objectives – Microsoft wanted to put .Net on Linux to make more money – they find there are a lot of developers who will pay for it and work with the company on the project.”

According to Wanstrath, keeping platforms locked down and closed is failing. “There is a reason Microsoft is becoming more open. It is not because there’s a hippy running it but because being open is a better business strategy.” And clearly the same applies to Apple.

The success of a software platform is proportional to the number of developers that use it. Apple clearly wants to attract the best developers in the world to create new apps and desktop applications, which showcase its latest iPhones, Apple Watches and MacBook devices.

It may well be a dance with a commercial agenda foxtrotting around freeform openness in the community. There is certainly a degree of selfish motivation among companies like Apple and Microsoft, as open source gives these companies a way to attract far more developers than they could have done in the past. At least for now, the open source community is benefiting from their contributions.

Read more on Open source software