Run Python or C++ and Watch It Execute in 2D and 3D

Developer tools · Creator, sole engineer · live

Learning algorithms from static diagrams is a mismatch: the diagram shows a state, but the algorithm is the transitions. Existing visualisers only animate a fixed set of pre-written algorithms, which is useless when you are debugging your own code.

Code: https://github.com/vasu-devs/DryRunVisualised

The detail

Here you write your own Python or C++, press run, and step through your execution line by line with full variable inspection - rendered simultaneously as an interactive 2D view and a 3D scene with orbit controls and draggable nodes.

Python runs entirely in the browser via WebAssembly, so there is no execution server, no sandbox to secure and no per-run cost. C++ compiles through a public compiler API rather than a custom build farm.

Instrumentation is injected rather than requested - you write normal code and the tool adds the tracing. Each executed line emits a uniform snapshot of line, stack, heap and output, and a classifier detects each variable's shape (array, grid, graph, linked list, tree) and routes it to the right renderer. That trace-first design is why two very different languages share one visualiser.

50+ prebuilt algorithms, step forward and backward, adjustable speed.

What I did

  • Built the trace-first execution architecture that decouples running code from rendering it
  • Implemented client-side Python execution in WebAssembly, removing all server and sandbox risk
  • Integrated remote C++ compilation through a public compiler API
  • Wrote the instrumentation injection for both languages
  • Built the variable shape classifier that routes arrays, grids, graphs, trees and lists to the right renderer
  • Built both the 2D and 3D renderers with step-through controls

Stack

Next.js, TypeScript, Three.js, React, WebAssembly, Pyodide, Monaco Editor, Zustand, Code Instrumentation

Case study: https://www.siddhvasudev.com/projects/run-python-or-c-and-watch