Davidobot / love.js

LÖVE ported to the web using Emscripten, updated to the latest Emscripten and LÖVE (v11.5)
MIT License
624 stars 28 forks source link

LuaJIT `bit` module unsupported #15

Open pfirsich opened 4 years ago

pfirsich commented 4 years ago

Sorry that I didn't do much investigation, but I just tried it out quickly and noticed that the bitops module cannot be required. I guess the Lua implementation used by love.js does not support it, but there should probably be a replacement provided.

pfirsich commented 4 years ago

And for the stuff that can't be easily fixed/replaced (like FFI), there should maybe be a general note in the README that love.js does not support LuaJIT-specific features.

Davidobot commented 4 years ago

Ah, yeah. LuaJIT can't be compiled by emscripten. I'll add a note.

pfirsich commented 4 years ago

The bit module can be implemented in pure Lua though, for example like it's done here: https://github.com/AlberTajuelo/bitop-lua. I haven't properly checked that library, but something like that could be included automatically.

MikuAuahDark commented 4 years ago

I'd suggest LuaJIT's standalone bit library to be added to love.js instead of relying on pure Lua implementation which has inferior performance compared to C bindings. https://bitop.luajit.org/