gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.82k stars 265 forks source link

graphical debugger? #117

Open cosmos72 opened 6 years ago

cosmos72 commented 6 years ago

From what I know, Jupyter notebook + IPython support debugging python code.

Since the underlying interpreter gomacro already contains a text-mode debugger, and an API to interact with its debugging facilites (step, next, finish, set/get variables, get stack trace...), implementing a Go debugger in gophernotes may be feasible an dit could be very useful.

Somebody has enough experience (@SpencerPark ?) with Jupyter protocol and can help or point to the relevant messages to exchange with Jupyter to implement a debugger?

SpencerPark commented 6 years ago

There is no Jupyter debugger (there is a proposal in the works but I wouldn't wait on that). Currently pyd simply implements the interaction as a repl which from the sounds of gomacro's debugging support is the style gophernotes could end up with.

My understanding is that you would wrap the cell in a magic that starts the debugger with the body of the cell as the source and then using the input_request ask for a line of input that is passed as the command to the debugger. In another project I wrapped an input stream around it which is buffer on newlines (like most terminal stdin streams are anyways) and we could likely do the same in gophernotes.

Another option is to look at third party notebook extension (like pixie debugger) and try to implement a Go back end to take advantage of a nice graphical front end.