You must’ve heard by now that Swift has been open sourced on December 3rd, marking it one of the most important dates in the history of Apple’s developer community. Along with Linux-compatible compiler and standard libraries, Apple released a native package manager, platform-agnostic Foundation, libDispatch and XCTest.
Although this isn’t the first time the giant from Cupertino made a part of its source code public (with notable examples of CoreFoundation, Objective-C Runtime, ResearchKit and WebKit being open source for a long time already) and it’s surely not the first major company to do so (following Microsoft’s .NET and Google’s well-known Android releases), the Swift event marks a new chapter for not only Apple, but also for all developers, coming from various communities.
But what exactly does this mean for the industry and what should we expect from the project in the future? Those two questions will be my focus in the following article.
While Ubuntu has generally low usage share among desktop and laptop computers (excluding developers’ 🤓), it is a no. 2 OS among Linux servers. Ever since Apple announced Linux compatibility at WWDC this year, people started wondering whether Swift will be applicable for server-side backend development.
Now all we can tell is that it’s only a matter of time until a full-featured Swift web framework appears in the market. Oh, there is one already.
The next big and unexpected project that was published is Swift Package Manager, developed mainly by Max Howell, the creator of Homebrew and Matt Thompson, the creator of AFNetworking and Alamofire, who both happen to have ended up at Apple.
The project aims to reduce the process of adding dependencies to your projects to editing a Package.swift manifest and a single swift build command. Well, ideally. Turns out SPM has some troubles building and managing the dependencies and lacks the ability to build dynamic libraries (a.k.a. frameworks), so currently it cannot be used for OS X and iOS development – we have to stick with Carthage and CocoaPods for now.
The Swift Standard Library provides quite a lot of delicious stuff, including strings, numeric types, collections and pointers. But let’s face it: you can’t make a real useful program using just those types.
That’s why Swift team decided to fully reimplement Foundation framework in pure Swift, on top of already open CoreFoundation. Swift’s Foundation, like the language itself, will be Linux-compatible and inside it you may find almost all you need to create a CLI application, i.a.: NSData, NSDate, NSJSONSerialization, and so on. Unfortunately, as of the time of writing this post, not everything has been implemented yet, and many essential classes like NSURLSession, NSOperation and NSUserDefaults are still missing.
As can be seen in the evolution repository, there are two versions of the language already in the plans. The nearest one, minor Swift 2.2, focused on fixing bugs and implementation improvements, is bound to be released in Spring 2016.
What’s more interesting is the next major release, Swift 3.0, which is planned for Fall 2016. Its main goal is to stabilize the binary interface, although the following changes are already confirmed to be included:
Apart of listing what’s coming, the evolution repository also provides a list of out-of-scope ideas for Swift 3.0, which include:
John Siracusa / Ars Technica
As can be seen above, the language creators’ goal for Swift 3.0 is to be a “Snow Leopard” release for Swift, laying down stable foundations for further language development.
And last, but definitely not least, you may contribute your own code! No matter what project you’re interested in – Foundation, standard library, or even LLDB, the Swift team is open for all kinds of contributions – even if it’s just a typo fix. 😉
Swift's comments and test suite are on track to be one of the most correctly spelled and best indented ones in the industry! 🐙🐱— Chris Lattner (@clattner_llvm) December 5, 2015
The Swift source opening is one of the most important events in the recent software engineering history and will definitely impact not only the future of Apple platforms, but also other general-purpose fields.