Eric Willis

RunSwift - Try Swift in Your Browser

Add a comment

Replies

Best
Ruairidh W McHardy
Pretty neat!
Eric Willis
@ruairidhwm Definitely. Maybe @jparishy can come in and tell us more about it.
jp
@erictwillis sure! 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!
Eric Willis
@jparishy Thanks for the detailed post. I don't need to add a question because you already addressed it regarding the backend. Learning Swift is on my to-do list to complete the year. RunSwift rocks.
Lachlan Campbell
@jparishy Awesome! I just tried it on my Mac, and it’s pretty cool. Unfortunately, it doesn’t look so great on iPhone :(
jp
@lachlanjc haha yes sorry about that! I didn't have time to really make the mobile view perfect. It does look a tiny bit better in landscape mode, though. If I have some free time this week I'll update the styles!
tom meagher
@jparishy Great work! Any chance you can add a keyboard shortcut for the compile button?
jp
@thomasmeagher CTRL/CMD+Enter :)
Eric Willis
RunSwift allows you to try Apple's Swift programming language from within the browser. While you cannot import arbitrary modules, a small subset of Foundation is included.
Santosh Sankar
This is awesome, been waiting for something like this. I have been tinkering with Swift and always find myself doing it between meetings or on-the-go.