If you want to hear my personal thoughts on the JavaScript backend, I hope that 
[WebAssembly](https://webassembly.github.io) will make the need for a 
JavaScript backend completely irreleval at some point in time in the future, 
but I do not know when that will be the case. But that's more a hope than 
knowing anything. To answer your questions.

  * The current OpenGL wrapper is a pure wrapper around the C bindings. I think 
you would at least need to put in some work, to make the wrapper work with 
webgl, if not write an entirely new wrapper, in case you are on the webgl 
platform.
  * Macros are very powerful, and they will devinitively allow you smooth out 
the database integration. It all depends on how much intelligence you want to 
put in there.



And then the question you did not ask: Do you think it is a good idea to 
compile an OpenGL application to JavaScript?

  * Generally, no. The problem with OpenGl application, or at least Games, is 
that they are real time applications, and you really do not want to miss 
frames. The problem with JavaScript, and all other gc languages is, that 
garbage collection freezes the application depending on how much memory you 
have. You might miss frames, and you won't be able to do anything about it. 
Smaller heaps can solve the problem, but that's something you do not have 
control over. In short the javascript version of the game will behave 
differently in respect to performance optimizations compared to the c version. 
Also the JavaScript version will consume a big amount of memory more than the C 
version, just because of the nature of Javascript, that everything is a 
reference type. This can all be a non-issue for you depending on the complexity 
of your app.


Reply via email to