IBM Swift Sandbox lets you test Apple's newly open-source programming language in your browser

Posted:
in General Discussion
Just hours after Apple made its Swift programming language open source, IBM has introduced a new, simple, and free browser-based way for developers to get started writing code.




Created at IBM's Mobile Innovation Lab in Austin, the new IBM Swift Sandbox tool is now available to test in beta form on the developerWorks website. Swift Sandbox allows developers to write Swift code and execute it in a server environment on top of Linux.

John Petitto, an IBM Swift developer, detailed the new tool on Friday in a post to Big Blue's developer website. The sandbox runs on IBM Cloud in a Docker container, and allows testers to use both the latest versions of Swift and its standard library.

Petitto teased that Swift Sandbox is just the beginning from IBM, which has openly embraced Apple's programming language for iOS and OS X. Now that it's open source, Petitto said that the Swift Sandbox tool "barely scratches the surface of what's possible."

In an interview this week, Apple senior Software VP Craig Federighi revealed that IBM has been a "major source" of feedback on Swift. The Armonk, New York-based company has an ongoing partnership to develop enterprise-focused mobile apps on iOS via Swift.
«1

Comments

  • Reply 1 of 27
    Wow. I'm not a developer (yet), but this would seemingly portend a potentially huge end run around the corporate Windoze hegemony.
  • Reply 2 of 27
    vmarksvmarks Posts: 762editor
    I don't know that it does that completely - There's no reason Swift won't become available for Windows, because it is open source, after all.

    Yes, it could help break the dominance of Windows-only applications (although that's been fading on its own for quite some time) but it probably doesn't leave Windows out in the cold.

    Not a developer yet? Definitely use that IBM link. Seeing the code on one side of the screen and the results on the other is one of the best ways to begin.
  • Reply 3 of 27
    This is very cool. It even supports Apple's foundation framework.
    The browser interface is very responsive.

    This allows any platform with a web browser to try out Swift.
  • Reply 4 of 27
    MarvinMarvin Posts: 15,309moderator
    I always wondered if IBM had an interest in Swift in part because of Java/Oracle:

    http://stackoverflow.com/questions/3824372/where-can-i-find-a-particular-version-of-the-ibm-jdk-jre-for-windows
    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14514070

    "Unfortunately you can get hold of the JDK only as part of another IBM product (say, Websphere or any Rational product) that you purchased. Our licensing agreement with Sun/Oracle forbids us from providing direct downloads of the IBM JDK on any platforms that Oracle/Sun also support (namely Windows and Linux). If you look at the Java downloads section of the developerWorks website, you'll only find SDKs for AIX, z/OS and Linux on System p/z, since those are IBM owned platforms that Oracle doesn't support."

    Swift running server-side allows for a replacement for Java and for some businesses replacing Java can cut some costs out:

    http://www.oracle.com/us/corporate/pricing/price-lists/java-embedded-price-list-1977272.pdf

    Java is used to develop Android apps too. It would be good to see adoption of Swift in the game SDKs (Unreal, Unity) at least. Having it able to run server-side means an app developer would only need to know one language to make cloud apps. Games have been made where heavy processing parts run on a server:

    http://www.developer-tech.com/news/2015/aug/05/gamescom-microsoft-demonstrates-power-its-cloud/

    http://www.extremetech.com/gaming/215532-microsoft-buys-havok-physics-from-intel-could-boost-xbox-one-cloud-gaming

    As long as the connection is stable, a Swift app can send off a calculation to a server that runs up a number of instances in the same Swift code hundreds of times faster than the device could do on its own and just send back the results.
  • Reply 5 of 27
    This is very cool. It even supports Apple's foundation framework. The browser interface is very responsive. This allows any platform with a web browser to try out Swift.
    The following site has been available for several months and works a little better than the new IBM site:

    http://www.swiftstub.com/


    But the IBM site will, certainly, be of greater influence to enterprise.

    Here is some Swift code that works on both sites.  It shows one approach to creating an  Ordered Dictionary.   I suspect that Apple will implement a high-performance  Ordered Dictionary  API to support its recently acquired  FoundationDB.



    //
    //  OrderedDictionary.swift
    //  SwiftDataStructures
    //
    //
    //  Created by Tim Ekl on 6/2/14.
    //  Copyright (c) 2014 Tim Ekl. All rights reserved.
    //

    struct OrderedDictionary<Tk: Hashable, Tv> {
        var keys: Array<Tk> = []
        var values: Dictionary<Tk,Tv> = [:]
        
        var count: Int {
            assert(keys.count == values.count, "Keys and values array out of sync")
            return self.keys.count;
        }
        
        // Explicitly define an empty initializer to prevent the default memberwise initializer from being generated
        init() {}
        
        subscript(index: Int) -> Tv? {
            get {
                let key = self.keys[index]
                return self.values[key]
            }
            set(newValue) {
                let key = self.keys[index]
                if (newValue != nil) {
                    self.values[key] = newValue
                } else {
                    self.values.removeValueForKey(key)
                    self.keys.removeAtIndex(index)
                }
            }
        }
        
        subscript(key: Tk) -> Tv? {
            get {
                return self.values[key]
            }
            set(newValue) {
                if newValue == nil {
                    self.values.removeValueForKey(key)
                    self.keys.filter {$0 != key}
                }
                
                let oldValue = self.values.updateValue(newValue!, forKey: key)
                if oldValue == nil {
                    //self.keys.filter {$0 > key}
                    self.keys.append(key)
                    print("Keys After Adding: \(key) \(keys)")
                    od.keys = od.keys.sort()
                    print("Keys After Sorting: \(keys)")
                }
            }
        }
        
        var description: String {
            //od.keys = od.keys.sort()
            print("==od.keys: \(od.keys)")
            var result = "{\n"
            for i in 0..<self.count {
                result += "[\(i)]: \(od.keys[i]) => \(od[i]!)\n"
            }
            result += "}"
            return result
        }
    }


    var od = OrderedDictionary<String,Int>()
    print(od.description)
    od["Tim"] = 19
    print(od.keys)
    print(od.description)
    od["Tim"] = 24
    print(od.description)
    od["Alice"] = 12
    print(od.description)
    od["Catherine"] = 23
    print(od.description)
    od["Becky"] = 3
    print("od.description--\(od.description)")
    print("od --\(od)")
    od["Alice"] = 42
    print("od.description--\(od.description)")
    print(od)
    print(od.keys)
    print(od.keys[0...2].contains("Tim"))
    print(od.values)

    //var sortedKeys = sort(&od.keys, <)
    print(od.description)



    edited December 2015
  • Reply 6 of 27

    IMO, 5 years from now, open sourcing Swift will prove to be the most significant Apple product release of 2015!



  • Reply 7 of 27


    IMO, 5 years from now, open sourcing Swift will prove to be the most significant Apple product release of 2015!



    I'd upvote your post if I could. ;)
  • Reply 8 of 27


    IMO, 5 years from now, open sourcing Swift will prove to be the most significant Apple product release of 2015!



    I'd upvote your post if I could. ;)
    Yeah, this new forum is very limited -- no code, image upload ...


  • Reply 9 of 27
    iqatedoiqatedo Posts: 1,822member
    I wonder why the change? More than meets the eye?

    I'm looking forward to delving into Swift. I'm not familiar with the web sites but gauging opinions, they sound like excellent resources.
  • Reply 10 of 27
    I like Swift but it takes more than being a good programming language to hit mainstream. Java and .NET had the head start on the web, following by scripting languages (PHP, Ruby, etc). With all the web infrastructure built on these languages I find it hard to see a massive move towards Swift, or any other language - the same way I find it hard for financial services to move core code from COBOL.
  • Reply 11 of 27
    efsatta said:

    I like Swift but it takes more than being a good programming language to hit mainstream. Java and .NET had the head start on the web, following by scripting languages (PHP, Ruby, etc). With all the web infrastructure built on these languages I find it hard to see a massive move towards Swift, or any other language - the same way I find it hard for financial services to move core code from COBOL.

    I thought it had already been settled that Swift had become the most popular language several months ago???
  • Reply 12 of 27
    efsatta said:

    I like Swift but it takes more than being a good programming language to hit mainstream. Java and .NET had the head start on the web, following by scripting languages (PHP, Ruby, etc). With all the web infrastructure built on these languages I find it hard to see a massive move towards Swift, or any other language - the same way I find it hard for financial services to move core code from COBOL.

    The popularity of iOS devices is driving adoption of Swift and in addition, Swift is widely recognized as an easy to use and powerful programming language. Profits. Money. The gold rush for early adopters. THESE are the core reasons Swift will "swiftly" be adopted.
  • Reply 13 of 27


    IMO, 5 years from now, open sourcing Swift will prove to be the most significant Apple product release of 2015!



    I'd upvote your post if I could. ;)
    Yup... me too.
  • Reply 14 of 27
    jasenj1jasenj1 Posts: 923member
    So is Apple going to make Swift a native browser language like JavaScript? They are big contributors to WebKit, the foundation for Safari and Chrome. There is a huge upswing in JavaScript everywhere frameworks - Angular.js, et al. on the client end and Node.js, etc. on the server side. Apple could switch that all to Swift.

    Interesting times.

    P.S. So am I to understand AI's previous forum software provider suddenly shut down and disappeared? With no warning to customers? And not enough lead time to fully bake a new product?
  • Reply 15 of 27
    Yeah, this new forum is very limited -- no code, image upload ...
    They seemed to have added code formatting under the paragraph formatting buttons now
  • Reply 16 of 27
    http://www.swiftstub.com/  looks OK but it says that import is not allowed when I tried to import Foundation.

    I prefer the IBM site.  It's still in beta.  Imagine when it is released.
  • Reply 17 of 27
    knowitallknowitall Posts: 1,648member
    Maybe the best thing Apple did in recent years.
    Program languages live for quite a long time, take C for example, 35 years and counting.
    Apple creates a very solid fundament for the future and it will mean the end of the Windows platform in the longer run.
  • Reply 18 of 27
    http://www.swiftstub.com/  looks OK but it says that import is not allowed when I tried to import Foundation.

    I prefer the IBM site.  It's still in beta.  Imagine when it is released.
    True, import is not allowed ...  but Foundation is included and does not need to be imported.

  • Reply 19 of 27
    Marvin said:
    I always wondered if IBM had an interest in Swift in part because of Java/Oracle:  

    Swift running server-side allows for a replacement for Java and for some businesses replacing Java can cut some costs out:

    Having it able to run server-side means an app developer would only need to know one language to make cloud apps. 



    I love programming in Swift.  It is a full modern language, expressive and safe and very powerful. It makes Java, Objective-C, and C# look dated.  

    I think that this release is about taking on the server side with Swift. I expect to see full server platforms in Swift to replace Python/Django, Javascript/Node.js and Windows solutions in the next three years. 

    That would make a fantastic platform to work with.   Swift on both the client and server side for iOS/OSX apps. 

    I think you're both right on point ...   Swift will be  everywhere  in 5 years.

    I kinda' feel like I did back in 1978 when I first saw an Apple ][ demonstration:  

    This changes  everything!

    edited December 2015
  • Reply 20 of 27
    Marvin said:
    I always wondered if IBM had an interest in Swift in part because of Java/Oracle:  

    Swift running server-side allows for a replacement for Java and for some businesses replacing Java can cut some costs out:

    Having it able to run server-side means an app developer would only need to know one language to make cloud apps. 



    I love programming in Swift.  It is a full modern language, expressive and safe and very powerful. It makes Java, Objective-C, and C# look dated.  

    I think that this release is about taking on the server side with Swift. I expect to see full server platforms in Swift to replace Python/Django, Javascript/Node.js and Windows solutions in the next three years. 

    That would make a fantastic platform to work with.   Swift on both the client and server side for iOS/OSX apps. 

    I think you're both right on point ...   Swift will be  everywhere  in 5 years.

    I kinda' feel like I did back in 1978 when I first saw an Apple ][ demonstration:  

    This changes  everything!

    You nailed it! :)
Sign In or Register to comment.