December 5, 2025
REPL or rebel?
The Debug Adapter Protocol is a REPL protocol in disguise
Debug tool turned into chatty code console — cue the type wars
TLDR: A developer showed how a debugging protocol can double as a code console where you type and get results. The top comment sparked a static-vs-dynamic type debate, pitting purists against pragmatists and highlighting why this hacky shortcut could actually make everyday coding faster.
A developer just turned a debugging pipe—officially the Debug Adapter Protocol (DAP)—into a talkative, type-and-get-results console (a REPL). DAP was built so editors can chat with debuggers, not to be your everyday command prompt, but thanks to its “evaluate” command and expandable data trees (think click-to-open folders of values), it works suspiciously well. There’s even a demo of drilling into structured results like a data detective. The crowd’s reaction? Equal parts delight and side-eye. Some folks love the clever repurposing, calling DAP a Swiss Army protocol that does more than it says on the tin, while others mutter, “Cool hack, but is this… a good idea?”
Then o11c dropped a spicy question: is the reported “type” the static one (what the code says) or the dynamic one (what it actually is at runtime)? Boom—instant type wars. Purists want crystal-clear semantics; pragmatists shrug and say, “Does it help me debug or not?” Meanwhile, jokers christened it REPL cosplay and rolled out the classic “Debugger? I hardly know her” meme. The strongest opinions split between: use the right tool versus use whatever works, with a chorus asking for clarity on types. If you like drama with your dev tools, this thread has everything—innovation, nitpicks, and nerdy punchlines. Check the protocol specs if you dare: DAP docs.
Key Points
- •DAP’s evaluate request returns a result string, optional type, and a variablesReference for structured data.
- •The variables request uses variablesReference to retrieve arrays of Variable objects (name, value, type?, variablesReference).
- •variablesReference enables nested and cyclic structures, supporting interactive tree-like exploration of results.
- •nluarepl implements a DAP-based REPL for the Neovim Lua interpreter.
- •hprofdap uses DAP to inspect Java .hprof heap dumps with OQL, showing DAP’s applicability beyond debugging.