我打造了 Trace:讓兩人同時觀看同一次執行的除錯器
I built a debugger two people can watch at the same time
作者用四天打造 Trace,讓兩人加入同一次程式執行,即時觀看程式碼並沿時間軸回看。Trace 支援 Python 和 JavaScript,設有共享執行按鈕、執行圖、時間軸,以及變數、呼叫堆疊和 stdout 檢視。AI co-pilot 尚未建成,作者計劃考試後繼續開發。
I built a debugger two people can watch at the same time
I have lost count of the debugging sessions that went like this. I share my screen, I run the code, and I narrate what it is doing line by line while the other person nods at a video feed. They cannot pause it. They cannot rewind it. They cannot point at a variable and ask what it held two steps ago.
So I started building Trace. The short version is Figma, but for debugging. Two people join the same run, watch the same code execute live, and scrub back through it on a timeline when something looks wrong.
I gave it four days before my exams forced a pause. Here is what actually shipped.
Day 1: the tracer
A Python tracer built on sys.settrace, a Pydantic trace schema to keep every step honest, and a Next.js scaffold to show it in. Ten commits, 22 of 22 backend tests green. Nothing to look at yet, but the foundation was real.
Day 2: the runner
A sandboxed runner behind POST /execute, traces retrievable at GET /traces/{id}, and a JavaScript tracer using acorn so it is not a Python-only toy. Five more commits, 60 of 60 tests green.
Day 3: the multiplayer part
Rooms joined by code. A Yjs relay running inside FastAPI, not a Node sidecar, because one process and one deploy beats babysitting a second service. Presence with remote cursors, and a shared run button so either person can kick off the execution. Ten commits, 73 of 73 tests green.
Day 4: the part you actually look at
An SVG execution graph with time on the x axis and line number on the y axis. A timeline scrubber with play and pause, 0.5x to 4x speed, and arrow-key stepping. A variables panel (text only, dunders filtered out), a stack panel, and a stdout view. I verified it with Playwright screenshots of a real 10-step loop trace, on desktop and mobile. Still 73 of 73 tests green.
What is not built yet
The AI co-pilot that explains each step as it runs. That is the plan, and I am saying so plainly instead of letting the pitch imply it exists. Exams pause the build until October 31, then Days 5 to 7 finish it.
The part I keep coming back to is the scrubber. Debuggers show you the present. A timeline lets you argue about the past, and when two people are staring at the same bug, the past is usually where the answer lives.
來源:DEV Community · dev.to