Live data from Hacker News

RunSwift: Try Swift in Your Browser

runswiftlang.com

21–24 of 24 posts

Re: RunSwift: Try Swift in Your Browser

#21
post #10
post #4

Earlier quoted context omitted.

That's one way to do it, sure. In this case I had the problem of having to use a Mac for a build server, though. I did a few things to get this running: - The application server and build server are separate, with access control to the build server controlled by an API key that I can revoke should anyone gain access to it. - The process that compiles and runs your code is an unprivileged user. - All import statements…

You can execute the process under sandbox-exec to take advantage of OS X kernel-level sandboxing. You'll need to write your own profile file that allows/denys what you want. There are plenty of examples of these .sb profile files under /System/Library. More: https://developer.apple.com/library/mac/documentation/Darwin...

Just deployed a new script runner backed by sandbox-exec! Thanks again for the tip!

Re: RunSwift: Try Swift in Your Browser

#22

Earlier quoted context omitted.

Excellent! Thank you for pointing me to this!

Good tip. Another suggestion would be to use chroot :) That said, the best, most foolproof way of doing this really comes down to using OS X to virtualize OS X. Or you could try cross-compiling. It seems to work here: https://github.com/swift-x/tools (which looks interesting...) It's possible that by the end of this week, maybe next, it will be very easy indeed to compile and/or run Swift on Linux from Linux, at whic…

Thanks for the tips! I'd love to move to LXC should an appropriate/feasible compiling solution become available :)

Re: RunSwift: Try Swift in Your Browser

#23

Nice work! I've been looking at using the REPL to make some web stuff too, so I understand the challenges involved here! BTW we are running a Swift hackathon @ GitHub HQ in a few weeks, it would be cool if you could join us: http://www.swifthack.splashthat.com

Thanks! What kind of web stuff stuff are you trying to do?

And I would love to, but unfortunately I live on the other (better ;)) coast! Will you all be taping the talks?

Re: RunSwift: Try Swift in Your Browser

#24
post #10

Earlier quoted context omitted.

You can execute the process under sandbox-exec to take advantage of OS X kernel-level sandboxing. You'll need to write your own profile file that allows/denys what you want. There are plenty of examples of these .sb profile files under /System/Library. More: https://developer.apple.com/library/mac/documentation/Darwin...

This mechanism has been deprecated by Apple. In the header file they point out that one should use the OS X sandboxing instead which works with plists instead and can be controlled with less flexibility.

Calling sandbox_init from inside your app has been deprecated in favor of the App Sandbox mechanism, but I don't see any indication that sandbox-exec is deprecated.
Post reply on HN