Hacker News new | ask | show | jobs
by dekhn 4442 days ago
gdb already has had reverse debugging for 5 years. http://sourceware.org/gdb/wiki/ReverseDebug
2 comments

Systems like gdb process-record-and-replay rely on logging machine state with every instruction [0]. This imposes limitations; for example gdb's record-and-replay system is not implemented on all platforms where gdb runs. Record-and-replay systems can also be impractical for many systems; for example VMWare record-and-replay debugging technically works on Firefox, but it's a tool of last resort because of the performance penalty. The browser can take several minutes just to start up in the record-and-replay debugger. [1]

Because of this, Mozilla developed its own record-and-replay system that is lower-overhead, but that again does CPU-specific and platform-specific work that needs to reimplemented for every OS and architecture, and relies on CPU features that aren't available at all on some processors and add some limitations of their own (like no recording of multiple threads with shared memory). [2]

In contrast, the Elm debugger apparently takes advantage of the language's pure FRP design to record and replay only input streams, rather than low-level machine/program state - a very different approach, with its own limitations, but also very different possibilities like interactively rewriting history by running different code on the same input stream.

[0] https://sourceware.org/gdb/wiki/ProcessRecord

[1] http://blog.pearce.org.nz/2009/03/setting-up-vmware-to-recor...

[2] http://rr-project.org/

I should note that Mozilla's "rr" is actually similar conceptually to the Elm debugger, since it records an input stream rather than a snapshot of the program's states or actions. But the mechanism is quite different, since C++ doesn't naturally isolate nondetermistic "inputs" in the way Elm does.
Replay frameworks are common in the systems community; the trick is to capture and record non-determinism somehow.
What's your point?
The title would suggest to someone not already well-versed that this is a unique feature of Elm's debugger, certainly not that one of the most common and popular debuggers does this. It's hype
My point was that the first paragraph of the post is simply misleading.

Now that I understand Elm is an esoteric system and these results are irrelevant outside its solution domain, I don't really care.

Surely the fact that such a valuable tool can be implemented due to Elm's "esoteric" nature (not sure I agree) is of interest?