S Link
The Swift Algorithms Book (50% off)
Written for students and professionals, The Swift Algorithms Book blends modern code, illustrations and computer science to help you pass the interview or build your next app. Perfect for the classroom or the office, the book takes a fresh approach to explain concepts that power search engines, databases and social networks. Use code coupon code OPENSOURCE at checkout to receive a 50% discount!
Super Easy iPhone Apps β Course Closing Monday 12/7/15
Join the Ultimate Swift Beginner Course Series for making iPhone apps taught by former Apple employee, Paul Solt.
Today is your last chance to pre-order the complete Super Easy iPhone Apps, originally sold as part of a Kickstarter campaign:
"After tonight (12/7/15), Iβm closing early access to the course because I want to work actively with the enrolled students to fine tune the materials as they overcome common obstacles and barriers to entry."
Super Easy iPhone Apps is designed with the beginner programmer in mind: itβs accessible, easy to follow, project-based, and divided into manageable segments that even someone with very little programming experience will be able to understand.
The next 12 students who enroll before it closes will also receive direct access to instructor Paul Solt through 1-on-1 interactions. Join now to take advantage of this exciting last-minute perk!
Apple News
Welcome to Swift.org
Here it is! The official site for open source Swift!
"The goal of the Swift project is to create the best available language for uses ranging from systems programming, to mobile and desktop apps, scaling up to cloud services. Most importantly, Swift is designed to make writing and maintaining correct programs easier for the developer."
Other Cool Stuff
The History
initial checkin, nothing much to see here.
One of the coolest parts about the way Apple open sourced Swift is that they included the complete history of all the commits! So of course several of us have ventured all the way back in history to July 18th, 2010 - the initial commit from @clattner_llvm - nothing much to see here π!
int main() {
}
As @nuthatch points out - this is a great reminder that big things have small beginnings. Start.
Fix a typo
For those making fun of all the PRs about typos, as @_matthewpalmer points out, the first Swift commit by someone other than @clattner_llvm was to fix a typo!
"Making small improvements is the way everyone starts getting involved!" - @clattner_llvm
The Future
Swift Programming Language Evolution
We no longer have to wait until WWDC to get the big reveal for what's new in Swift. You can see the roadmap (and contribute to it potentially) right in the open. Amazing!
And of course, you can now asses the risk of using Swift in your company / app! On that subject, I tend to agree with @ayanonagon:
"Looks like 3.0 will require a bunch of changes, but if itβs anything like 1.0 to 2.0, itβs going to be so worth it."
Changing Swift: Whatβs coming up in 2.2 and 3.0
Great summary of the upcoming Swift changes and what they mean by @ericasadun.
Swift 3.0 promises ABI stability: βSuccessful ABI stabilization means that applications and libraries compiled with future versions of Swift can interact at a binary level with applications and libraries compiled with Swift 3.0, even if the source language changes.β
Craig Federighi talks open source Swift and whatβs coming in version 3.0
βThe Swift team will be developing completely in the open on GitHub,β Federighi told Ars. βAs theyβre working day-to-day and making modifications to the language, including their work on Swift 3.0, all of that is going to be happening out in the open on GitHub.β
Incredible to see a high-up Apple Executive say this!
On Open Source
The OpenSource Experience
Amazing story about @aligatr's experience in Open Source. When I first started to code, I thought only amazing magician developers contributed to open source, but with more experience, I realized that most open source projects grow from small changes accumulated over time from a lot of people. I am as proud of my PRs that have fixed READMEs just as much as my slightly bigger contributions.
The thing that stands out from the blog post is the importance of having a community that is supportive and helpful (good job CocoaPods team π!):
"Instead of telling me my code was not good, they told me how to improve my Ruby skills and how I could improve my code in better ways. They even helped my setting up my Ruby environment (as I had problems running the Unit Tests and understanding how this was organized at first)! It was very heartening and encouraging and made me want to do more.
As a matter of fact, I literally learned to do Ruby by contributing to CocoaPods, learning along by doing Pull Requests."
I hope the Swift open source community evolves to be as helpful, supportive, and kind to each other. Releasing Swift with actionable community guidelines is a good first step in that direction by Apple.
"When working on an OpenSource project, the community is very important. A welcoming community β that follows a nice code of conduct and helps newcomers β changes everything. Understanding that not everybody has the same skills as you but wants to improve is way better."
Thoughts on Swift, first pull-requests, and the FOSS community.
If you want to be humbled, here is a tool to see your first pull request! Mine was adding myself to a party guest list... π¬. Remember that those contributing things like typo fixes today, could be committing a lot more substantial PRs down the road if they feel welcome in the community.
How To Contribute
Love these ideas for contributing beyond a typo fix:
- Search for FIXME in the code base and make the fix - @ayanonagon
- Add more Unit Tests (something I wrote down as my personal strategy) - @KostiaKoval
- Fix bugs! Yes, Swift bugs are tracked publicly via Jira!
- As many have noticed, the Foundation Project has a lot of
NSUnimplemented()
. Instead of complaining (or worse, laughing about it), contribute to it! The nice things is that it's in Swift - you don't need to know C++. Here is a great example PR from @simjp! - For larger changes, write a proposal and ask for reviews from the community - amazing example by @ericasadun
Swift.org - Getting Started
Instructions on downloading Swift 2.2 and setting it up! Get the latest development snapshot here.
Make sure to read the API Design Guidelines - amazing tips on code clarity for every API developer:
"If you are having trouble describing your APIβs functionality in simple terms, you may have designed the wrong API."
How to compile with Xcode and Swift 2.2
Power tips and gotchas on how to install Swift 2.2 from someone who's actually tried it!
Inside Swift
Open-source Swift: Booleans
Amazing write- up by @gregheo about the actual implementation of Bool in Swift. I love how simple and complex this is at the same time!
"Lifting up the covers of a fundamental type such as Bool offers plenty of coding tips and implementation details."
Error Handling Rationale and Proposal
Fascinating read from the actual Error Handling proposal for Swift 2.0. You can see how much thought went into it for yourself!
"There's no compelling reason to deviate from the throw / catch legacy here. There are other options, like
raise / handle
. In theory, switching would somewhat dissociate Swift from the legacy of exceptions; people coming from other languages have a lot of assumptions about exceptions which don't necessarily apply to Swift. However, our error model is similar enough to the standard exception model that people are inevitably going to make the connection; there's no getting around the need to explain what we're trying to do. So using different keywords just seems petty.Therefore, Swift should provide a throw expression. It requires an operand of type
Error
and formally yields an arbitrary type. Its dynamic behavior is to transfer control to the innermost enclosingcatch
clause which is satisfied by the operand. "
SPM
The open sourcing of a Package Manager π built mainly by @mxcl & @mattt was a huge surprise when Swift.org went live. You can view the Swift Package Manager Community Proposal proposal here.
"Package managers play a significant role in modern language ecosystems, and are as varied as the languages for which they are created. We designed the Swift Package Manager to solve the specific challenges of distributing and managing Swift code, drawing upon ideas we've seen from other systems and improving upon some of their shortcomings.
This initial release is just a starting point, and we invite you to help us to build the best tool possible. "
While this is just the start, once the Package Manager gets integrated with Xcode, it could be the official replacement for CocoaPods and Carthage in the longer term. Great discussion from CocoaPods core members here and here.
To use a package, check out Apple's example deck of playing cards package here. The community has already started to add Package support. Here is a curated list of Swift libraries that could be build using the Swift Package Manager. Don't worry though, there is already a library to generate podspecs from Swift packages.
Swift Package Manager
How to make a package for the Swift Package Manager (SPM)... Just add a Packages.swift
manifest file and a Source folder!
Linux compatible Swift and Swift Package Manager
Attempting to make Swift code work on Linux using SPM... still a work in progress.
Other Platforms
β[Windows support] wasnβt something that in terms of us catalyzing this initial release that we wanted to take on directly,β Federighi told us. βWe think Linux and of course our platforms provide a great foundation to get started. But weβre very open to ports to other platforms being contributed to the core project, and certainly given that LLVM, Clang, and LLDB, which are foundational technologies to Swift, are already available, already ported to Windows. I think itβs foreseeable that someone in the community, whether led by Microsoft or others, would be doing that port.β - Craig Federighi
The community is already building! Check these out:
- docker-swift - Docker Container for the Apple's Swift programming language (tweet)
- swift-buildpack - Heroku buildpack for Swift (tweet)
- Partial FreeBSD Support - This provides a non-controversial baseline for FreeBSD support. (tweet)
And here are some bigger projects to watch:
Swift @ IBM
We knew about Apple's partnership with IBM, but WOW, this is HUGE. IBM is going all in on Swift, including working on extending it to the server and releasing the IBM Swift Sandbox:
"The IBM Swift Sandbox is an interactive website that lets you write Swift code and execute it in a server environment β on top of Linux! Each sandbox runs on IBM Cloud in a Docker container. In addition, both the latest versions of Swift and its standard library are available for you to use."
You can now officially write Swift on your iPad!
Perfect: Server-side Swift
"Sean Stephens wants to take Swift further still. He wants to take it into the massive computer data centers that drive our mobile apps and websites across the Internet. This week, Stephens and his new company, PerfectlySoft, released a version of Swift that runs not just on the iPhone and other personal devices, but on the computer servers that deliver data and services to these devices.
This creation is called Perfect. The idea is that coders can now use Swift to build both a mobile app and the server code that drives the app from afar. βFor anyone building an app, itβs in their best interests to use one languageβand the same codeβon the front end and the back end,β Stephens says." - Wired
Swift Thoughts
Welcome to the SWIFT IS OPEN SOURCE EDITION πΎπ₯πππ―π¦π₯πππ!!!!!!!!
Thank you Apple team for all your hard work and going above and beyond in open sourcing Swift πππ
"Today is the result of an amazing amount of work by dedicated and phenomenal teams of people across Apple. Proud to be part of the team!" - @clattner_llvm
Here are some cool facts about the new and exciting open source Swift!
- Swift has already surpassed Go, Ruby, Rust, PHP, Scala, and every other language on Github - it's #1!!!
- 247 Pull Requests have been merged! So keep contributing! The team is listening! (even at 10pm on a Saturday)
- Apple has released 17! Open Source Libraries, including Foundation, a Swift Package Manager, the Swift Evolution Roadmap, Code Examples, and more!
I cannot be more excited to see Swift evolve in the next few months (and to hear about it at try! Swift in March!). There is already so much awesomeness from this amazing community in the past few days, I've created a custom newsletter just for this week.
Happy Swift Learning!