Use of web frameworks
What is the current thinking on the use of web frameworks for back-end and front-end parts of a game?I found this thread (https://pyweek.org/d/4062/) which is from 2011 and people seemed to agree it was OK then but I wanted to check some of the boundaries here and whether the thinking has changed.
My specific questions,
1. Is it still OK to use frameworks for the back-end and to host these yourself so that people do not have to get the back-end working on their machines to test the game. This also might be needed to allow the back-end to be shared (for leaderboards, collaborative games etc). Of course the code should be shared.
2. Is it OK for the front end of the core game to be HTML + JS based? I'm thinking here of a Django based solution. The HTML would be generated by the Django templating system but there would be JS logic in there and JS frameworks (like JQuery, Bootstrap, etc).
Unfortunately I can't compete in the February Pyweek because of other time commitments so this is more for future reference!
Paul
(log in to comment)
Comments
- pypyjs (pypy ported to JS via emscripten)
- Brython (a browser-based python implementation)
- batavia (a python VM that runs python 3.4 bytecode in javascript)
-
I've been considering these for the next pyweek. pypyjs and Brython are more mature, but batavia is maturing fast and has a much smaller overhead. The overhead for downloading pypy.js is several megabytes, Brython is smaller but still 2 MB or so last I checked.
transcrypt. transcrypt is a python3.5 -> Javascript compiler that generates readable javascript code. It's probably the most production-ready option out there for writing browser scripts in python.
I can't believe I forgot to mention
paulpaterson on 2016/02/13 18:46:
(replying to myself to share my own views!)It seems that #1 should be OK. It is still all Python generated during the competition and as long as the code is shared, saving people from setting up a big web stack just for testing seems reasonable.
#2 seems more problematic. Although the templating is python-like (at least for Django), a lot of the core logic might end up in Javascript.
Paul