I am building a code visualizer: you paste a Python or C++ program, it runs it, and you step through the execution with boxes, arrows and a variables panel. Replay happens entirely in the browser from a saved recording, so stepping back never re-runs your program.
The recording is the interesting part. A tracer takes a snapshot at every step, and each snapshot contains every live object. That is easy to write and it explodes: a linked list of 300 nodes recorded over 2,000 steps was 4.8 MB of JSON, and a 367-step run over forty small dictionaries was 6.7 MB.…