vscode-debug-visualizer icon indicating copy to clipboard operation
vscode-debug-visualizer copied to clipboard

what do I need to do to add full python/Language X support?

Open skewballfox opened this issue 5 years ago • 37 comments

hey, noob here. I've never actually contributed to a repo that wasn't mine.

I wanted to contribute to this project, and start adding full support for other languages(python, java, rust, cpp). I saw that data extractors are necessary to convert the data to a serialized json format.

Are those visualizers supposed to be in that given language or in javascript? Also, I want to get familiar with the project structure. What would you consider the entry point to be? how does the flow of execution generally look?

skewballfox avatar Jul 20 '20 17:07 skewballfox

Hey thanks so much for your interest! Super cool that you want to add support for Python - that's a language I barely know and already wanted to add.

If you like, we can schedule a meeting to discuss how we can add Python! What do you think?

hediet avatar Jul 20 '20 17:07 hediet

I saw that data extractors are necessary to convert the data to a serialized json format.

Yes.

Are those visualizers supposed to be in that given language or in javascript?

They are supposed to be in the given language or in whatever additional language the debugger offers.

Also, I want to get familiar with the project structure. What would you consider the entry point to be? how does the flow of execution generally look?

Key component is the EvaluationEngine and Evaluator interface and their implementors. Probably a PythonEvaluationEngine will be required.

The most difficult thing for Python would be:

  • Identify which data structures Python offers and what visualizations would suit them best (and which additional visualizations might be cool)
  • Think of something how the debugger can inject common data extractors into the python runtime so that the user does not need to install libraries
  • Think of something how users can implement their own data extractors (if they want to implement an adapter that can extract json for their own data structures)

hediet avatar Jul 20 '20 17:07 hediet

If you like, we can schedule a meeting to discuss how we can add Python! What do you think?

Yeah, that sounds great. When would work for you?

They are supposed to be in the given language or in whatever additional language the debugger offers.

I'm guessing that should be found somewhere in the python debugger used by vscode?

Key component is the EvaluationEngine and Evaluator interface and their implementors. Probably a PythonEvaluationEngine will be required

PythonEvaluationEngine have to be interfacing with the existing debug session right?

sorry if these questions are kinda basic.

skewballfox avatar Jul 20 '20 19:07 skewballfox

When would work for you?

In the next few days I'm very flexible. What about tomorrow 10am CET here on jitsi?

hediet avatar Jul 20 '20 20:07 hediet

PythonEvaluationEngine have to be interfacing with the existing debug session right?

Kind of, but this is pretty easy - I can help you with all that stuff.

hediet avatar Jul 20 '20 20:07 hediet

probably later in the day, I'm in CST which puts that around 3am

skewballfox avatar Jul 20 '20 21:07 skewballfox

What about this time range: https://www.worldtimebuddy.com/?qm=1&lid=2892794,6&h=2892794&date=2020-7-21&sln=18-23.5

hediet avatar Jul 20 '20 21:07 hediet

yeah, any time in the block would be great

skewballfox avatar Jul 20 '20 22:07 skewballfox

So 6pm CET then on jitsi (just click this link)? Happy to meet you and to discuss the Python support! I think Python programmers are used to visual tools and might really like this extension.

hediet avatar Jul 20 '20 22:07 hediet

6pm CET sounds great

yeah, I've been prepping for technical interviews and doing a lot of algorithm problems so this is definitely going to come in handy.

skewballfox avatar Jul 20 '20 22:07 skewballfox

yeah, I've been prepping for technical interviews and doing a lot of algorithm problems so this is definitely going to come in handy.

No worries, I'm a CS student too and you probably won't need complex algorithms for this project ;)

hediet avatar Jul 20 '20 23:07 hediet

May I know what is the status for this ?

abhishek-ch avatar Aug 29 '20 18:08 abhishek-ch

There still is work to do ;) If you would like to help, please reach out!

hediet avatar Aug 29 '20 18:08 hediet

love to , does the fix needs programming in TS/JS or ...

abhishek-ch avatar Aug 29 '20 20:08 abhishek-ch

Not necessarily!

hediet avatar Aug 29 '20 20:08 hediet

I would like to help

mvoitko avatar Aug 29 '20 21:08 mvoitko

It needs a bit of both TS and Python. I wrote part of the necessary python code, but didn't make it too far with the necessary TS code

skewballfox avatar Aug 29 '20 22:08 skewballfox

That is awesome!

  1. I think the first step would be to document which python values should be visualized and how they should be visualized. For now, the "how" should be one of the existing visualizations. All those existing visualizations can be described with JSON, so the goal would be to collect (python value, JSON document) tuples.

  2. Then, we can think of python functions that build such JSON documents from such a python value. For the debug visualizer, such a function is called "Data Extractor". These python functions also need to decide whether they can extract a JSON document for a given value and how good the extracted visualization data is in terms of a numerical priority. Each such data extractor should have a unique id.

  3. Given a list of those data extractors, an optional preferred data extractor id and some value, we need some logic to return the best visualization data for that value, considering the preferred data extractor id. Also, all applicable data extractors should be reported (so that the user can select one of them, this is already implemented).

  4. Now we need a way to make this data extraction library available to all python scripts. In case of javascript, the debug visualizer extension just evals the library into the debuggee.

Users should be able to easily define their own data extractors.

hediet avatar Aug 29 '20 22:08 hediet

I think if python support is added to this project, it will huge benefit to lot of people. Just out of curiosity, as python is known for its dynamic typing, how will we tackle that while creating the visuals?

bhavintandel avatar Aug 29 '20 22:08 bhavintandel

@bhavintandel I don't know, I have close to zero experience with python. I guess there is some kind of instanceof check too. Everything else has to test structural matching.

hediet avatar Aug 29 '20 23:08 hediet

I think I have the skillset and am willing to take up responsibility of the Python side of the project. But will need a lot of support from others. As I have severe time constraints.

Shivamshaiv avatar Aug 29 '20 23:08 Shivamshaiv

Hey, I'd like to help too, have a medium skillset of python here. I wanna do some side projects while in free time at college/work/research. Still, at my work, i use Python tho.

isoletslicer avatar Aug 30 '20 05:08 isoletslicer

@Shivamshaiv @isoletslicer @mvoitko @abhishek-ch Awesome that you are all interested in contributing 🎉 I'm looking forward to great python support 👍 What do you think of my plan? I think we can collect these value-visualization tuples independently. And then merge and discuss them. Maybe we can already start with the second step, even though we probably may need to change the code later.

hediet avatar Aug 30 '20 07:08 hediet

Many more are interested in adding support for #python , this is amazing

abhishek-ch avatar Aug 30 '20 10:08 abhishek-ch

I find this project interesting. Can I also be a part of the python support for this project? Want to take it as a side project and learn a lot of new things.

Rdroshan avatar Aug 30 '20 12:08 Rdroshan

@Rdroshan Of course! ;) Please have a look at the steps that I outlined above :) I suggest to start with the (python-value; visualization-data) tuples as gist file!

hediet avatar Aug 30 '20 12:08 hediet

This will be a lot easier to implement now that we have more than a few people wanting to work on this. Here's a gist containing the incomplete python implementation of the supported data types, splitting this into multiple files and turning this into a library should be easy enough.

As I understand the code(I could be wrong), we still need to call this from a typescript file that implements the PyEvaluationEngine, so that it can pass the output of this program to the visualizer. for reference this is the evaluation engine for javascript.

if my understanding of the code is correct, That should be the only necessary typescript component.

skewballfox avatar Aug 30 '20 14:08 skewballfox

Hey everyone, I've been working with python for quite a while now. Would love to contribute here, how do I get started?

GrantorShadow avatar Aug 31 '20 10:08 GrantorShadow

@GrantorShadow awesome! I posted a list of steps further up ;)

hediet avatar Aug 31 '20 11:08 hediet

@GrantorShadow Hey , got to see the comment thread today, I have medium to good hands on experience with Python and I would like to contribute!! Saw the steps you outlined, would love to hear back from you.

udaypb avatar Aug 31 '20 15:08 udaypb