dt-python-parser icon indicating copy to clipboard operation
dt-python-parser copied to clipboard

Python Code Generator and Tree-Rewrite Engine for Python Parser

Open evonox opened this issue 3 years ago • 3 comments

Hi all, in my Python IDE I need emulate synchrounous Python code in the browser. The reason for this is that we cannot teach young students asynchronous programming paradigma using async and await keywords. The path I want to do this is using dt-python-parser, then to use a grammar-based tree-rewrite engine for AST to rewrite synchronous code to asynchronous and finally use a Python synthetizer to generate Python Code again.

  1. Before I will implement Python Code Generator and Python Tree-Rewrite Engine I want to ask if anyone is not already working on this issue.

  2. My second question is if you want this contribution to make part of dt-python-parser? It would be quite fine to have it in one library.

Thanks very much for answer.

evonox avatar Apr 09 '22 13:04 evonox

cannot teach young students asynchronous programming paradigma using async and await keywords

@evonox Sorry, I can't understand that~ I think that implementing Python Code Generator and Python Tree-Rewrite Engine are big and complex work. we know that Python is a very mature language, I think you can find out some implements in the community.

The background of dt-python-parser is that supporting our frontend project, which only needs syntax check, code formatting, and so on simple features. so I think to make it be part of dt-python-parser is not suitable.

wewoor avatar Apr 11 '22 03:04 wewoor

@evonox is your rewrite engine available publicly anywhere yet? You asked a little over a year ago. I do a little Python parse tree restructuring and rewriting in my use of DT Python Parser but my rewrite code is heavily coupled to the rest of my application and I won't be willing to releasing the code very openly any time soon. I'm up for sharing concepts and brainstorming ideas, if you want to learn a bit from what I've done, though. Want to share an email address or another way to get in touch?

joshi1983 avatar Jun 22 '23 18:06 joshi1983

@joshi1983 To be honest, my idea for Python Rewrite engine remained only idea. But if there would be an interest, it might be a great tool to create in an open-source way. My initial idea is to take inspiration in BabelJS and create it in the similar architecture. What do you think?

evonox avatar Jun 22 '23 19:06 evonox