Recent submissions

Comment · 1 year ago
Yeah for sure: run it inside a virtual machine, or do some sort of docker magic.

You kind of need to pretend you are a whole computer for a programming language to be happy. There's built in assumptions they're running on a "real" computer. They assume they've got full access to network and disk. Installing packages often requires compiling C extensions, or running native binaries. All that stuff means the best way to sandbox is to virtualise a whole computer.

It's fun to do it with WebAssembly though, you get a lot of guarantees and it's quite light weight.

Comment · 1 year ago
Comment · 1 year ago
Comment · 1 year ago
Working on Runno (https://runno.dev/) as a side project. It's a tool for running code in the browser for educational use.

[Edit]: I wrote a re-introduction to Runno: The WebComponent for Code over the weekend (https://runno.dev/articles/web-component/)

I've been playing around with turning it into a sandbox for running code in Python (https://runno.dev/articles/sandbox-python/). This would allow you to safely execute AI generated code.

Generally thinking about more ways to run code in sandbox environments, as I think this will become more important as we are generating a lot of "untrusted" code using Gen AI.

Comment · 1 year ago
Sounds really interesting. Where can I try it out? I struggled to find a link in the article.
Comment · 2 years ago
Comment · 2 years ago
This is the use case I've been tackling with Runno (https://runno.dev), it's more performant than OP's approach but not as flexible.
Comment · 2 years ago
There is support in Docker to run wasm-wasi binaries directly (see: https://wasmlabs.dev/articles/docker-without-containers/). The downside compared to OP's approach is that whatever you're running has to have already been compiled to wasm-wasi. The upside would be much faster execution time (no emulation overhead for x86).

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton