BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News IBM's Swift Response

IBM's Swift Response

This item in japanese

Today, IBM launched a Swift developer section on its developerWorks site, along with an engineering blog and links to Apple's open-source repositories at Swift.org. In a blog post, John Ponzo confirmed that IBM had been developing Swift apps since its release a year and a half ago. They explicitly call out Swift's benefits for their developers in the MobileFirst for iOS Industry Solutions team.

This followed from the Apple and IBM agreement in July 2014 to promote enterprise applications for the iPhone and iPad, along with integration in cloud technologies, as well as reselling iOS devices and support agreements.

In addition to the public support, IBM have also launched the IBM Swift Sandbox, which provides a web-accesible shell onto a remote Linux session on the IBM cloud. Navigating to swiftlang.ng.bluemix.net gives a REPL which can be used to evaluate Swift statements and then see corresponding output on the other side. Apple's Swift Tour can be used to experiment with the syntax and semantics of the Swift programming language. IBM have also provided a number of small samples that can be used to experiment with Swift.

The version of Swift running on the sandbox is a pre-release of Swift version 2.2 on Linux, and as such, some changes to the underlying library may be present. Swift's evolution does not take into consideration either source compatibility or binary compatibility at this stage; instead, the compiler offers 'fix-its' which can be used to migrate from one version to another. Binary compatibility is a planned item for Swift 3.0, due to be released towards the end of next year. Note also that as the Linux port is missing the Objective-C support, and any methods or extensions that depend on Objective-C classes (such as NSString). In addition, Apple specific frameworks such as UIKit or AppKit are not available.

For example, Swift 1.x had a global method stride(from:10,to:1,by:-1) but this has since been replaced with a member method 10.stride(to:1,by:-1). Error messages are translated into pop-up errors in the interface. 

for count in 10.stride(to:1,by:-1) {
    print("\(count)")
}
print("Blast off!")

Functionality in the Swift sandbox will allow source code examples to be shared in future, but they are not available at the time of writing.

Do you think a sandbox will be a useful way of playing with Swift code?

Rate this Article

Adoption
Style

BT