Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
skewballfox opened this issue Jul 20, 2020 · 37 comments
Open

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

skewballfox opened this issue Jul 20, 2020 · 37 comments

Comments

@skewballfox
Copy link

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?

@hediet
Copy link
Owner

hediet commented Jul 20, 2020

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
Copy link
Owner

hediet commented Jul 20, 2020

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)

@skewballfox
Copy link
Author

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.

@hediet
Copy link
Owner

hediet commented Jul 20, 2020

When would work for you?

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

@hediet
Copy link
Owner

hediet commented Jul 20, 2020

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.

@skewballfox
Copy link
Author

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

@hediet
Copy link
Owner

hediet commented Jul 20, 2020

@skewballfox
Copy link
Author

yeah, any time in the block would be great

@hediet
Copy link
Owner

hediet commented Jul 20, 2020

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.

@skewballfox
Copy link
Author

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.

@hediet
Copy link
Owner

hediet commented Jul 20, 2020

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 ;)

@abhishek-ch
Copy link

May I know what is the status for this ?

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

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

@abhishek-ch
Copy link

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

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

Not necessarily!

@mvoitko
Copy link

mvoitko commented Aug 29, 2020

I would like to help

@skewballfox
Copy link
Author

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

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

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.

@bhavintandel
Copy link

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?

@hediet
Copy link
Owner

hediet commented Aug 29, 2020

@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.

@Shivamshaiv
Copy link

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.

@isoletslicer
Copy link

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.

@hediet
Copy link
Owner

hediet commented Aug 30, 2020

@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.

@abhishek-ch
Copy link

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

@Rdroshan
Copy link

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.

@hediet
Copy link
Owner

hediet commented Aug 30, 2020

@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!

@skewballfox
Copy link
Author

skewballfox commented Aug 30, 2020

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.

@GrantorShadow
Copy link

GrantorShadow commented Aug 31, 2020

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

@hediet
Copy link
Owner

hediet commented Aug 31, 2020

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

@udaypb
Copy link

udaypb commented Aug 31, 2020

@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.

@human02
Copy link

human02 commented Sep 1, 2020

Hi,

Even I would like to contribute to python implementation. This is a really cool project. I checked the 4 steps that you mentioned above. It's my first open source contribution, some guidance apart from the aforementioned steps will be really helpful.

Thank you and hope to hear back from you soon!
TC.

@hediet
Copy link
Owner

hediet commented Sep 2, 2020

Hey all! Did you manage to work on some of the steps I suggested? ;)
@skewballfox already opened a PR in #81 (huge thanks for this!). I'm no python expert, it would be awesome if some of you could have a look at it ;)

@mvoitko
Copy link

mvoitko commented Sep 2, 2020

@hediet I have already left some comments

@skewballfox
Copy link
Author

if you guys want to contribute to the python implementation but don't want to merge the python implementation into the existing plugin until completed, you could do pull request on my branch

@skewballfox
Copy link
Author

Hey I figured I would post an update here. I talked to @hediet a few days ago about how the library needs to interact with the existing extension.

If I understood the requirements we need some way to make the library available to the python debugger. He was suggesting code injection.

@GrantorShadow @mvoitko @Shivamshaiv @abhishek-ch @Rdroshan
if any of you have experience with code injection, or have some vscode specific insight that would make the library available without injection, I could definitely use the help.

@skewballfox
Copy link
Author

if anyone wants to tackle the code injection just do a pull request on my branch, it should be just python. we add the necessary typescript components after we have something that can make the classes/functions available to the python debug session(the attached debuggee)

@human02
Copy link

human02 commented Sep 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests