BT

CodeCube Offers Shareable, Runnable Code Samples

by Brian Rinaldi on Oct 25, 2013 |

CodeCube is a new service and open source project that aims to improve collaboration by allowing developers to both share and run code samples in a secure manner via the browser.

The initial release of the service, available at codecube.io, supports sharing and running of Ruby, Python, Go and C code. Creator Harry Marr has also released it as an open-source project on GitHub, though without any specific license.

In a recent post announcing the project, Harry noted that many development communities collaborate and share code using Gists, a service from GitHub that allows the sharing of snippets and pastes of code. However, Gists do not have the ability to be run without first downloading and setting up the shared code locally. As Harry states, “Reproducing the output is often extremely difficult, as it can be hugely dependent on the environment the code was run in.”

In creating CodeCube, Harry was inspired by similar tools used by developers in Go (Go Playground) and in JavaScript (JSFiddle) that allow users to run the code entered within the editor. He aimed to recreate this for other languages, but had to overcome the security complications of running arbitrary, user-submitted code on the server.

In order to overcome this security limitation, CodeCube relies on an open source project called Docker. As Harry explains:

[Docker] enables creation and teardown of relatively secure sandboxed environments in a fraction of a second. Each time a code snippet is run, a docker container can be created, started, used to run the untrusted code, then killed and destroyed.

While the CodeCube service and project are already available, future updates are planned to include user authentication, collaborative editing, additional language support and an improved user interface.

Reaction to the announcement has been almost universally positive on Hacker News and across Twitter, where it received the most attention.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT