nir / jupylet

Python game programming in Jupyter notebooks.

Home Page:https://jupylet.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ENH: JupyterLite, WebGL

westurner opened this issue · comments

I don't think it can be made to work without a SIGNIFICANT amount of work

Hopefully the compiler will do most of that work. Maybe @martinRenou knows of an example emscripten-forge empack package that has OpenGL/EGL code?

ipygany does 3D in notebooks with VTK, which may or may not already be transpiled to WASM IIUC
https://github.com/QuantStack/ipygany

There may need to be a 'polyfill' like requests-wasm-polyfill?
https://github.com/emscripten-forge/recipes/blob/main/recipes/recipes_emscripten/requests-wasm-polyfill/recipe.yaml

Students could easily develop and share STEM games with a WASM compilation of jupylet that works in JupyterLite or VSCode.dev

Maybe @martinRenou knows of an example emscripten-forge empack package that has OpenGL/EGL code?

I don't!

ipygany does 3D in notebooks with VTK, which may or may not already be transpiled to WASM IIUC

ipygany only uses VTK on the back-end for file loading, the rendering is done entirely using WebGL.

From time to time I google to see if Kitware folks provide an easy way to compile VTK for WASM, thankfully today you triggered that search and it seems to be fruitful https://gitlab.kitware.com/vtk/vtk-wasm-docker (initial commit a month ago).

Though I guess all of this VTK discussion is completely out of scope for jupylet, so sorry for the spamming. If you want, @westurner, I'd be happy to have this discussion under an ipygany issue.

hi @martinRenou, you were one of the first people to star jupylet when it first came out. thanks! :)

@westurner, I don't have the time to jump into such a project at the moment, but I see that jupyterlite supports numpy ipywidgets and ipyevents, and is using async just as classic jupyter, so actually it may be possible to put aside audio, 3d, and sharertoy support and just reimplement the sprites and labels modules and start with them and get an initial version of jupylet for jupyterlite and continue from there (that is how jupylet started anyway).

an example emscripten-forge empack package that has OpenGL/EGL code?

It looks like there's already glfw support in emscripten.

Is VTK actually out of scope? There probably could be a VTK backend; IDK what the advantage would be.

actually it may be possible to put aside audio, 3d, and sharertoy support