Add Python Tracer
Hi, I'm interested in working on a Python tracer. It seems pretty straight forward: write the tracer, add a Dockerfile to the backend, and port the algorithms to Python (though this seems like it can be saved for later given neither C++ nor Java have any algorithms yet). Would this be a welcomed contribution?
Of course it is a welcomed contribution, and I would appreciate it. Let me know if you need any support.
Great to hear. I will start working on it probably next week (currently in the middle of some other work). It seems best for the repo to be created under your organisation, right?
Awesome, I just created tracers.py repository. Feel free to send a pull request to it!
@MarkKoz Is there any news on this ?
@MarkKoz Is there any news on this ?
I have been busy recently and I assume so is @MarkKoz, but I will continue working on it whenever I get some free time (hopefully within 2 weeks).
I'll try to get back on it within a similar time frame. I'd like to get it to a working state as it's crude and completely untested right now.
Update: started working on unit tests. Not the most fun to write but it's getting there. Will open a draft PR once I've finished at least one batch of tests. Has already revealed some errors in the code to me which I've patched up along with the circular import error.
Sounds great, I'll also start to work on deploying the library to Python Package Index and creating AWS Lambda function to compile codes soon.
@MarkKoz @parkjs814 , May I ask do we have a tracer for python yet? wondering where can I find more info on this. Thanks.
It exists here https://github.com/algorithm-visualizer/tracers.py but is not really functional yet. Progress has stalled. I had a PR open which hasn't been merged yet and I moved onto other things. Sorry for that, I should have been more pushy to get it merged. At this point, I imagine some things are out of date compared to the other tracers. I will try to revisit the project next month. Of course, anyone else is welcome to contribute too.
My huge apologies to @MarkKoz that I still haven't had much spare time to work on integrating your work into the project. What should be done is to create a extractor.py repository, which would be an AWS Lambda function to compile/run user-submitted code with tracers.py library.
I would appreciate if someone experienced in Python and AWS Lambda can contribute to it. If anyone interested, I can give more details.
@parkjs814 @MarkKoz I would have time after next week. Would you pass along more details and I will take a look at it. Thanks for putting everything together.
@phuang07 Thanks for your interest! Let me explain how Algorithm Visualizer supports Java first, since supporting Python would almost exactly resemble it.
-
git pushtotracers.javatriggers Travis CI to:- publish a new version of the visualization library to the JitPack repository.
-
After the publication, it triggers another Travis CI on
extractor.javato:- download the newest version of the visualization library from JitPack, and
- build/deploy the AWS Lambda function.
-
When the AWS Lambda function receives a request having user-submitted code as payload, it compiles/runs it and sends back the extracted
visualization.json.
Looking into the following files would be helpful to understand the concept:
- Travis CI setup on
tracers.java: https://github.com/algorithm-visualizer/tracers.java/blob/master/.travis.yml - Travis CI setup on
extractor.java: https://github.com/algorithm-visualizer/extractor.java/blob/master/.travis.yml - AWS Lambda function: https://github.com/algorithm-visualizer/extractor.java/blob/master/src/main/java/org/algorithm_visualizer/Extractor.java
For now, you can forget about 1-i and 2-i. (This is because I am thinking of NOT publishing the visualization library to an external repository at all and only using it within the AWS Lambda function, hence merging tracers.* into extractor.* eventually.)
Here are the steps needed to be done when you work on the extractor.py repository:
- Manually install the visualization library (by copying the content of
tracers.pyprobably?), so that the AWS Lambda function can compile/run user-submitted code with it. This step would replace 1-i and 2-i. - Rewrite
Extractor.javain Python. - Adjust
.travis.ymlfor Python.
Let me know if you have any questions!
Great. Will look into this.
I am also interested in adding python to algorithm-visualizer. Is it possible to simplify the development by using some tool like Brython or transcrypt that can run python directly in the browser, no aws needed? The only problem I expect here is the code editor support for source maps.
I am also interested in adding python to algorithm-visualizer. Is it possible to simplify the development by using some tool like Brython or transcrypt that can run python directly in the browser, no aws needed? The only problem I expect here is the code editor support for source maps.
Now you could try http://pyscript.net ...
[自动回复]您的邮件已收到,会尽快给您答复。
你的邮件已收到