radian-software / riju

⚡ Extremely fast online playground for every programming language.
https://riju.codes
MIT License
1.64k stars 191 forks source link

Adding debugger for languages? #167

Open RahulBadenkal opened 2 years ago

RahulBadenkal commented 2 years ago

Hi, How hard/compilcated do you think it is to add a debugger option like this. ? I went through the roadmap but didn't see any plans of adding debugger and was thinking if maybe I can help with it, but I am unsure on how one would go about it? Any ideas?

RahulBadenkal commented 2 years ago

I was trying to understand how this website does it but i noticed that no http/websockets calls that go when i run/debug the code. Does this mean its just compiling every language to javascript and just executing it on browser?

raxod502 commented 2 years ago

See https://github.com/radian-software/riju/issues/168, just FYI.

That said, let me see what I can do about answering your questions.

image

I'm not 100% sure how the debugger integration works, it's possible that the buttons are literally just sending words like continue and next on stdin to the pty, although that doesn't quite explain all the behavior I see. pdb might have some kind of control port that can be used to issue commands out of band.

rahulwecp commented 2 years ago
  1. Ya they use websockets, my bad. Most likely I opened my network tab after the websocket connection was established, so missed it.
  2. Thanks for the input. Will try to make one for python just to get an idea of how things happen.

PS: Awesome project!

raxod502 commented 2 years ago

Yeah, if you want to have a good time, rather than starting from the mess I have made in Riju, you might want to actually take https://github.com/radian-software/python-in-a-box as a starting point.

raxod502 commented 2 years ago

(Same underlying technology but way simpler because it does not attempt to do everything.)

RahulBadenkal commented 2 years ago

Yeah, if you want to have a good time, rather than starting from the mess I have made in Riju, you might want to actually take https://github.com/radian-software/python-in-a-box as a starting point.

This is really easy to understand. Thanks!

RahulBadenkal commented 1 year ago

Hi, This is what i could come up with: https://github.com/RahulBadenkal/python-in-a-box-debugger

Reference loom: https://www.loom.com/share/0f0d65d0087b46babfc8f1e1c03515ae

Minor change:

Idea:

Trying to replicate pycharm's debug functionality, but faced a few issues right off the bat: