Coder Social home page Coder Social logo

Add Python Tracer about algorithm-visualizer HOT 18 OPEN

MarkKoz avatar MarkKoz commented on May 6, 2024 2
Add Python Tracer

from algorithm-visualizer.

Comments (18)

MarkKoz avatar MarkKoz commented on May 6, 2024 1

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.

from algorithm-visualizer.

krsch avatar krsch commented on May 6, 2024 1

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.

from algorithm-visualizer.

64json avatar 64json commented on May 6, 2024

Of course it is a welcomed contribution, and I would appreciate it. Let me know if you need any support.

from algorithm-visualizer.

MarkKoz avatar MarkKoz commented on May 6, 2024

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?

from algorithm-visualizer.

64json avatar 64json commented on May 6, 2024

Awesome, I just created tracers.py repository. Feel free to send a pull request to it!

from algorithm-visualizer.

srkn avatar srkn commented on May 6, 2024

@MarkKoz Is there any news on this ?

from algorithm-visualizer.

64json avatar 64json commented on May 6, 2024

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

from algorithm-visualizer.

MarkKoz avatar MarkKoz commented on May 6, 2024

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.

from algorithm-visualizer.

64json avatar 64json commented on May 6, 2024

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.

from algorithm-visualizer.

phuang07 avatar phuang07 commented on May 6, 2024

@MarkKoz @parkjs814 , May I ask do we have a tracer for python yet? wondering where can I find more info on this. Thanks.

from algorithm-visualizer.

MarkKoz avatar MarkKoz commented on May 6, 2024

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.

from algorithm-visualizer.

64json avatar 64json commented on May 6, 2024

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.

from algorithm-visualizer.

phuang07 avatar phuang07 commented on May 6, 2024

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

from algorithm-visualizer.

64json avatar 64json commented on May 6, 2024

@phuang07 Thanks for your interest! Let me explain how Algorithm Visualizer supports Java first, since supporting Python would almost exactly resemble it.

  1. git push to tracers.java triggers Travis CI to:

    1. publish a new version of the visualization library to the JitPack repository.
  2. After the publication, it triggers another Travis CI on extractor.java to:

    1. download the newest version of the visualization library from JitPack, and
    2. build/deploy the AWS Lambda function.
  3. 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:

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:

  1. Manually install the visualization library (by copying the content of tracers.py probably?), so that the AWS Lambda function can compile/run user-submitted code with it. This step would replace 1-i and 2-i.
  2. Rewrite Extractor.java in Python.
  3. Adjust .travis.yml for Python.

Let me know if you have any questions!

from algorithm-visualizer.

phuang07 avatar phuang07 commented on May 6, 2024

Great. Will look into this.

from algorithm-visualizer.

villares avatar villares commented on May 6, 2024

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

from algorithm-visualizer.

lxzzz avatar lxzzz commented on May 6, 2024

from algorithm-visualizer.

bookerdong avatar bookerdong commented on May 6, 2024

from algorithm-visualizer.

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.