Gamesys
Lua on the Web
- Lua.js
- Ljs
- lua.vm.js
- Moonshine
Lua.js
Lua.js
- Translates Lua code to JavaScript.
- Preprocess your Lua.
- Includes reimplemented standard library.
- 19k (5k gzipped) + translated code.
- Also runs in ActionScript (Flash).
Lua.js
Before:
After:
Lua.js
Result:
Löve
Lua.js
Support:
- Firefox 4+
- Chrome 14+ *
- Safari 4+ *
- IE 9+
- iOS 3+ *
- Android 2.2+ *
Lua.js
- A lot of Lua is not implemented, including:
- Coroutines.
- Pattern matching functions (gsub, find, match).
- require()
- xpcall()
Lua.js
- Not consistant:
- Incorrect coercions
- unpack()
- string.format()
- Length operator (#)
Lua.js
- Debugging
- Error message and stack traces are internal
- No source mapping
- Pain to inject variables in the Lua environment.
Lua.vm.js
Lua.vm.js
- C Lua compiled to JavaScript using Emscripten.
- Lua 5.2
- Runs Lua code directly.
- It just works.
- 644k (199k gzipped).
Lua.vm.js
Support:
- Firefox 4+
- Chrome 17+
- Safari 6+
- IE 10+
- iOS 6+
- Android 4.1+
Lua.vm.js
- Relatively heavy
- Slow on low-power devices.
- Slow(ish) starting up.
- No big projects using it yet
- Debugging
Lua.vm.js
- Host API
- js.global.document
- js.new.WebSocket()
- Can't pass tables out into host environment.
- Issues calling host functions
Moonshine
Moonshine
- Runs Lua bytecode.
- Reimplements the Lua bytecode instruction set
- Includes reimplemented standard library.
- 60k (19k gzipped).
- Also runs in ActionScript (Flash).
Moonshine
- Coroutines.
- Pattern matching.
- require()
- Packaged with debug engine.
Jackpotjoy
Moonshine
Support:
- Firefox 3+ *
- Chrome 14+ *
- Safari 4+ *
- IE 6+ *
- iOS 3+ *
- Android 2.2+ *
Moonshine
- Balanced matching: %b
- Some standard library functions missing:
Moonshine
Future:
- JIT?
- Implement Lua 5.2.
- Integrate into Löve WebPlayer.
- Integrate with remotedebug.org
- Virtual file system using local storage?