ENIGMA Forums

General fluff => General ENIGMA => Topic started by: royboyjoytoy2 on December 14, 2014, 08:37:23 AM

Title: Compile to JavaScript
Post by: royboyjoytoy2 on December 14, 2014, 08:37:23 AM
Do you think it would be possible to build games in JavaScript using https://github.com/kripken/emscripten ?
Title: Re: Compile to JavaScript
Post by: Josh @ Dreamland on December 14, 2014, 11:04:57 AM
We've done so, actually (https://github.com/enigma-dev/ENIGMAjs). A long time ago. Unfortunately, the contributor base is spread too thin, as it is. The bigger problem at the time was that the compiler made it difficult to support C++ and JavaScript concurrently. That's since been mostly corrected, and I have been pushing out changes lately that improve the situation. I wouldn't get my hopes up for a JavaScript port renaissance in the near future, though.
Title: Re: Compile to JavaScript
Post by: TheExDeus on December 14, 2014, 11:47:30 AM
We also considered using LLVM for this, but the idea died. I guess we didn't want to switch compilers at that point (it would probably involve us switching to Clang). The one Josh talks about was actually an ENIGMA engine made in JS, for which game code was converted from EDL/GML to JS instead of C++. I think compiling to asm.js via Emscripten would create a lot faster code, than writing the whole thing in pure JS. Technically we could try that, but right now the biggest problem is that we don't have GLES support. Emscripten converts GLES to WebGL (which is essentially GLES), so it wouldn't probably convert our GL3 graphics system.
Title: Re: Compile to JavaScript
Post by: Wendigo on October 11, 2015, 05:39:58 AM
Sorry for digging out this old topic again but I'm interested in the state of EnigmaJS.
Somewhere I read that it was more or less a proof of concept. I recently downloaded the IDE and tried to run a project with a simple sprite on screen without any logic.
But the compilation progressbar stopps after about 1/10th of length. "writing game to html5"
Did you actually get so far as to make it compile something or is the fault on my side?