Code Monkey home page Code Monkey logo

Comments (7)

rahulwecp avatar rahulwecp commented on July 16, 2024 1
  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!

from riju.

raxod502 avatar raxod502 commented on July 16, 2024 1

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.

from riju.

RahulBadenkal avatar RahulBadenkal commented on July 16, 2024 1

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!

from riju.

RahulBadenkal avatar RahulBadenkal commented on July 16, 2024 1

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:

  • Using built in child process package of node instead of node-pty. As needed to separate out stdin and stdout content.

Idea:

  • Same as what you suggested last time, using python3's pdb module and piping the output from the terminal to browser.

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

  • The program in pdb auto restarts after ending, i would prefer it to terminate
  • Not sure how to get the current line number. The info is there in the terminal's stdout, but the only way i can think of extracting it is some sort of regex/string processing but then since the data from the terminal comes in batches and not all together not sure how to apply regex on a continuos stream?

from riju.

RahulBadenkal avatar RahulBadenkal commented on July 16, 2024

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?

from riju.

raxod502 avatar raxod502 commented on July 16, 2024

See #168, just FYI.

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

  • How hard do I think it would be? Probably a big project, but doable.
  • Is it on the roadmap? Yeah, I didn't have any plans for it, and I have other things on my mind, but it doesn't seem out of line for the project, so if it were implemented (and I get things unbroken enough to actually deploy updates) then I wouldn't object to merging it in.
  • How to go about it? I'm not sure. I'd have to do a survey of different languages' debuggers to see what the typical behavior is. You'd want to start by coming up with a set of abstractions that describes a debugger for an arbitrary language, and then figure out how those abstractions could be configured to invoke different language debuggers specifically. Then you'd wire up buttons on the frontend to trigger the relevant configurations on the backend, like how LSP is set up currently.
  • How does onlinegdb work? Looks like it's got a websocket to me, you might have just missed it.

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.

from riju.

raxod502 avatar raxod502 commented on July 16, 2024

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

from riju.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.