SpencerPark / IJava

A Jupyter kernel for executing Java code.
MIT License
1.1k stars 215 forks source link

idea: possible to add debugger to IJava on Google Colab? #153

Open david-romano opened 8 months ago

david-romano commented 8 months ago

Hi, I teach a remote introductory programming course in Java and had run into a wall because some of my high school students' schools blocked access to any cloud-based IDEs I found. That is, until I found that IJava could be used in a Google Colab Jupyter notebook, so thank you for that! The only — hopefully, temporary — downside is that I don't know of any way to add a debugger they can use in a notebook. I know that pdb abd ipdb seem to work for python, but I don't know enough about the magic that went into making IJava to know whether there's a simple way to add a debugger to the mix. Any thoughts? And thanks again for IJava and the recipe for adding it as a Google Colab kernel, @SpencerPark!

SpencerPark commented 8 months ago

Caught me at a good time, recently starting looking into this myself as well (https://github.com/SpencerPark/jupyter-jvm-basekernel/pull/29 for protocol additions in 5.5). The hope is that we can reuse most of the java DAP implementation from vscode, forwarding messages from/to the relevant Jupyter channels. Then it is just a matter of implementing some the jupyter specific extensions to that protocol if all goes well.

This will also require some refactoring on our side in actually running the kernel code in a separate jvm with the jdi enabled (IJava currently executes it in-process) but that is how jshell typically runs code so I don't see too many roadblocks there.

Maybe this all working smoothly is just wishful thinking, but that's the plan so far, will see how much progress the weekend brings. Also always happy to hear this project is being used for teaching, thanks for that :)

posenato commented 8 months ago

@SpencerPark Even at the University of Verona (Italy), I use Java to teach programming to bioinformatics students. :-)

david-romano commented 8 months ago

Caught me at a good time, recently starting looking into this myself as well (SpencerPark/jupyter-jvm-basekernel#29 for protocol additions in 5.5). The hope is that we can reuse most of the java DAP implementation from vscode, forwarding messages from/to the relevant Jupyter channels. Then it is just a matter of implementing some the jupyter specific extensions to that protocol if all goes well.

This will also require some refactoring on our side in actually running the kernel code in a separate jvm with the jdi enabled (IJava currently executes it in-process) but that is how jshell typically runs code so I don't see too many roadblocks there.

Maybe this all working smoothly is just wishful thinking, but that's the plan so far, will see how much progress the weekend brings. Also always happy to hear this project is being used for teaching, thanks for that :)

Great! It'll take a bit for me understand the details of what you're saying (all new territory for me), but I'm glad it's on the wishlist.