On Thu, Nov 10, 2011 at 2:20 AM, Philippe Lhoste <PhiLho@gmx.net>
So, if I am not mistaken, Emscripten is able to run Lua code typed in the browser without assistance from a server, while lua2js would need to send the script to a server with a Python module to translate the code and send it back to the browser. Right?
Both approaches are interesting. As I believe the Emscripten was generated (by LLVM?), it should have a complete support of Lua features, but need to run a heavy machinery, not necessarily optimized for its target language (C idioms/pattern/tricks used in the Lua code might not be optimal for JS) to run the scripts, while lua2js probably generate a lighter JS and this code can be heavily optimized by the browser's engine.
The non-runtime restriction is not there anymore since Lua code can now be compiled at runtime, of course.
Two interesting approaches.
I recall a failed attempt, some years ago, to make Lua to run natively (or with a plugin) in browsers, but the modern approach of using JS as the assembly language of browsers is probably saner, now that we have HTML5 (canvas and other facilities).
By saner, I don't mean it is a good idea, just that we don't have a choice (no standard bytecode here), if we want high compatibility, and well, it becomes usage, given the recent progress in JS engine speed.
-- (near) Paris -- France
-- -- -- -- -- -- -- -- -- -- -- -- -- --