IBM has today unveiled their first public effort towards Swift, with the introduction of the IBM Swift Sandbox website. You can type lines of Swift code into the text editor on the left and then run the code on a Linux server, posting the output in the right column. This is all made possible by the fact that Swift is now open source, supporting Linux alongside iOS and OS X.
You can use the core Swift language as well as the standard library functions, so writing a formulaic mathematical problem (like the Fibonacci example above) is well within the scope of the web application. The concept is similar to the CodeRunner app from the Mac App Store, except it runs entirely off a cloud infrastructure.
This shows the potential path for future application development. More a cool tech demo than anything else, it’s rudimentary and impractical for any serious work but gives a glimpse into the sort of stuff that taking Swift into open-source realm enables. It’s also interesting that IBM is supporting Swift from the outset (the blog post openly states “we love Swift here”), showing potential for future enterprise opportunities. Apple and IBM already have a tight enterprise collaboration for bringing iOS and iPads into the corporate business world.
FTC: We use income earning auto affiliate links. More.
I have been coding in Swift for ~ 6 months. It is a great language, expressive and powerful while being safe. My projects are iOS and OS X with backend code in Node.js. With this release, I think I can safely envision a future where I could even write the server side in Swift and get away from Node.js and Javascript’s funky class/prototype design.
This is great news and another step towards a better, safer way of programming. Swift for the masses!
And on the other side JavaScript is now possible to use for both client and server :D
But Javascript is not really a modern language with strong coding protections. I prefer guards, optionals, strong class support, … but that is just me.
In the future we’re planning to add code sharing, so you can link people directly to your Swift solutions on Stack Overflow and such. Hopefully that takes it out of the realm of “tech demo” and makes it a useful learning tool.
case 0,1:
return n
I prefer the explicit form here. Using return n shadows what is really going on; unnecessary indirection.
you are right but case 0,1 shows a nice feature of swift not found in many other languages
This could go nice with a enterprise database. Perhaps IBM marry it with Cloudant?