electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
142 stars 29 forks source link

Compile for web? #45

Closed d1ddle closed 2 years ago

d1ddle commented 2 years ago

Is it possible to use raylib-python-cffi to develop a raylib game and compile it for html-5? If so, how? Cross compile from python to C and use the normal raylib compiling method? Many thanks

electronstudio commented 2 years ago

I don't know. I don't know the current state of python-on-the-web but historically it wasn't good. So first step would be working out how to get a Python program on the web.

I wasn't aware of any cross compiler from Python to C. Looks like Cython will get you C code.

The old way was to transpile Python to Javascript, so if you did that you'd then need a Javascript graphics library, not a Python one.

Maybe ask on the Discord for suggestions.

d1ddle commented 2 years ago

Woah, Thanks for the swift reply, that was fast! I'll definitely look at Cython. Would that theoretically mean that the Cython code could compile to raylib-web as if it were written in C from the beginning? I really want to avoid C. Would that also mean I could use PyPy? Edit: is there a raylib-python-cffi discord or should I join the normal raylib discord? I assumed they wouldn't know much about it Edit: found it :) Thanks for your help @electronstudio 👍