berinhard/pyp5js

Skulpt runtime

nickmcintyre opened this issue · 3 comments

Hello! I've been working on a Skulpt wrapper for p5.js and wonder if it might be of interest as another runtime for pyp5js. Here's a repl that you can use to try it out.

We've modified p5.js a bit for use in our math classes (coordinate system, graphing, etc.) but the wrapper works fine without these mods.

This probably relates with #179 too. It's possible that just adding a new skulpt mode in the templates dir and configuring the lib to accept it will do the job here and, probably, the same strategy can work for Jupyter too.

Cool! I'll open a pull request when I have something working. One question to start re: Skulpt versions.

Our environment is based on a Skulpt fork that implements a very nice FFI -- no telling if / when the FFI will be merged into the main Skulpt project. I'm also revisiting an old pull request to add a p5 module to Skulpt using the same mechanism they used for Processing.js.

Do you have a preference between the approaches?

I'm more a fan of a default version than a custom form form Skulpt. So, maybe this old PR can be a good point to work with.

Anyway, the beast approach for me would be a more similar to what we have with pyodide and transcrypt, that is:

  • A skulpt directory under the pyp5js/templates/ dir;
  • A skulpt index.html.template that should be used by pyp5js to generate the final index.js;
  • A target_sketch.js.template that should handle any JS specific binding between p5.js + skulpt IDE;