A year ago, Apple released the Swift programming language to the public. Not long after that, Microsoft open sourced the .NET Framework . And almost as if in rebuttal, Apple just announced that Swift too will be made open source . Plot twist after plot twist.
Here are two companies that sit at the top of the technology food chain, both known for their proprietary schemes and designs. To see them officially adopt the open source philosophy , at least to some degree, feels extremely out of character for both, but it’s ultimately good news for all of us.
It’s nothing short of monumental, marking a huge milestone in the evolution of the programming industry. Even if you aren’t a programmer yourself, these developments will impact you. Want to know why and how? Keep reading.
What the Heck Is Swift?
Have you ever wanted to create an iOS or OS X app ? You wouldn’t be the first, considering how widespread the Apple ecosystem is and how profitable those users can be when it comes to app purchases.
The one big problem, until recently, was that Apple apps had to be coded in Objective C, a not-so-modern programming language that lacks the relative user-friendliness of alternatives like Java, C#, and Python. Swift aims to address that, and more.
Long story short: Not only can Swift get more done in fewer lines of code than Objective C, the language itself is less prone to bugs and errors. For app developers, this means a drastic reduction in overall development time and stress:
Lyft asked one of its engineers to begin experimenting with Swift about six months ago. It soon decided to rewrite its entire app with the language and expects to complete the process in July.
The ride-hailing app coded in Swift will have only about one-fifth the number of lines of code as its previous iteration, and subsequent updates will also take less time.
“Going from months to days is pretty nice,” Morelli says. “That’s the main benefit.”
Seriously, these benefits are not being exaggerated. One of the largest programming communities on the web, StackOverflow, ran a survey for developers and found that Swift was the most-loved programming language of 2015. For a language that’s barely a year old, that’s a massive accomplishment.
As of now, Apple supports both Objective C and Swift for app development.
Give it a few more years, however, and it seems a guarantee that Apple will completely drop Objective C and shift everyone over to Swift. When that happens, Objective C may finally be put to rest for good.
Open Source: What It Means For Swift
According to the official Swift 2.0 release, here’s what Apple means by “open source”:
- 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.
So what’s the big deal here? The fact that Swift is now open source doesn’t mean anything on its own. It’s the implications that we care about, which is why our attention should be trained on bullet point number four — the compiler is now open source.
Here’s the thing about Apple: up until now, if you wanted to develop apps for iOS or OSX, you had to develop on an Apple system. You could write code on Windows or Linux, but you wouldn’t be able to compile that code unless you were on a compatible system. Compiling is the process of translating written code into an executable that computers understand.
Some people have tried to get around this by reverse engineering the Swift compiler. When you know how the language is supposed to work, you can theoretically write your own compiler that translates written code in the same way. There are lots of nuances to consider, though, and no third-party compiler will ever be as accurate as the official one.
But now that the inner workings of the Swift compiler are open to the public, third parties can produce a compiler that recreates the exact same translation as the official one. The result? Developers will soon be able to develop iOS and OS X apps on non-Apple systems and have assurance of 100% compatibility.
It goes even further. Up until now, Swift could only be used to develop iOS and OSX apps. Now that the language has opened up, it can be forked in ways that allow Swift to be used elsewhere. Maybe in the future, Swift will be used for Windows applications, server daemons, or client-side web apps.
And if you, as a developer, find flaws or performance issues in the language, you have full capacity to browse the language’s source code and contribute improvements. You, along with every other brilliant mind in the world, can have a say in the direction of its development.
One indirect-but-still-important benefit is that other languages can now improve themselves based on the design and implementation of Swift. Without a doubt, this is a huge step forward for all programmers.
How This Benefits You and Me
Everything above is like a candy shop for programmers, but most of us aren’t programmers and these details may be flying over your head. We don’t care as much about making apps as we do about using the ones that are on the app store. So, do we have reason to celebrate?
We sure do.
Almost immediately, this is going to bring in a flood of new developers who have always wanted to create iOS and OS X apps but couldn’t due to ideological differences or lack of proper resources. If Swift really does take off now, which it seems liable to do, then you can expect a lot of great new apps to come out over the next few years.
Also, as mentioned before, since Swift will usher in faster development times over Objective C, you can expect apps to be less buggy overall and patches to be pushed out much faster than before. Coupled with the forthcoming release of iOS 9 , things are looking up.
How excited are you about Apple’s future? If you’re an app developer, will you be tinkering with Swift any time soon? Tell us what you think in the comments below!
Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.