I've been trying to learn a lot about web development lately, and in the back of mind there's always been the idea of "porting" SFML to "the internet" (whatever the correct terms for that are), especially once 2.2 comes out and we have an OpenGL ES implementation to refer to.
Not that I'd actually start working on this anytime soon, but I wanted to ask what people thought of the idea and make sure that some of the rather strong conclusions I'm coming to aren't misguided. So please correct me if any of these are wrong:
1) If a web page is to contain a "real-time game" of any sort (eg, a platformer as opposed to sudoku), that game's code must run client-side.
2) There is simply no good cross-browser/platform/etc way to do client-side C++. CGI and FastCGI allow for server-side C++, and the Wt toolkit is based on that sort of thing, but that doesn't help us.
3) The one and only cross-everything client-side web programming language is Javascript.
4) The C++ concept of a "game loop" doesn't cleanly translate to Javascript, so any direct cross-compilation would be a pain in the ass at best (basing this one on my brief tests of emscripten).
Assuming these impressions are correct, it seems like a "web SFML" simply could not be a C++ library, and the closest we could get would be one or more Javascript scripts/.js files with a bunch of convenience functions wrapping around WebGL as well as the event handling/image loading/audio playback/etc already built into HTML5/Javascript. Perhaps SFMS--Simple and Fast Multimedia Script? Does anyone here think a project like that would be worthwhile? Quick googling implies the existing WebGL libraries are mostly 3D engines, not 2D like SFML. Or would it be better to try and get SFML support into emscripten, like its existing SDL support?
Edit: Now that I've stumbled across Pixi.js, it looks remarkably similar to SFML in spirit, design and graphics functionality (it even calls itself a "fast lightweight 2D library that works across all devices"). I'm gonna spend some time on a detailed comparison of these two. It might be that the best implementation of "SFMS" is a wrapper of Pixi.js plus whatever bits of SFML it doesn't have but still make sense in a web page (eg, audio).