Idorobots / spartan

A small Lisp dialect that serves me as a test bed for programming language features.
MIT License
13 stars 3 forks source link

Interactive debugger #196

Open Idorobots opened 2 months ago

Idorobots commented 2 months ago

Given that the trampoline is made explicit with #190, it should now be fairly easy to introduce a version that allows stepping through the continuations in the REPL.

A call to (breakpoint) will yield a marked resumable and cause the original trampoline to exit. That return is trapped by the debugger trampoline, which allows a step-by-step execution with REPL commands:

For inspecting the stack-trace, a separate call-trace can be used - should store the active function frames in a ring buffer in debug-compiled code (#197).

REPL should also trap Racket execution breaks and treat these as breakpoints.