jmckaskill / luaffi

Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.
469 stars 84 forks source link

Support Emscripten #69

Open TurkeyMan opened 9 years ago

TurkeyMan commented 9 years ago

Emscripten is an important target where LuaJIT is not supported.

Uzume commented 3 years ago

Emscripten is an LLVM-based C/C++ to WebAssembly compiler. Since luaffi is based on DynASM from LuaJIT which does not use LLVM, it seems highly unlikely to ever support such a thing.

It seem more plausible to add WebAssembly architecture support directly to DynASM and LuaJIT, although I doubt it will happen anytime soon unless someone else provides a patch/pull request.

Even if someone was considering making such a port, one would want to consider how valuable it would be considering WebAssembly is also a virtual machine which may have its own JIT implementation. It might be better to make an FFI without a JIT like DynASM for such a case.