On Mon, Apr 17, 2017 at 10:29 AM, Paul Kaletta <pk@xxxxxxxxxxxxxxx> wrote:
Am 17.04.2017 um 17:43 schrieb Coda Highland:
On Sat, Apr 15, 2017 at 9:43 AM, Paul Kaletta <pk@xxxxxxxxxxxxxxx> wrote:
I'm not sure I understand the impetus. WebAssembly is already
Hi everybody,
I recently learned about WebAssembly/WASM, a bytecode format for web
browsers.
https://en.wikipedia.org/wiki/WebAssembly
http://webassembly.org/
The format is suitable as a compilation target for C/C++ compilers, and
so
the original Lua already runs in a WASM environment.
https://github.com/vvanders/wasm_lua
Are there any plans add a WebAssembly target to LuaJIT? I realize that
porting LuaJIT to a new target architecture is quite an undertaking, but
I
wanted to inquire whether there is any hope.
Best regards,
Paul
JIT-compiled, and you wouldn't have access to the FFI, so what benefit
would LuaJIT derive from such a port?
/s/ Adam
My guess is that WASM is not JIT-compiled, but "statically" compiled to
native machine code. If I understand things correctly, WASM is more like (a
portable variant) of LLVM bit-code and less like Java byte code. Full
translation to target machine code can happen before execution, there is no
tracing JIT compiler involved.
If LuaJIT's fast interpreter was ported to WASM, LuaJIT (the language) would
become available in the browser. I don't know enough about LuaJIT's trace
compiler to asses whether it can be made to emit WASM. This is why I
inquired.
I also don't see why LuaJIT's FFI should not be available. If one can
compile C to WASM, and LuaJIT's interpreter was available in a WASM version,
it should be possible to call C code from LuaJIT programs via LuaJIT's FFI.
I would love to use LuaJIT (the language) as a scripting language in my
program, but so far LuaJIT (the implementation) will not run in the browser.
If I want the same scripting language both in the browser, and in a "native"
environment, I need to go with PUC Lua. I think that WebAssembly will only
become more and more important, especially for game developers.