Swift 2.0 and the Public Sector

Introduction

Apple introduced their new Swift programming language at their World Wide Developer Conference back in 2014.  Swift is a native language for Apple’s Cocoa and Cocoa Touch frameworks, on which the OS/X and iOS operating systems are built.  During its introduction, Apple VP Craig Federighi described Swift as “Objective-C without the C”, but it’s clear that Apple’s intentions for the language extended far beyond a simple syntax upgrade. Initial benchmarks showed significant performance improvements over both Objective-C and Python. Swift introduced several features designed to improve overall code safety, including automatic memory management, overflow checking for arrays and integers, and forced initialization of variables. The Xcode IDE also included a really nice feature called a “playground”, which was an interactive Swift programming scratch pad that evaluates code snippets in real-time, allowing the developer to experiment with algorithms, explore system APIs, and prototype sections of their applications.

To recap: the benefits of Swift as a language are:

  1. Simple to learn – less cluttered and much more approachable than Objective-C.
  2. Language features designed to increase code safety
  3. Compiled into byte code, not evaluated at runtime like scripting languages (JavaScript, Python, etc).  This can result in faster app execution.
  4. The “playground” feature of the Xcode IDE helps speed the development process by allowing quick experimentation and feedback.

Developers targeting the respective Apple platforms were generally excited by the promise of Swift as the successor to the obtuse Objective-C language, but it held no real relevance for the vast majority of developers working on other platforms. In fact, the reaction from the cross-platform community was one of general disappointment that Apple had chosen to develop a proprietary language, instead of moving in a more open direction.

SWIFT 2.0

At WWDC ’15, Apple announced Swift 2.0, which contained a number of nice enhancements to both the language and the debugger. The Swift 2.0 developer tools would also be offered on Linux, representing the first step in supporting development on non-Apple platforms. But the larger and more pertinent announcement was that the entire Swift platform was being open-sourced. But what exactly does it mean to “open source” a language? What components are involved, and what does this mean for developers in the Federal government?

  1. The first initiative is Swift.org, the open source community portal. Come here to read blogs and documentation, exchange ideas, and see how to get started. This site also has links to download all the different source code snapshots, which are hosted on GitHub.
  2. The Swift platform (which currently exists only for Mac OS X and Linux) will consist of all the tools that a fully-formed software language needs:
    • a compiler and build tools for each supported platform;
    • testing and debugging tools that will plug into 3rd-party editors and IDEs;
    • core code libraries containing the language itself;
    • and a package manager to help resolve dependencies.
  3. Licensing concerns: Swift will be licensed with a very liberal Apache 2.0 license with a runtime library exception. This means that contributors retain the copyright to their code, and the industry won’t follow Oracle’s lead with regard to the Java platform.

The ultimate goal for Swift is to have it evolve beyond the iOS and OS X platforms, and deliver on the promise of a single, secure, full-stack implementation, capable of scaling from the mobile device to the desktop to cloud services.

Open Source adoption in the Public Sector

The Federal government has traditionally been slower to embrace the OSS movement than the commercial world, and there have been significant obstacles to this adoption. The obvious concern initially was that open source software would introduce security risks. There was also huge pressure exerted by commercial software vendors who were interested only in safeguarding their revenue streams, and who fought tooth and nail to keep OSS out. And most importantly, there was a cultural shift that needed to happen before Federal agencies could fully embrace OSS.  The lines of communication between various development teams, that arguably must exist to support the level of collaboration and teamwork that OSS demands, were often completely closed, sometimes even within in the same agency.

But those obstacles are now clearly in full retreat.  Even the Dept. of Defense has recognized that OSS may actually pose fewer security risks, due to the nature of widespread public review.  Many commercial software vendors, including IBM, understand that a purely proprietary strategy is not viable in the long term, and are embracing open source platforms that complement their commercial offerings.  And lastly, the CIO of the General Services Administration published a set of “Guiding Principles” that establish an “Open Source First” policy as a key IT principle.

IBM’s Role with Apple, Swift, and Open Source

In July of 2014, IBM and Apple announced a strategic partnership to transform Enterprise Mobility.  The first fruits of that partnership have materialized as the IBM MobileFirst for iOS portfolio, consisting of over 100 enterprise mobile apps, covering 15 different industry segments.  All of these apps leverage the power of the IBM MobileFirst platform.

IBM is working diligently to extend Swift 2.0 to the server environment, initially targeting the Linux platform. In support of Swift 2.0, IBM has developed the IBM Swift Sandbox, a free service from IBM DeveloperWorks that allows you to experiment with Swift and run snippets interactively in a Linux server environment. Each Swift sandbox runs inside a Docker container in the IBM Bluemix cloud platform. You can also find a beta release of the Watson iOS SDK, all written in Swift.

Conclusion

Swift will have an enormous impact on the global IT community, and not just as a component of a mobile app development strategy.  Now that it has been open-sourced, look for Swift support to evolve across the entire spectrum of computing platforms, from mobile devices to rack-mounted server clusters.

IBM has established itself as one of the strongest supporters of the Open Source community – serving on the board of the Node.js Foundation, and contributing heavily to many open source projects such as the Apache Cordova project.  IBM stands in a unique position in the industry as the only vendor capable of providing Enterprise-level support for open source software.

Read more about all this, and interact directly with IBM engineers and evangelists at the Swift @ IBM website.

Advertisements

About Paul Horan

Software Technology - lots of experience with Sybase and IBM mobility/cloud offerings.
This entry was posted in Mobility, Software, Swift and tagged , . Bookmark the permalink.