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?
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 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?
More InformationApple may regret its choice of a permissive open source license for the Swift programming language Related ArticlesAndroid And iOS Apps For Windows 10 Survey Reveals Developer Preferences Swift for Programmers (Prentice Hall) Udacity Launches iOS Developer Nanodegree Swift Pocket Reference (O'Reilly)
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
Comments
or email your comment to: comments@i-programmer.info
|
Last Updated ( Friday, 12 June 2015 ) |