rrose1 / jsonesharp

A browser-based implementation of the 1# text register machine
GNU General Public License v2.0
6 stars 6 forks source link

program trace/logging facility #3

Open rrose1 opened 9 years ago

rrose1 commented 9 years ago

After a program has been evaluated by the trm, it would be nice to be able to read a program trace.

Perhaps a button could be added to output such a trace to another tab, either in a pretty html table or in json (to be saved).

If we were to get even fancier, we could allow the user to add breakpoints to the code and have the logger return the state of the registers at each breakpoint (much like the tables we fill out by hand in the discussion of the s-m-n theorem).

alreadydone commented 9 years ago

Thanks for your nice work. Trick: in v0.1.1 one can use Ctrl+Z/Ctrl+Y to trace the change within one register. This makes it more convenient to use than the java interpreter (which seems to be unavailable now). It's also good to see the symbols appear and vanish in the registers, but it isn't as slow as the slowest mode in the java interpreter, and is hard to follow. That's why the trick is useful. The trick no longer applies in v0.2, since the computation is done all at once and only the final result is returned, which makes debugging difficult. I actually prefer using v0.1.1. If anyone feels the same, s/he can download https://github.com/rrose1/jsonesharp/archive/v0.1.1.zip , unzip, and open index.html therein.

Addendum: The trick above only work in Firefox (tested v31.2.0), not on Chrome (v40.0.2214.94 m). v0.2 runs in IE11, but v0.1.1 seems not. And when you have something you're sure will work, then putting it into v0.2 you can get the result a lot faster.

rrose1 commented 9 years ago

Thanks very much for your feedback. I'll make a "visual" evaluation option the next priority. I wonder what the optimal fps for that would be. I'll also add a button to allow the user to step through a computation by clicking.