News for hackers. Stuff that matters.
Re:CPython's main branch running in the browser with WebAsse... by trothamel on Sunday November 28, 2021 @11:53PM (#29376526)
Although it's only Python 2.7, cpython-based games have been running in the web browser for years.

https://beuc.itch.io/the-question-web

(I'm the lead developer of Ren'Py, though Sylvain Beucler did most of the work. He also has a 3.8 port here: https://www.beuc.net/python-emscripten/python/dir?ci=tip )

Re:CPython's main branch running in the browser with WebAsse... by dmw_ng on Monday November 29, 2021 @12:14AM (#29376650)
The PyPy team demoed a networked multiplayer browser-compiled Python game at EuroPython in 2006. Anyone remember the details? Seems it has dropped off the face of google.
Re:CPython's main branch running in the browser with WebAsse... by azakai on Monday November 29, 2021 @11:19AM (#29381595)
I don't remember that game specifically, but I assume it used PyPy.js,

https://github.com/pypyjs/pypyjs

Re:CPython's main branch running in the browser with WebAsse... by doublepg23 on Monday November 29, 2021 @12:03AM (#29376582)
Ren'Py is a joy to use and an excellent project.
Re:CPython's main branch running in the browser with WebAsse... by trothamel on Monday November 29, 2021 @12:04AM (#29376592)
Thank you.
Re:CPython's main branch running in the browser with WebAsse... by pwang on Sunday December 05, 2021 @11:45PM (#29456252)
The homepage that's linked from Github seems to be down? https://renpy.beuc.net/
Re:CPython's main branch running in the browser with WebAsse... by ethanhsmith on Monday November 29, 2021 @02:21AM (#29377281)
Yep! I definitely want to build on and learn from existing patched versions of Python running in the web. Do you know what you folks do for synchronous I/O calls?
Re:CPython's main branch running in the browser with WebAsse... by trothamel on Monday November 29, 2021 @02:42AM (#29377372)
Of course. It will be nice to have the upcoming Python 3 version of Ren'Py based on the main branch, so we don't have to maintain patches.

Right now, most of the I/O is synchronous - the files are downloaded to the browser before a game starts, so all of the calls are fast, so far as I can tell, as they're happening within the browser.

Output is through SDL, and there's a call into a cython-defined function that calls __emscripten_sleep, with the path of calls to it listed in the ASYNCIFY_WHITELIST. That's the only place we block. (It's a bit late, so I might be misremembering the exact emscripten function.)