As for debugging. I do not imagine why anyone will...
# datascience
a
As for debugging. I do not imagine why anyone will use full debugger for the notebook, but some debugging would be nice, so here is a kotlinish-notbookish solution: • Introduce a wrapper interface
DebugContext
like this:
Copy code
interface DebugContext{
  fun <T> trace(value: T): ReadWriteProperty<Any?, T>

  (suspend) fun breakPoint()
}
• The idea is that you can wrap any variable in the context in a delegate and dump all changes to a debug container. When the
breakPoint
is called, the execution will block/suspend and dump current debug state to console/output widget and wait for user input to unblock. This could be implemented on a library level based on the notebook API. The usage will look like this:
Copy code
%%debug
var a by trace(4)
repeat(10){
  a++
  breakPoint()
}
If you like this idea, I can write an issue from it. I personally prefere not to do complex code in the notebook and move all heavy logic to the project.
i
Have you seen an implementation of debugger in python notebooks?
a
No, probably I stopped working a lot with Python before it arrived. It looks interesting, but it seems it will require a lot of effort and actual JVM debugger attached to the process. Does scripting engine support source mapping?