RunSwift

I had some free time over the last week so I built an online sandbox for playing with the Swift programming language in the browser. There is limited access to Foundation included, and you're not allowed to import any external libraries. You can find it here: http://www.runswiftlang.com/

RunSwift was submitted to Hacker News and Product Hunt where it gathered a lot of interest. Someone asked how it was made and here is my reply:

I took some time off this week and built RunSwift from a hotel room down in Atlantic City! It's something I've been thinking of doing since I first started playing with the language but hadn't had the time. Swift is a big deal. It maintains a lot of the raw power of Objective-C while enforcing stricter standards on our code through a powerful type system. I think it'll lead to better code and better apps, and I wanted to let more people give it a try. Plus I needed to brush up on Ruby/Sass skills :)

The app itself is composed of a few parts, namely: 1) a user facing Sinatra app that's hosted on Heroku (which made it really easy to keep up with the traffic it saw last night). This is what you see when you go to the site. And 2) a backend Sinatra app (running via thin in threaded mode) that runs on a Mac server with a suite of bash scripts for validating, compiling, and running your code. Code is checked for a series of blacklisted APIs, prefixed with a template file that includes some select APIs from Foundation, compiled, and finally run via sandbox-exec. Each step has a timeout powered by the timeout function in coreutils. Finally, the results are relayed back to the frontend app and shown on screen.

It was super fun to build and I'm glad you guys think it's cool, too!