Running arbitrary code from strangers on the internet is hard. It's a security nightmare wrapped in a resource allocation puzzle, topped with sca

Running Code from Strangers

submited by
Style Pass
2024-11-21 18:00:11

Running arbitrary code from strangers on the internet is hard. It's a security nightmare wrapped in a resource allocation puzzle, topped with scalability concerns — and it’s costly.

At Livedocs, we’re building a modern cloud-native notebook. Livedocs lets you combine Python, SQL, Dynamic text, and visualizations in one interactive canvas. When we started out, we wanted to build a way for data nerds and analytics-focused teams to start exploring data collaboratively with very little yak-shaving. 

Here’s a story of how the Livedocs runtime evolved over the few months of intense building, some lessons from each step, and how the architecture evolved.

We chose Python because it’s the go-to language for data science and analytics. Most of our users are already familiar with Python, and it offers powerful libraries for data wrangling and visualization. Compared to JavaScript or other languages, Python is simply a better fit for data work, making it the obvious choice for our runtime.

Our first stab at this was using Pyodide, a port of CPython to WebAssembly, which runs Python directly in the browser. The appeal was clear:

Leave a Comment