Live data from Hacker News

Ask HN: How are online code runner/playgrounds made?

news.ycombinator.com

1–4 of 4 posts

Ask HN: How are online code runner/playgrounds made?

#1
For example, https://play.crystal-lang.org/#/cr, https://play.rust-lang.org/, or https://executeprogram.com

I'm thinking there are two options. Either having some kind of 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?

Re: Ask HN: How are online code runner/playgrounds made?

#2
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.