Apple's new programming language Swift has been public for a few short months, but the Apple faithful are already bowled over. They toss around words like "cleaner," "simpler," "modern," and "powerful."
The rest of the world, however, can only speak about Swift hypothetically -- while the coding tools are free, they run inside only Xcode or a Playground, which, in turn, run on only Apple hardware. Of course, if you're really desperate, a clever website lets you try some basic Swift code as long as you don't touch the libraries.
[ Also on InfoWorld: 10 features Apple "stole" for the Swift programming language | Apple's Swift is simple, at first | InfoWorld's "iOS 7 for developers" special report has the scoop on the bells and whistles in Apple's mobile OS -- and how you can harness them. | Keep up with the latest developer news with InfoWorld's Developer World newsletter. ]
This is a bit strange. In recent years, creators of programming languages have gone out of their way to get their code running on as many different computers as possible. This has meant open-sourcing their tools and doing everything they could to evangelize their work.
Apple has never followed the same path as everyone else. The best course may be to open up Swift to everyone, but that doesn't mean Apple will. Nor should we assume that giving us something for free is in Apple's or (gasp) our best interests. The question of open-sourcing a language like Swift is trickier than it looks.
Here are seven reasons why Apple should open-source Swift, followed by seven reasons why it ain't gonna happen.
Why Apple won't open-source Swift: Innovation isn't what Apple really wantsThe syntax looks different and the press releases repeat the word "new" again and again, but at its core Swift is simply a smart business ploy to maintain the status quo and squeeze more life out of existing libraries.
For all of its elegance, Swift is designed to support a world built bottom up in Objective-C. It's meant to play well with the bazillion lines of existing Objective-C, not supplant it. This means Apple gains little from the creative fervor of a new open source project moving in whatever direction the mob wants to take it. Apple wants to keep its hardware running smoothly, not encourage chaotic innovation.
If Apple wants to gain traction in programming courses and among the self-taught, it needs to get Swift running on cheaper hardware. Once kids learn Java on Eclipse, installing the Android Development Kit takes a few minutes. Saving enough money to buy a Mac to install Xcode takes a bit longer. A generation hooked young on Android development could spell rough times ahead for Apple.
Why Apple won't open-source Swift: Markets define what programmers code While there may be truth to the simplicity and economy of cutting one's programming teeth by developing for Android, at the end of the day the students want jobs. iOS continues to generate the most revenue for app developers, and revenue is directly proportional to jobs. Students will always want to learn the platform that supports paying customers, and right now, there aren't as many of those in the world of low-end Android phones. As long as Apple leads, learners will follow -- even if they have to buy expensive hardware to gain entrance to the walled garden.
Why Apple should open-source Swift: With open source, "every bug is shallow" A central tenet of open source is that many eyeballs means all bugs are shallow. Because of this, well-maintained open source code is frequently free of many of the problems that can bedevil new code. The breadth of the community working on the code is great for debugging. Someone makes the mistake, and a person they may never meet fixes it. If Swift wants to move quickly, add functionality, and ensure optimal performance and security, it needs to make it easy for programmers to pore over the code and share their tweaks with everyone.
Why Apple won't open-source Swift: Walled gardens have advantages The open source world may crow about its record, but there's no way to measure the efficiency of bug fixing. Declaring all bugs fixed is equivalent to proving a negative. Ask the folks who trusted OpenSSL all of these years.
A walled garden may ask us to trust a black box that may be riven with bugs and hidden backdoors, but this has an advantage: The bad guys are as confused as we are. Ignorance isn't an advantage to celebrate, but it can be an advantage. Plus, one of Apple's most embarrassing bugs, the "goto fail" travesty, was in the code it open-sourced long ago. How many years did it take the many eyes of the open source community to find it?
Why Apple should open-source Swift: Openness means proliferation and new marketsOnce upon a time, Apple owned the smartphone world. Then Google open-sourced Android and won over an astounding percentage of the marketplace -- 85 percent of new smartphones by one recent estimate. That's a tempting number for developers. Open source offers a stealthy way to infiltrate markets, nurture new devices, and attract plenty of new partners. There are Android televisions, cameras, laptops, and even refrigerators. The biggest news from the iOS world is that the iPhones now come in different colors.
Why Apple won't open-source Swift: Sharing leads to fragmentationSharing may attract greater interest and new ideas, but often this leads to fragmentation and confusion -- or in Android fanboy speak, "device diversity." Why would Apple want to encourage more versions of Swift to confuse people? It's hard enough to support the iPhone 4 and the iPhone 5 at the same time. Android developers curse the endless varieties.
Plus, what if some wonderful new code for Swift runs only on Linux but not Mac? How does that help Apple and its customers? Apple is in the business of delivering smoothly running solutions to everyone, not nurturing a hack fest for programmers.
Why Apple should open-source Swift: Open source ensures a robust tools ecosystemIf you want to develop for Android, you can use any of the tools from the mostly open source world of Java. Eclipse? Sure. IntelliJ? Sounds good? Ant or Maven from a command line? Many people love them. The list of tools for Java is long and filled with plenty of innovation. And here's one important fact about this list: Sun/Oracle didn't build any of them. Open-sourcing Swift would nurture the developer ecosystem and ensure that developers have many more reasons to choose Swift.
Why Apple won't open-source Swift: Openness is a win for AndroidApple may not sell the most smartphones, but it sells its smartphones to those more likely to buy more apps. Numerous studies show that iPhone users spend much more on apps than the vast hordes of Android purchasers -- and that's why mobile developers target the iPhone first, making the App Store a more robust shopping experience. If developers can push one button and deploy Swift code to both the iPhone and Android marketplaces, Apple could very well lose its dominance over the app world. If people can get the same apps on an expensive iPhone or a cheap Android, the low prices will likely win.
Why Apple should open-source Swift: Apple owes it to open sourceApple didn't accomplish all of Swift's glory on its own. It stood on the shoulders of giants. It's not like Apple built gcc or LLVM itself. The foundation of Swift began in the open source world, and it's only right that Apple return the favor by open-sourcing the results of that work. Apple's open-sourced many of its contributions to BSD through Darwin. Why not more?
Why Apple won't open-source Swift: Apple doesn't owe open source anythingYou don't need to make your work open if you build it with an open source tool. Sure, some licenses like the GPL insist you share all of your changes to the tool, but that doesn't extend to something new. Apple built something new on top of an open source base. We've all done the same thing and kept it proprietary. Why can't Apple?
Why Apple should open-source Swift: Swift can be clonedMicrosoft tried to keep .Net on the Windows platform. Then the open source community cloned it. The same can happen to Swift. If someone builds an entirely open package, it could become the dominant version of the language. Programmers could start building to it, then Apple would have no leverage. Open-sourcing Swift from the beginning would allow Apple to defend against the emergence of a legitimate competitor.
Why Apple won't open-source Swift: Who wants a clone?An iPad may cost $500 or more. A clone running Android can be found on eBay for less than $100. Whose store has long lines and endless waits? Sure, some hackers in some basement can clone most of Swift, but eventually they're going to want to eat and that means getting paying jobs. Until someone steps up with financial support, the clones will remain cool demos, not flourishing stacks. And until people start lining up to buy commodity hardware running open-source Swift, there won't be much financial support.
- First look: Apple's Swift is simple, at first
- 10 features Apple 'stole' for the Swift programming language
- iOS 7 for developers: The InfoWorld special report
- 9 things we hate about Objective-C
This article, "7 reasons Apple should open-source Swift -- and 7 reasons it won't," was originally published at InfoWorld.com. Follow the latest developments in application development and mobile technology at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.
Read more about application development in InfoWorld's Application Development Channel.
Find your next job with techworld jobs