Open Source Swift & the Swift 3.0 Roadmap 🎁

Swift is Open Source!

Finally! Swift is open source, under the Apache 2.0 license. Not only did we get the Swift source code, but also a surprise package manager! The package manager is also open source, so anyone can contribute to what is sure to be the new default dependency manager. We are so excited about this huge open source project! 🎉

Apple also launched swift.org, a new website for Swift with tons of new information. Everyone was so excited about it that it went down for a few hours! The website has plenty of information about Swift, including guidelines for contributing and community guidelines, which are great to see in such an important project.

A Short History of Swift

Chris Lattner, the original developer of LLVM, started Swift at Apple. You can find his very first commit in the Swift GitHub repository! It’s from July 18th, 2010, and mostly just added a bunch of Makefiles. From there, it was only 28,673 more commits until it was time to go public! We’re really excited to see that Apple shared the whole commit history of Swift. It gives all of us huge insight into how the language was developed.

Another interesting bit about the Swift repo is the commit graph. The repository was started in 2010, but started being actively developed in mid-2013, by about 8 core developers and 50 contributors. Chris Lattner said on his homepage that “I implemented much of the basic language structure, with only a few people knowing of its existence. A few other (amazing) people started contributing in earnest late in 2011, and it became a major focus for the Apple Developer Tools group in July 2013.”

Swift Package Manager and Linux Port

One of the important (and surprising!) parts of open source Swift is the new package manager, which is poised to become very important part of the ecosystem. The main developers of the repo are Max Howell, who is most famous as the developer of Homebrew, and Mattt Thompson, of NSHipster and AFNetworking fame.

Swift is ported to Linux too! According to an article on the Swift blog, The Swift Linux Port, the porting is still in progress, but you can already download a binary that works on Ubuntu x86_64. Swift on Linux neither depends on the Objective-C runtime nor includes it. It does include the compiler and Standard Library, and supports most of the Linux C standard library through the Glibc module. Also, Core Libraries provide implementations of core APIs from Foundation, and you can debug using LLDB or use the REPL interactive shell. Linux support is not stable yet, but it will keep improving.

Swift 3.0?!

You can find out how Swift will evolve in the Swift Evolution repo. Swift 2.2, which will be released in the spring of 2016, will focus on fixing bugs, improving quality-of-implementation with better warnings and diagnostics, improving compile times, and improving performance. It may include small new features that won’t break your Swift source code.

The Swift Evolution repo contains proposals for larger changes to the Swift language and standard library. Some of the proposals have already been accepted for Swift 3.0, such as Remove the ++ and -- operators. You can update your code in advance so that you can reduce your work when Swift 3.0 is released.

Swift 3.0, which will be available in the autumn of 2016, will stabilize the application binary interface (ABI), improve resilience and portability, clean up some aspects of the type system, and update the standard library API to match the recently-released API design guidelines.

A Gift From Apple 🎁

Is open source Swift is a gift for developers with time on their hands? Well, some developers are already contributing this project and sent many pull requests!

The Contributing page shows how you can contribute to Swift. It explains pull requests, the mailing lists, bug reporting, CI, commit message guidelines, the code review process, testing, and more. The Swift Evolution Process page explains the high-level goals of Swift and how to participate, including how to propose a change and how it will be reviewed.

Open Source Swift & Realm

We’ve been pretty invested in Swift since day one, with SLUG, Realm Swift, jazzy, and SwiftLint, and now that Swift is open source, we intend to continue our efforts in improving the language and the ecosystem around it. Here are some of the areas we’re hoping to get involved with first:

  1. Decoupling Swift’s dynamic dispatch from the Objective-C runtime. This would simplify the way you define models in Realm Swift. This would mean no need for our custom RealmOptional type and using dynamic var properties in models consistently.
  2. Improving Swift’s runtime reflection capabilities. Addressing existing crashing bugs in Swift’s Mirror(reflecting:) and expanding reflection to support types without instantiating them would allow more flexible models in Realm Swift, like models with custom initializers or required properties without default values.
  3. Integrating official Swift tooling into jazzy & SwiftLint. This would be much easier and more stable than depending on our reverse-engineered SourceKit wrapper. It should also be easier to improve these tools now that we’re not limited by what’s exposed in SourceKit’s APIs.

But that’s just the tip of the iceberg! We’re excited to be a part of the community that helps Swift progress, and we can’t wait to see what everyone does with open source Swift!


Minwoo Park

Minwoo Park