Swift 2 To Be Open Source
Written by Alex Armstrong   
Wednesday, 10 June 2015

When Apple introduced its Swift language there wasn't much point in being interested in it unless you were an iOS programmer. Now, with Apple promising to open source the new Swift 2.0, the situation has changed. What's in Swift for the rest of us?

swifticon

 

iOS development used to be done in Objective C, Apple's object-oriented version of C. Objective C is a language that seems strange to most programmers because of its strange back to front syntax. However, Objective C has been open source for some time and if you wanted to use it under Linux then you could. This isn't to say that Objective C was enthusiastically open sourced by Apple - it did its best to avoid it and to make it difficult. In particular, it did not release the runtime libraries, only the compiler, making it necessary for the open source community to create its own runtimes. 

When Swift was introduced as a more modern language in which to write OSX and iOS applications, the question was will it be open-sourced?

Now at this year's WWDC, Apple has announded that it will be open sourcing Swift 2 under an OSI approved permissive licence. A Linux compiler is going to be added to the iOS and OSX compilers before the whole lot, compilers and libraries, are open-sourced later in the year. No menton of a Windows or Android compiler, but open source being what it is there is likely to be one for each popular platform in time. The compiler is based on LLVM and so is inherently portable. 

The Swift blog says: 

  • 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.

Swift is a C#-like language - strongly typed and object oriented. Version 2.0, announced at WWDC, introduces new features like a better error handling model and a faster interface with the existing SDKs - which are mostly written in Objective C. 

So are we all going to drop our favourite languages and start using Swift?

No, of course not. As a language Swift isn't particularly innovative and you can find most of its features in C# and alternatives like Python and Ruby are as rich, if not more so, in terms of language constructs. The only advantage Swift has is that people use it to write OSX and iOS applications. The idea of Swift being available on other systems is more likely to encourage people to port their existing apps to these new platforms - assuming the UI and other device-specific library problems can be solved.

Could we see Apple apps on Windows and Android?

Possibly. 

Microsoft has already announced that it is making it possible to port Objective C iOS apps to Windows Phone and having Swift open source makes it possible to take this forward for future apps. 

This all makes one think - "why?"

In particular, why has Apple promised to open source Swift with a permissive licence that allows the likes of Microsoft, Samsung and even Google to take the Swift code base and weave it into commercial products?

 

swifticon

Banner


Pulumi Envisions The Intelligent Cloud
18/09/2024

Today at PulumiUp, its 4th annual conference, Pulumi is announcing "Intelligent Cloud", its vision for AI-powered cloud infrastructure, and two new products, ESC GA and Insights 2.0.  



Microsoft Releases Dev Proxy 0.21
08/10/2024

Microsoft has released an update to Dev Proxy, its command-line API simulator. The updated version, v0.21, adds the ability to simulate authentication and authorization using API keys and OAuth2 among [ ... ]


More News

 

kotlin book

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Friday, 12 June 2015 )