3

this is the first time i post here and i would like to ask for help.

My objective is to make the task of learning Processing more interactive and easier. To do that, I am developing an educational program simulation tool. My question is how could i do this integration of my code with the Processing IDE. I’m doing a translator for Processing as the title suggests. And my goal is to integrate it in the Processing IDE with a few extras. One extra would make it possible to stop, pause and run my code step by step while the graphics appear and disappear in relation to the current line of code. To give you a visual idea of what it may look like please check this website: https://visualgo.net/en. Other extra is to make the graphics interactive and non-static so we can see them being draw like, for example, turtle framework from python.

Any tips are appreciated.

Here’s my code so far: GitHub.

Thank you all. Duarte Carvalho

IReback
  • 31
  • 2
  • 1
    This is probably not the right place to ask for general help (I would try the Processing forums, honestly), but your project looks really interesting. Good luck! – laancelot Mar 15 '21 at 16:55
  • @laancelot i already tried that, that's why i'm here! Thank you – IReback Mar 16 '21 at 10:43
  • 1
    @IReback I've updated the answer with a link you may find interesting: https://p5stamper.com/ – George Profenza Mar 30 '21 at 00:12
  • Building a translator is hard. See my StackOverflow answer discussing many issues, all of which will generally apply to Processing: https://stackoverflow.com/a/3460977/120163 – Ira Baxter Mar 30 '21 at 03:19
  • @GeorgeProfenza Thank you for your time, i'll take a look. I decided to do a tool but so far I'm having troubles with all the function available. – IReback Mar 31 '21 at 10:43
  • @IReback Feel free to post a separate question with the specific issue regarding the Tool. (You can peek into the [Base class here](https://github.com/processing/processing/blob/master/app/src/processing/app/Base.java) to get idea of what it handle) – George Profenza Apr 02 '21 at 03:53

1 Answers1

2

That is a very interesting project. I'm afraid I don't know enough about ASTs / Flex / Bison at this time to provide a detailed answer in this area. Hopefully I can provide a couple of tips on the Processing side:

  1. If you want to integrate with the Processing IDE you can implement the Tool interface. For more details see the Processing Tool Basics wiki. As a simple example you can checkout GettingStarted
  2. If you need to run command line tools from the IDE you could have a background thread use PApplet's launch() or exec() (and use the returned Process to access the required streams)
  3. I like the idea of explainable computing and approaches like visualalgo a lot. I recommend also checking out Bret Victor's Learnable Programming blog post.

Update Even though this is p5.js, not Processing (Java) precisely, it's worth having a look: https://p5stamper.com/

p5.js may be an interesting (and hopefully less verbose) route

George Profenza
  • 50,687
  • 19
  • 144
  • 218