
Ask HN: How are online code runner/playgrounds made? - mitch-snipline
For example, https:&#x2F;&#x2F;play.crystal-lang.org&#x2F;#&#x2F;cr, https:&#x2F;&#x2F;play.rust-lang.org&#x2F;, or https:&#x2F;&#x2F;executeprogram.com<p>I&#x27;m thinking there are two options. Either having some kind of &lt;Language&gt; to JS interpreter that runs the code in the browser, or, running the code in some kind of container on a server and returning the response to the client. In which case, how are the servers secured against potentially dangerous input?
======
steveklabnik
[https://github.com/integer32llc/rust-
playground](https://github.com/integer32llc/rust-playground) is the code for
play.rust-lang.org

------
PaulHoule
I think many of them (esp. Hacker Rank) start up a container to run your
program. Presumably these are configured to prevent access to the network,
external files, etc.

The AWS Lambda console has a code editor/runner that looks a lot like what
Hacker Rank has, but you are running on the real Lambda system which has some
characteristics of VMs and containers.

------
verdverm
Golang uses a restricted remote container.

Curlang uses WebAssembly to be local to the browser. I see this becoming a
trend.

