← All projects

A runtime & debugging engine

debugger.sh

With Jacob Roberts-Baca, Fabio Ibanez, and collaborators. Paper under review at SIGCSE TS 2027.

RustWebAssemblyDebuggersCS Education

We built a tool that runs and debugs code locally in the browser.

The motivation came out of teaching. In every intro class, the first few weeks go to fighting installation problems instead of writing code. We wanted something that would let us run, debug, and visualize code without anyone installing anything.

For C/C++, Python, and Rust, we take the real toolchains and compile them to WebAssembly, targeting WASI:

C / C++
Clang 22.1
Python
CPython 3.11
Rust
rustc 1.96, lightly patched

And so the actual compilers of these languages would be running in your tab.

It’s an engine, not an app

A core architectural decision was to make this a headless library. Anyone who needs to run or inspect code can drop it into their own system, which is why we call it the engine.

An educator can fit it into their class, and because the engine gives full access to the program’s memory, things like live code visualization become feasible. But besides education, this is for any case where someone, or some service, wants to run and inspect code without a backend.

Classrooms

Debuggable code snippets inside lecture notes, autograders that run client-side, memory diagrams built from real program state instead of a whiteboard.

Coding platforms

Imagine LeetCode running and debugging submissions entirely on the visitor's machine, with no execution servers, no queue, and no bill.

LLMs & agents

A model that actually runs the code it writes, sets a breakpoint, and reads real program state instead of guessing at runtime behavior.

We tried it on real students

We piloted a CS2 section at Stanford with it. 70% of program runs were followed by an actual debugging action: a breakpoint, a step, a continue. Nobody told them to use the debugger. It was just already there and free to open.

Seeing where the pointer is when looping through the linked list helped me understand what is actually going on.

Try it

npm install debugger-sh

We built and hosted debugger.sh around the library as a proof of concept. It is a very barebones IDE that supports debugging.

Fair warning: the first run is slow, because your browser has to download an entire compiler before anything happens. It caches after that. The site is also pending some heavy optimization, since it's a proof of concept and not a product.

If you are here, you are curious :) read more, and reach out!

This project was full of quirks. Compiling compilers into WebAssembly. Rewriting binaries to slip debug hooks between statements. Digging debug information back out of the output and reassembling it into something a human can read.

If you’re interested, the full paper has the details. It’s still anonymized, and will be de-anonymized once we hear back from our conference submission. Or, even better, let’s talk about it over coffee.